comparison CMakeLists.txt @ 135:a2dbb5024fdf

install in cmake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Oct 2012 12:07:27 +0200
parents bdc60d16cc98
children 3ad78369fcc4
comparison
equal deleted inserted replaced
134:bdc60d16cc98 135:a2dbb5024fdf
1 cmake_minimum_required(VERSION 2.8) 1 cmake_minimum_required(VERSION 2.8)
2 2
3 project(Orthanc) 3 project(Orthanc)
4
5 # Version of the build, should always be "mainline" except in release branches
6 add_definitions(
7 -DORTHANC_VERSION="mainline"
8 )
4 9
5 # Parameters of the build 10 # Parameters of the build
6 SET(STATIC_BUILD ON CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") 11 SET(STATIC_BUILD ON CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
7 SET(STANDALONE_BUILD OFF CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)") 12 SET(STANDALONE_BUILD OFF CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)")
8 SET(ENABLE_SSL ON CACHE BOOL "Include support for SSL") 13 SET(ENABLE_SSL ON CACHE BOOL "Include support for SSL")
9 SET(BUILD_UNIT_TESTS ON CACHE BOOL "Build the unit tests") 14 SET(BUILD_UNIT_TESTS ON CACHE BOOL "Build the unit tests")
10 SET(DEBIAN_FORCE_HARDENING OFF CACHE BOOL "Force the injection of Debian hardening flags (unrecommended)") 15
16 # Advanced parameters (for Debian packaging)
11 SET(USE_DYNAMIC_JSONCPP OFF CACHE BOOL "Use the dynamic version of JsonCpp (only for Debian sid)") 17 SET(USE_DYNAMIC_JSONCPP OFF CACHE BOOL "Use the dynamic version of JsonCpp (only for Debian sid)")
12 SET(USE_DYNAMIC_GOOGLE_LOG ON CACHE BOOL "Use the dynamic version of Google Log") 18 SET(USE_DYNAMIC_GOOGLE_LOG ON CACHE BOOL "Use the dynamic version of Google Log")
13 SET(USE_DYNAMIC_GOOGLE_TEST ON CACHE BOOL "Use the dynamic version of Google Test (not for Debian sid)") 19 SET(USE_DYNAMIC_GOOGLE_TEST ON CACHE BOOL "Use the dynamic version of Google Test (not for Debian sid)")
14 SET(USE_STATIC_DEBIAN_GOOGLE_TEST OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (only for Debian sid)") 20 SET(DEBIAN_FORCE_HARDENING OFF CACHE BOOL "Force the injection of Debian hardening flags (unrecommended)")
21 SET(DEBIAN_USE_STATIC_GOOGLE_TEST OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (only for Debian sid)")
15 22
16 # Version of the build, should always be "mainline" except in release branches 23 mark_as_advanced(USE_DYNAMIC_JSONCPP)
17 add_definitions( 24 mark_as_advanced(USE_DYNAMIC_GOOGLE_LOG)
18 -DORTHANC_VERSION="mainline" 25 mark_as_advanced(USE_DYNAMIC_GOOGLE_TEST)
19 ) 26 mark_as_advanced(DEBIAN_FORCE_HARDENING)
27 mark_as_advanced(DEBIAN_USE_STATIC_GOOGLE_TEST)
20 28
21 # Some basic inclusions 29 # Some basic inclusions
22 include(CheckIncludeFiles) 30 include(CheckIncludeFiles)
23 include(CheckIncludeFileCXX) 31 include(CheckIncludeFileCXX)
24 include(${CMAKE_SOURCE_DIR}/Resources/CMake/AutoGeneratedCode.cmake) 32 include(${CMAKE_SOURCE_DIR}/Resources/CMake/AutoGeneratedCode.cmake)
132 OrthancServer/main.cpp 140 OrthancServer/main.cpp
133 ) 141 )
134 142
135 target_link_libraries(Orthanc ServerLibrary CoreLibrary) 143 target_link_libraries(Orthanc ServerLibrary CoreLibrary)
136 144
145 install(
146 TARGETS Orthanc
147 RUNTIME DESTINATION bin
148 )
149
137 150
138 # Build the unit tests if required 151 # Build the unit tests if required
139 if (BUILD_UNIT_TESTS) 152 if (BUILD_UNIT_TESTS)
140 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake) 153 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
141 add_executable(UnitTests 154 add_executable(UnitTests