-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
112 lines (88 loc) · 2.74 KB
/
CMakeLists.txt
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
# Oxygen plugin sdk
#
cmake_minimum_required(VERSION 3.10)
#
# handle setup of a cmake toplevel project
# finding libraries etc
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
#
# Force C++17
set(CMAKE_CXX_STANDARD 17)
#
# studio project name
project(ODK)
if( MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif()
if(WIN32)
set(3RDPARTY_LINK_TYPE "static")
elseif(UNIX)
set(3RDPARTY_LINK_TYPE "shared")
endif()
get_filename_component(ODK_ROOT . ABSOLUTE)
message(STATUS "ODKROOT = ${ODK_ROOT}")
# expand cmake search path to check for project settings
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ODK_ROOT}/cmake )
#
# Get general cmake settings
include(CMakeSettings)
#
# Set static runtime
if(WIN32)
SetLinkStaticRuntime()
endif(WIN32)
#
# Set the output directory so that all artefacts will be at the same place
# (moved here to set output directory for 3rdparty libs too)
SetCommonOutputDirectory()
#
# Is github repository (or inside company)
if(NOT DEFINED GITHUB_REPO)
set(GITHUB_REPO True) # default
endif()
# Quiz "inside company"
if (EXISTS driver)
set(GITHUB_REPO False)
endif()
message(STATUS "GITHUB_REPO = ${GITHUB_REPO}")
option(WITH_ODK_TESTS "Enable Unit Tests" OFF)
if (WITH_ODK_TESTS)
message(STATUS "Building with ODK unit tests")
SetBoostOptions() # set static, dynamic ...
set(BOOST_MODULES unit_test_framework)
set(UNIT_TEST_SUFFIX test)
include(CTest)
find_package(Boost REQUIRED COMPONENTS ${BOOST_MODULES})
enable_testing()
if (UNIX)
find_program(MEMORYCHECK_COMMAND valgrind)
set( MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full" )
endif(UNIX)
endif()
option(WITH_CLANG_TIDY "Enable Clang Tidy checks" OFF)
if (WITH_CLANG_TIDY)
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
if (CLANG_TIDY_EXE)
message(STATUS "clang-tidy found")
set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "-checks=-*,clang-analyzer-*")
else()
message(STATUS "clang-tidy not found")
endif()
endif()
if (EXISTS "${ODK_ROOT}/3rdparty/pugixml-1.9/scripts")
AddUniqueTargetFromSubdirectory(pugixml "${ODK_ROOT}/3rdparty/pugixml-1.9/scripts" "3rdparty/pugixml-1.9")
else()
get_filename_component(SW_APP_ROOT ../../.. ABSOLUTE)
if(EXISTS "${SW_APP_ROOT}/3rdparty/pugixml-1.9/scripts")
AddUniqueTargetFromSubdirectory(pugixml "${SW_APP_ROOT}/3rdparty/pugixml-1.9/scripts" "3rdparty/pugixml-1.9")
else()
message(FATAL_ERROR "pugixml library not found")
endif()
endif()
find_package(SDKQt REQUIRED)
endif()
add_subdirectory(odk)
add_subdirectory(examples)