-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathCMakeLists.txt
91 lines (70 loc) · 2.28 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
cmake_minimum_required( VERSION 2.8 )
project( q )
# recommandation, do not build in source.
set( CMAKE_DISABLE_IN_SOURCE_BUILD ON )
# required for library API/ABI tagging
set( q_MAJOR_VERSION 0 )
set( q_MINOR_VERSION 0 )
set( q_PATCH_VERSION 1 )
set( q_VERSION ${q_MAJOR_VERSION}.${q_MINOR_VERSION}.${q_PATCH_VERSION} )
# if no build config given, we decide
if ( NOT CMAKE_BUILD_TYPE )
set(
CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE )
endif ( )
include( "cmake/projects.cmake" )
include( "cmake/colors.cmake" )
# turn on verbose compilation output
if ( NOT DEFINED ${PROJECT_NAME}_VERBOSE_COMPILE )
option( ${PROJECT_NAME}_VERBOSE_COMPILE "verbose compile" OFF )
endif ( )
# set up the comiler
include( "cmake/compilersetup.cmake" )
# show me what to install
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
# make testing optional
if ( DEFINED ${PROJECT_NAME}_BUILD_TESTS )
option(
${PROJECT_NAME}_BUILD_TESTS
"build tests"
${PROJECT_NAME}_BUILD_TESTS )
else ( )
option( ${PROJECT_NAME}_BUILD_TESTS "build tests" ON )
endif ( )
include_directories( "libs/q/include" )
add_subdirectory( "libs/q" )
if ( ${PROJECT_NAME}_BUILD_TESTS )
enable_testing( )
include_directories( "3rdparty/gtest-1.8.0/include/" )
add_subdirectory( "3rdparty/gtest-1.8.0" )
set( LIBQ_GTEST_LIB gtest_main )
include_directories( "libs/q-test/include" )
add_subdirectory( "libs/q-test" )
add_subdirectory( "tests" )
endif ( )
# TODO does not exits, can be removed ?
# include_directories( "3rdparty/dist/include/" )
# make apps optional
if ( DEFINED ${PROJECT_NAME}_BUILD_APPS )
option(
${PROJECT_NAME}_BUILD_APPS
"build sample and playgournd apps"
${PROJECT_NAME}_BUILD_APPS )
else ( )
option( ${PROJECT_NAME}_BUILD_APPS "build tests" ON )
endif ( )
if ( ${PROJECT_NAME}_BUILD_APPS )
add_subdirectory( "progs/playground" )
add_subdirectory( "progs/benchmark" )
endif ( )
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/libq.pc.cmake.cfg"
"${CMAKE_BINARY_DIR}/libq.pc"
@ONLY )
install(
FILES "${CMAKE_BINARY_DIR}/libq.pc"
DESTINATION lib${LIB_SUFFIX}/pkgconfig )