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

CMakeLists.txt « ArcWelder - github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 688a466ec376c3563d34e5003d3f8af8fcd3320d (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
cmake_minimum_required (VERSION "3.13")

project(ArcWelder C CXX)

option(USE_CXX_EXCEPTIONS "Enable C++ exception support" ON)

# 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})


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()

install(
    TARGETS ${PROJECT_NAME}
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib  # <-- Add this line
    COMPONENT library
)

# 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)