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

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

# You can tweak some common (for all subprojects) stuff here. For example:
project(Build C CXX)

# Use and require C++ 11
set (CMAKE_CXX_STANDARD 11)
set(CXX_STANDARD_REQUIRED)

set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES  ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(USE_CXX_EXCEPTIONS "Enable C++ exception support" ON)

# Add -O0 to remove optimizations when using gcc
IF(CMAKE_COMPILER_IS_GNUCC)
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
ENDIF(CMAKE_COMPILER_IS_GNUCC)

# add a definition so our libraries know that the version info is available
add_definitions("-DHAS_GENERATED_VERSION")
# include the generated header.
include_directories("${CMAKE_BINARY_DIR}/GcodeProcessorLib/generated/")

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

# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
if (POLICY CMP0025)
  cmake_policy(SET CMP0025 NEW)
endif ()

# add subdirectories to compile in order of inheritance
add_subdirectory(${CMAKE_SOURCE_DIR}/TCLAP)
add_subdirectory(${CMAKE_SOURCE_DIR}/GcodeProcessorLib)
add_subdirectory(${CMAKE_SOURCE_DIR}/ArcWelder)
add_subdirectory(${CMAKE_SOURCE_DIR}/ArcWelderConsole)
#include(${CMAKE_CURRENT_SOURCE_DIR}/ArcWelderConsole/CMakeLists.txt)
add_subdirectory(${CMAKE_SOURCE_DIR}/ArcWelderInverseProcessor)
add_subdirectory(${CMAKE_SOURCE_DIR}/PyArcWelder)