blob: c4462a65eabc01264619b3e5720d8580a867d64a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
cmake_minimum_required (VERSION "3.15")
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)
if(MSVC)
# link to the msvc runtime statically, keeping debug info if we are in debug config
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
# Create our library
add_library(${PROJECT_NAME} SHARED ${PyArcWelderSources})
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib # <-- Add this line
COMPONENT library
)
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 ${PYTHON_LIBRARIES})
# On Windows, it is required to link to the Python libraries
if(WIN32 OR APPLE)
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)
|