Settings.cmake
1 # ==============================================================================
2 # Medical Image Registration ToolKit (MIRTK)
3 #
4 # Copyright 2013-2015 Imperial College London
5 # Copyright 2013-2015 Andreas Schuh
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 # http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ==============================================================================
19 
20 ################################################################################
21 # @file Settings.cmake
22 # @brief Non-default project settings.
23 #
24 # This file is included by basis_project_impl(), after it looked for the
25 # required and optional dependencies and the CMake variables related to the
26 # project directory structure were defined (see Directories.cmake file in
27 # @c BINARY_CONFIG_DIR). It is also included before the BasisSettings.cmake
28 # file.
29 #
30 # In particular build options should be added in this file using CMake's
31 # <a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:option">
32 # option()</a> command. Further, any common settings related to using a found
33 # dependency can be set here if the basis_use_package() command was enable
34 # to import the required configuration of a particular external package.
35 #
36 # @ingroup BasisSettings
37 ################################################################################
38 
39 # By default, build applications
40 set(BUILD_APPLICATIONS_DEFAULT ON)
41 
42 # By default, do not regenerate .rst files of command help pages
43 option(BUILD_DOCUMENTATION_SOURCES "Regenerate help of commands in reStructuredText format when missing" OFF)
44 
45 # By default, most modules are enabled already...
46 mark_as_advanced(BUILD_ALL_MODULES)
47 
48 # Choose between shared or static linkage (shared is recommended)
49 # Note: BUILD_SHARED_LIBS option added by mirtk_project_begin
50 set(MIRTK_BUILD_SHARED_LIBS_DEFAULT ON)
51 
52 # Enable profiling of program execution (cf. Common/include/mirtkProfiling.h)
53 # Note: WITH_PROFILING option and MIRTK_WITH_PROFILING compile definition added
54 # by mirtk_project_begin when WITH_PROFILING is ON
55 set(MIRTK_WITH_PROFILING_DEFAULT ON)
56 
57 # Testing is yet very limited, hence mark this option as advanced for now
58 mark_as_advanced(BUILD_TESTING)
59 
60 # Always use/find VTK when anyway required by one of the enabled modules
61 if (MODULE_PointSet)
62  if (NOT WITH_VTK)
63  message("VTK required by PointSet module, setting WITH_VTK to ON for all modules")
64  basis_update_value(WITH_VTK ON)
65  endif ()
66 endif ()
67 
68 # Always use IO module when Image or PointSet module and Applications enabled
69 if (BUILD_APPLICATIONS AND (MODULE_Image OR MODULE_PointSet))
70  if (NOT MODULE_IO)
71  message("I/O module required by Applications using the enabled MODULE_Image or MODULE_PointSet,"
72  " setting also MODULE_IO to ON")
73  basis_update_value(MODULE_IO ON)
74  endif ()
75 endif ()
76 
77 # Installation directories
78 if (WIN32)
79  set(INSTALL_CMAKE_MODULES_DIR "${INSTALL_SHARE_DIR}/CMake")
80  set(MIRTK_TOOLS_DIR "${INSTALL_LIBEXEC_DIR}/Tools")
81 else ()
82  set(INSTALL_CMAKE_MODULES_DIR "${INSTALL_SHARE_DIR}/cmake")
83  set(MIRTK_TOOLS_DIR "${INSTALL_LIBEXEC_DIR}/tools")
84 endif ()