-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt to use CMake to build.
- Loading branch information
1 parent
9abd4af
commit 3f28fa1
Showing
24 changed files
with
287 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required (VERSION "3.16") | ||
|
||
project(ArcWelder C CXX) | ||
|
||
# add definitions from the GcodeProcessorLib project | ||
add_definitions(${GcodeProcessorLib_DEFINITIONS}) | ||
|
||
# Include the GcodeProcessorLib's directories | ||
include_directories(${GcodeProcessorLib_INCLUDE_DIRS}) | ||
|
||
# include sourcelist.cmake, which contains our source list and exposes it as the | ||
# ArcWelderSources variable | ||
include(sourcelist.cmake) | ||
|
||
# Add a library using our ArcWelderSources variable from our sourcelist file | ||
add_library(${PROJECT_NAME} STATIC ${ArcWelderSources}) | ||
|
||
# Link the GcodeProcessorLib | ||
target_link_libraries(${PROJECT_NAME} GcodeProcessorLib) | ||
|
||
# Expose the GcodeProcessorLib's Definitions | ||
set(${PROJECT_NAME}_DEFINITIONS ${GcodeProcessorLib_DEFINITIONS} | ||
CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) | ||
|
||
# Expose both the ArcWelder and GcodeProcessorLib's public includes | ||
set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/ | ||
${GcodeProcessorLib_INCLUDE_DIRS} | ||
CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set(ArcWelderSources ${ArcWelderSources} | ||
arc_welder.cpp | ||
segmented_arc.cpp | ||
segmented_shape.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required (VERSION "3.16") | ||
|
||
project(ArcWelderConsole C CXX) | ||
|
||
# add definitions from the GcodeProcessorLib and ArcWelder libraries | ||
add_definitions(${GcodeProcessorLib_DEFINITIONS} ${ArcWelder_DEFINITIONS}) | ||
|
||
# Include the GcodeProcessorLib and ArcWelder's directories | ||
include_directories(${GcodeProcessorLib_INCLUDE_DIRS} ${ArcWelder_INCLUDE_DIRS}) | ||
|
||
# include sourcelist.cmake, which contains our source list and exposes it as the | ||
# ArcWelderConsoleSources variable | ||
include(sourcelist.cmake) | ||
|
||
# Add an executable our ArcWelderConsoleSources variable from our sourcelist file | ||
add_executable(${PROJECT_NAME} ${ArcWelderConsoleSources}) | ||
|
||
# specify linking to the GcodeProcessorLib and ArcWelder libraries | ||
target_link_libraries(${PROJECT_NAME} GcodeProcessorLib ArcWelder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(ArcWelderConsoleSources ${ArcWelderConsoleSources} | ||
ArcWelderConsole.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required (VERSION "3.16") | ||
|
||
project(ArcWelderInverseProcessor C CXX) | ||
|
||
# add definitions from the GcodeProcessorLib and ArcWelder libraries | ||
add_definitions(${GcodeProcessorLib_DEFINITIONS} ${ArcWelder_DEFINITIONS}) | ||
|
||
# Include the GcodeProcessorLib and ArcWelder's directories | ||
include_directories(${GcodeProcessorLib_INCLUDE_DIRS} ${ArcWelder_INCLUDE_DIRS}) | ||
|
||
# include sourcelist.cmake, which contains our source list and exposes it as the | ||
# ArcWelderConsoleSources variable | ||
include(sourcelist.cmake) | ||
|
||
# Add an executable our ArcWelderConsoleSources variable from our sourcelist file | ||
add_executable(${PROJECT_NAME} ${ArcWelderInverseProcessorSources}) | ||
|
||
# specify linking to the GcodeProcessorLib and ArcWelder libraries | ||
target_link_libraries(${PROJECT_NAME} GcodeProcessorLib ArcWelder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(ArcWelderInverseProcessorSources ${ArcWelderInverseProcessorSources} | ||
ArcWelderInverseProcessor.cpp | ||
inverse_processor.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required (VERSION "3.16") | ||
# You can tweak some common (for all subprojects) stuff here. For example: | ||
project(Build C CXX) | ||
|
||
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) | ||
set(CMAKE_DISABLE_SOURCE_CHANGES ON) | ||
|
||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") | ||
message(SEND_ERROR "In-source builds are not allowed.") | ||
endif () | ||
|
||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
set(CMAKE_COLOR_MAKEFILE ON) | ||
|
||
# Remove 'lib' prefix for shared libraries on Windows | ||
if (WIN32) | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
endif () | ||
|
||
# add subdirectories to compile in order of inheritance | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/GcodeProcessorLib) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/ArcWelder) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/ArcWelderConsole) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/ArcWelderInverseProcessor) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/PyArcWelder) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cmake_minimum_required (VERSION "3.16") | ||
|
||
project(GcodeProcessorLib C CXX) | ||
|
||
# include sourcelist.cmake, which contains our source list and exposes it as the | ||
# GcodeProcessorLibSources variable | ||
include(sourcelist.cmake) | ||
|
||
# Add a library using our GcodeProcessorLibSources variable from our sourcelist file | ||
add_library(${PROJECT_NAME} STATIC ${GcodeProcessorLibSources}) | ||
|
||
# Required on Unix OS family to be able to be linked into shared libraries. | ||
set_target_properties(${PROJECT_NAME} | ||
PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
|
||
target_link_libraries(${PROJECT_NAME}) | ||
|
||
# Expose the public includes via a cache variable | ||
set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} | ||
CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set(GcodeProcessorLibSources ${GcodeProcessorLibSources} | ||
array_list.cpp | ||
array_list.h | ||
circular_buffer.cpp | ||
circular_buffer.h | ||
extruder.cpp | ||
extruder.h | ||
gcode_comment_processor.cpp | ||
gcode_comment_processor.h | ||
gcode_parser.cpp | ||
gcode_parser.h | ||
gcode_position.cpp | ||
gcode_position.h | ||
logger.cpp | ||
logger.h | ||
parsed_command.cpp | ||
parsed_command.h | ||
parsed_command_parameter.cpp | ||
parsed_command_parameter.h | ||
position.cpp | ||
position.h | ||
utilities.cpp | ||
utilities.h | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
cmake_minimum_required (VERSION "3.16") | ||
|
||
project(PyArcWelder C CXX) | ||
|
||
# PythonLibs is required to build a python extension | ||
find_package(PythonLibs REQUIRED) | ||
|
||
# Add definitions from ArcWelder and GcodeProcessorLib | ||
add_definitions(${ArcWelder_DEFINITIONS} ${GcodeProcessorLib_DEFINITIONS}) | ||
|
||
# Include Python, ArcWelder and GcodeProcessorLib | ||
include_directories(${PYTHON_INCLUDE_DIRS} ${ArcWelder_INCLUDE_DIRS} ${GcodeProcessorLib_INCLUDE_DIRS}) | ||
|
||
# include sourcelist.cmake, which contains our source list and exposes it as the | ||
# PyArcWelderSources variable | ||
include(sourcelist.cmake) | ||
|
||
# Create our library | ||
add_library(${PROJECT_NAME} SHARED ${PyArcWelderSources}) | ||
|
||
set_target_properties( | ||
${PROJECT_NAME} | ||
PROPERTIES | ||
PREFIX "" | ||
OUTPUT_NAME ${PROJECT_NAME} | ||
LINKER_LANGUAGE C | ||
) | ||
|
||
if(WIN32) | ||
set_target_properties( | ||
${PROJECT_NAME} | ||
PROPERTIES | ||
SUFFIX ".pyd" | ||
) | ||
endif() | ||
|
||
# Link to ArcWelder, GcodeProcessorLib and the Python Libraries | ||
target_link_libraries(${PROJECT_NAME} ArcWelder GcodeProcessorLib) | ||
|
||
# On Windows, it is required to link to the Python libraries | ||
if(WIN32) | ||
target_link_libraries(${PROJECT_NAME} ArcWelder GcodeProcessorLib ${PYTHON_LIBRARIES}) | ||
endif() | ||
|
||
# Expose the GcodeProcessorLib, and ArcWelder's Definitions. | ||
set(${PROJECT_NAME}_DEFINITIONS ${GcodeProcessorLib_DEFINITIONS} | ||
${ArcWelder_DEFINITIONS} | ||
CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) | ||
|
||
# Expose the GcodeProcessorLib, ArcWelder and PyArcWelder's Definitions. | ||
set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/ | ||
${ArcWelder_INCLUDE_DIRS} | ||
${GcodeProcessorLib_INCLUDE_DIRS} | ||
CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set(PyArcWelderSources ${PyArcWelderSources} | ||
py_arc_welder.cpp | ||
py_arc_welder_extension.cpp | ||
py_logger.cpp | ||
python_helpers.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
|
||
|
||
|