Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CMakeLists.txt « PyArcWelder - github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d17456e58c990345df6dad3340f4824a7da9a88 (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
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})


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)