forked from helgebetzinger/coasync4cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
99 lines (68 loc) · 2.79 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
# root cmake file
# todo
# gtest in das co.. - Projekt direkt mit einbinden
# install created stuff and add dependen libraries, especially for qt5:
# https://code.google.com/p/glmixer/source/browse/trunk/src/CMakeLists.txt notwendige
# Minimal version
cmake_minimum_required (VERSION 3.0)
# What we are
project (coasync4cpp)
####### public build options
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
option(build_coasync4qt "Build qt specific library, requires at least qt 5.0." OFF)
option(build_tests "Build coasync specific unit-tests." OFF)
####### global settings
# our own tools directory
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include (utils)
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}" )
set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}" )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}" )
configure_platform_specific_compiler_flags()
message( STATUS "\t output dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ..." )
message( STATUS "\t system: ${CMAKE_SYSTEM_NAME} " )
message( STATUS "\t CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS} ")
####### boost
# we need to configure boost here, because of the automatic linker option on windows.
# for this option we need to add the boost library path to the library search paths.
set(BOOST_MIN_VERSION "1.55.0")
add_definitions( -DBOOST_THREAD_VERSION=4 )
set( Boost_USE_STATIC_LIBS ON)
set( Boost_USE_MULTITHREADED ON)
set( Boost_USE_STATIC_RUNTIME OFF)
find_package (Boost ${BOOST_MIN_VERSION} REQUIRED)
if (NOT Boost_FOUND)
message(FATAL_ERROR "Fatal error: Boost (version >= ${BOOST_MIN_VERSION}) required.\n")
endif (NOT Boost_FOUND)
link_directories (${Boost_LIBRARY_DIR})
####### coasync4cpp
message ( STATUS "\tcreate coasync4cpp..." )
add_subdirectory (coasync4cpp)
project_group( coasync4cpp "Libs")
####### coasync4qt
if (build_coasync4qt)
message ( STATUS "\tcreate coasync4qt..." )
add_subdirectory (coasync4qt)
project_group( coasync4qt "Libs")
endif()
####### if tests are requested ...
if (build_tests)
set( BUILD_SHARED_LIBS ON )
set( gtest_build_samples OFF )
add_subdirectory(gtest-1.7.0)
include_directories( ${CMAKE_SOURCE_DIR}/gtest-1.7.0/include )
project_group( gtest "Tests")
project_group( gtest_main "Tests")
endif()
if (build_tests)
add_subdirectory(testcoasync4cpp)
project_group( testcoasync4cpp "Tests")
endif()
if (build_tests )
if (build_coasync4qt)
add_subdirectory(testcoasync4qt)
project_group( testcoasync4qt "Tests" )
endif()
endif()