-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
93 lines (74 loc) · 3.6 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
# Copyright: Universidad Carlos III de Madrid (C) 2016;
# Authors: Juan G Victores
# CopyPolicy: Released under the terms of the GNU GPL v2.0.
# Exploit new cmake 2.6 features (export).
# reduce warning level with cmake 2.6
cmake_minimum_required(VERSION 2.6)
#cmake policies
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
project(WAITER)
### options: cpp libraries
#option(ENABLE_ExampleLibrary "Choose if you want to compile ExampleLibrary" TRUE)
### options: cpp programs
option(ENABLE_waiterArmMov "Choose if you want to compile waiterArmMov" TRUE)
option(ENABLE_waiterDialogueManager "Choose if you want to compile waiterDialogueManager" TRUE)
option(ENABLE_waiterExecutionCore "Choose if you want to compile waiterExecutionCore" TRUE)
### options: force default
#option(ENABLE_exampleExtraOption "Enable/disable option exampleExtraOption" TRUE)
if(MSVC)
MESSAGE(STATUS "Running on windows")
set(CMAKE_DEBUG_POSTFIX "d")
endif(MSVC)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, recommanded options are: Debug or Release")
endif(NOT CMAKE_BUILD_TYPE)
# Hide variable to MSVC users, since it is not needed
if (MSVC)
mark_as_advanced(CMAKE_BUILD_TYPE)
endif(MSVC)
######################
### this makes everything go in $FOLLOW_ME_DIR/lib and $FOLLOW_ME_DIR/bin
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
message(STATUS "Libraries go to ${LIBRARY_OUTPUT_PATH}")
message(STATUS "Executables go to ${EXECUTABLE_OUTPUT_PATH}")
# this doesn't happen automatically for makefiles
make_directory(${LIBRARY_OUTPUT_PATH})
make_directory(${EXECUTABLE_OUTPUT_PATH})
# and let us clean their contents on a "make clean"
##set_directory_properties(PROPERTIES LIBRARY_OUTPUT_PATH ADDITIONAL_MAKE_CLEAN_FILES)
##set_directory_properties(PROPERTIES EXECUTABLE_OUTPUT_PATH ADDITIONAL_MAKE_CLEAN_FILES)
mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
mark_as_advanced(CMAKE_BACKWARDS_COMPATIBILITY)
##########################################
# Pick up our cmake modules - they are all in the cmake subdirectory
set(WAITER_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# let cmake use them
list(APPEND CMAKE_MODULE_PATH ${WAITER_MODULE_PATH})
set(WAITER_INCLUDE_DIRS CACHE INTERNAL "appended header dirs" FORCE)
set(WAITER_LINK_DIRS CACHE INTERNAL "appended link dirs" FORCE)
set(WAITER_LIBRARIES CACHE INTERNAL "appended libraries" FORCE)
# add main contents
add_subdirectory(share)
add_subdirectory(libraries)
add_subdirectory(programs)
# export our variables to a FOLLOW_MEConfig.cmake creation
set(WAITER_LINK_DIRS ${WAITER_LINK_DIRS} ${LIBRARY_OUTPUT_PATH})
configure_file(${CMAKE_SOURCE_DIR}/cmake/template/WAITERConfig.cmake.in
${CMAKE_BINARY_DIR}/WAITERConfig.cmake @ONLY)
# create a symbolic link to the shared directory (as contains models and may be heavy)
# If you want a deep copy, you can use the copy_directory command instead of create_symlink.
#add_custom_target(install_applications COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/share ${CMAKE_SOURCE_DIR}/../share)
#endif(MSVC)
##add_custom_target(nuke
## "${CMAKE_COMMAND}" -E "remove_directory" "${CMAKE_SOURCE_DIR}/bin" ";"
## "${CMAKE_COMMAND}" -E "remove_directory" "${CMAKE_SOURCE_DIR}/lib")
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/template/WAITERConfigUninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/WAITERConfigUninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/WAITERConfigUninstall.cmake)