forked from medInria/medInria-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
98 lines (75 loc) · 2.63 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
#######################################################################
#
# medInria
#
# Copyright (c) INRIA 2013. All rights reserved.
# See LICENSE.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#
#######################################################################
cmake_minimum_required(VERSION 2.8)
project(medInria)
set(${PROJECT_NAME}_VERSION_MAJOR 2 CACHE STRING
"medInria major version number."
)
mark_as_advanced(${PROJECT_NAME}_VERSION_MAJOR)
set(${PROJECT_NAME}_VERSION_MINOR 1 CACHE STRING
"medInria minor version number."
)
mark_as_advanced(${PROJECT_NAME}_VERSION_MINOR)
set(${PROJECT_NAME}_VERSION_PATCH 2 CACHE STRING
"medInria build version number."
)
mark_as_advanced(${PROJECT_NAME}_VERSION_PATCH)
set(${PROJECT_NAME}_VERSION_TWEAK git CACHE STRING
"medInria development marker."
)
mark_as_advanced(${PROJECT_NAME}_VERSION_TWEAK)
if (NOT ${${PROJECT_NAME}_VERSION_TWEAK} STREQUAL "")
set(${PROJECT_NAME}_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}.${${PROJECT_NAME}_VERSION_TWEAK}
)
else()
set(${PROJECT_NAME}_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}
)
endif()
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UP)
add_definitions(-D${PROJECT_NAME_UP}_VERSION="${${PROJECT_NAME}_VERSION}")
if (WIN32)
option(MED_SHOW_CONSOLE "Show console at runtime (mainly for debugging)" "FALSE")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
option(MEDINRIA_BUILD_TESTING "Build testing" false)
enable_testing()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(medInriaBuild)
include(medInria-pluginsBuild)
find_package(dtk REQUIRED)
include(${dtk_USE_FILE})
#configure ctest variables
option(MEDINRIA_BUILD_REPORTING "Build Reporting")
if (MEDINRIA_BUILD_REPORTING)
include(dtkReporting)
endif()
option(MEDINRIA_BUILD_DOCUMENTATION "Build documentation" false)
if (MSVC)
include(dtkPch)
option(MEDINRIA_USE_PRECOMPILED_HEADERS "Use precompiled headers" false)
endif()
add_subdirectory(src)
add_subdirectory(src-plugins)
add_subdirectory(app)
if (MEDINRIA_BUILD_TESTING)
add_subdirectory(tests)
endif()
if (MEDINRIA_BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif()
if (APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/MedInriaOSXBundleInfo.plist.in")
endif()