This repository has been archived by the owner on Nov 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
72 lines (62 loc) · 2.76 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
# project name and specify the minumum cmake version.
project (psrdada_cpp CXX)
cmake_minimum_required (VERSION 3.0)
enable_testing()
# The version number.
set (psrdada_cpp_VERSION_MAJOR 0)
set (psrdada_cpp_VERSION_MINOR 1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# cmake setup.
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake)
# default installtion locations (note these will be prefixed by ${CMAKE_INSTALL_PREFIX})
if(NOT LIBRARY_INSTALL_DIR)
set(LIBRARY_INSTALL_DIR "lib")
endif(NOT LIBRARY_INSTALL_DIR)
if(NOT INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR "include/${CMAKE_PROJECT_NAME}")
endif(NOT INCLUDE_INSTALL_DIR)
if(NOT MODULES_INSTALL_DIR)
set (MODULES_INSTALL_DIR "share/${CMAKE_PROJECT_NAME}")
endif(NOT MODULES_INSTALL_DIR)
if(NOT BINARY_INSTALL_DIR)
set(BINARY_INSTALL_DIR "bin/")
endif(NOT BINARY_INSTALL_DIR)
# get project dependencies and compiler settings.
include(dependencies)
# === process through the cheetah tree:
add_subdirectory(${CMAKE_PROJECT_NAME})
# === Print build options summary.
set(DEBUG_PRINT ON)
if (DEBUG_PRINT)
message(STATUS "")
message(STATUS "****************************************************************************")
message(STATUS " name: ${CMAKE_PROJECT_NAME} version: ${PROJECT_VERSION}")
message(STATUS "")
message(STATUS "")
message(STATUS " Compiler Options:")
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS " C++ Compiler: ${CMAKE_CXX_COMPILER}")
if (${CMAKE_BUILD_TYPE} MATCHES release)
message(STATUS " C++ flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
elseif (${CMAKE_BUILD_TYPE} MATCHES debug)
message(STATUS " C++ flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
elseif (${CMAKE_BUILD_TYPE} MATCHES relwithdebinfo)
message(STATUS " C++ flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
elseif (${CMAKE_BUILD_TYPE} MATCHES minsizerel)
message(STATUS " C++ flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_MINSIZEREL}")
endif ()
message(STATUS "")
message(STATUS "Install locations: (make install)")
message(STATUS " Libraries: ${CMAKE_INSTALL_PREFIX}/lib")
message(STATUS " Inclues: ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}")
message(STATUS " Binaries: ${CMAKE_INSTALL_PREFIX}/${BINARY_INSTALL_DIR}")
if(ENABLE_DOC)
message(STATUS " Doc: ${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}")
else(ENABLE_DOC)
message(STATUS " Doc: Disabled (-DENABLE_DOC=true to enable)")
endif(ENABLE_DOC)
message(STATUS " Other: ${CMAKE_INSTALL_PREFIX}/${MODULES_INSTALL_DIR}")
message(STATUS "****************************************************************************")
message(STATUS "")
endif (DEBUG_PRINT)