-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
81 lines (55 loc) · 1.84 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
cmake_minimum_required(VERSION 3.2)
project(ComponentManager CXX)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_ERROR_DEPRECATED ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(BUILD_EXAMPLES "Build Examples" ON)
get_directory_property(hasParent PARENT_DIRECTORY)
if(hasParent)
set(BUILD_EXAMPLES OFF)
message ("Do not build examples for this lib used as a sub-directory.")
endif()
find_package(Qt5 COMPONENTS
Core
Gui)
# ==============================================================================
if (WIN32)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
endif ()
# ==============================================================================
get_filename_component(PROJECT_DIR "." ABSOLUTE)
# Install directories relative to install prefix
set(INSTALL_BINARY_DIR bin)
set(INSTALL_INCLUDE_DIR include)
set(INSTALL_LIBRARY_DIR lib)
#set(INSTALL_SOURCE_DIR source)
set(INSTALL_EXAMPLE_DIR examples)
if (WIN32)
set(INSTALL_CMAKE_DIR cmake)
else()
set(INSTALL_CMAKE_DIR share/cmake/ComponentManager)
endif ()
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Targets
# ==============================================================================
# ==============================================================================
# Lib sources
add_subdirectory("${PROJECT_DIR}/source" ./lib)
# Thirdparty
add_subdirectory("${PROJECT_DIR}/thirdparty")
# Tests
add_subdirectory("${PROJECT_DIR}/tests" ./bin)
# Examples
if(BUILD_EXAMPLES)
add_subdirectory("${PROJECT_DIR}/examples" ./examples)
endif()
# Docs
#add_subdirectory("${PROJECT_DIR}/doc" ./doc)
# vim:ft=cmake:fenc=utf-8:ff=unix:ts=2:sw=2:tw=80:et: