BasisSettings.cmake
Go to the documentation of this file.
1 # ============================================================================
2 # Copyright (c) 2011-2012 University of Pennsylvania
3 # Copyright (c) 2013-2016 Andreas Schuh
4 # All rights reserved.
5 #
6 # See COPYING file for license information or visit
7 # https://cmake-basis.github.io/download.html#license
8 # ============================================================================
9 
10 ##############################################################################
11 # @file BasisSettings.cmake
12 # @brief Default project-independent settings.
13 #
14 # This module defines global CMake constants and variables which are used
15 # by the BASIS CMake functions and macros. Hence, these values can be used
16 # to configure the behavior of these functions to some extent without the
17 # need to modify the functions themselves.
18 #
19 # @note As this file also sets the CMake policies to be used, it has to
20 # be included using the @c NO_POLICY_SCOPE in order for these policies
21 # to take effect also in the including file and its subdirectories.
22 #
23 # @attention Be careful when caching any of the variables. Usually, this
24 # file is included in the root CMake configuration file of the
25 # project which may also be a module of another project and hence
26 # may overwrite this project's settings.
27 #
28 # @attention Keep in mind that this file is included before any other
29 # BASIS module. Further, project-specific information such as
30 # the project name are not defined yet.
31 #
32 # @ingroup BasisSettings
33 ##############################################################################
34 
36  return ()
37 else ()
39 endif ()
40 
41 ## @addtogroup BasisSettings
42 # @{
43 
44 
45 # ============================================================================
46 # CMake version and policies
47 # ============================================================================
48 
49 cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
50 
51 # Add policies introduced with CMake versions newer than the one specified
52 # above. These policies would otherwise trigger a policy not set warning by
53 # newer CMake versions.
54 
55 if (POLICY CMP0016)
56  cmake_policy (SET CMP0016 NEW)
57 endif ()
58 
59 if (POLICY CMP0017)
60  cmake_policy (SET CMP0017 NEW)
61 endif ()
62 
63 if (POLICY CMP0042)
64  cmake_policy (SET CMP0042 NEW)
65 endif ()
66 
67 # ============================================================================
68 # required modules
69 # ============================================================================
70 
71 include ("${CMAKE_CURRENT_LIST_DIR}/CommonTools.cmake")
72 
73 # ============================================================================
74 # generator expressions
75 # ============================================================================
76 
77 ## @brief Name of build configuration ("$<CONFIG>") generator expression
78 if (CMAKE_MAJOR_VERSION LESS 3)
79  set (BASIS_GE_CONFIG "CONFIGURATION")
80 else ()
81  set (BASIS_GE_CONFIG "CONFIG")
82 endif ()
83 
84 # ============================================================================
85 # meta-data lists
86 # ============================================================================
87 
88 ## @brief Names of project meta-data switches.
89 set (
91  EXCLUDE_FROM_ALL # exclude module from BUILD_ALL_MODULES
92 )
93 
94 ## @brief Names of project meta-data with only one argument.
95 # @see basis_project() in ProjectTools.cmake
96 set (
97  BASIS_METADATA_LIST_SINGLE
98  AUTHOR
99  NAME
100  SUBPROJECT
101  PACKAGE # short alias for PACKAGE_NAME
102  WEBSITE # short alias for PACKAGE_WEBSITE
103  VENDOR # short alias for PACKAGE_VENDOR
104  PROVIDER # short alias for PACKAGE_VENDOR (not PROVIDER_NAME, see basis_project!)
105  PACKAGE_NAME
106  PACKAGE_VENDOR # package vendor ID used for installation path
107  PACKAGE_WEBSITE
108  PACKAGE_LOGO
109  PROVIDER_NAME
110  PROVIDER_WEBSITE
111  PROVIDER_LOGO
112  DIVISION_NAME
113  DIVISION_WEBSITE
114  DIVISION_LOGO
115  COPYRIGHT
116  LICENSE
117  CONTACT
118  VERSION
119  SOVERSION
120  TEMPLATE # used by basisproject tool
121  INCLUDE_DIR # alias for INCLUDE_DIRS
122  CODE_DIR # alias for CODE_DIRS
123  TOOLS_DIR # alias for TOOLS_DIRS
124  MODULES_DIR # single directory containing multiple modules, see also MODULE_DIRS
125  CONFIG_DIR # directory containing the CMake/BASIS configuration
126  DATA_DIR # directory containing the auxiliary program data
127  DOC_DIR # directory containing the documentation
128  DOCRES_DIR # directory containing the ressource files such as a project logo
129  EXAMPLE_DIR # directory containing some example files
130  LIBRARY_DIR # directory containing script libraries such as Perl or Python modules
131  TESTING_DIR # directory containing the source code and data of the software tests
132 )
133 
134 ## @brief Names of project meta-data with multiple arguments.
135 # @see basis_project() in ProjectTools.cmake
136 set (
137  BASIS_METADATA_LIST_MULTI
138  AUTHORS
139  DESCRIPTION
140  LANGUAGES
141  DEFAULT_MODULES # list of modules to be enabled by default
142  EXTERNAL_MODULES # list of external project modules
143  DEPENDS
144  OPTIONAL_DEPENDS
145  TOOLS_DEPENDS
146  OPTIONAL_TOOLS_DEPENDS
147  TEST_DEPENDS
148  OPTIONAL_TEST_DEPENDS
149  INCLUDE_DIRS # list of directories containing public header files
150  CODE_DIRS # list of directories containing source code files, see also CODE_DIR
151  TOOLS_DIRS # list of directories containing source code files of applications, see also TOOLS_DIR
152  MODULE_DIRS # list of separate module directories, see also MODULES_DIR
153  OTHER_DIRS # list of additional (generic) project subdirectories
154  SUBDIRS # deprecated option name for OTHER_DIRS
155 )
156 
157 ## @brief Names of project meta-data.
158 # @see basis_project() in ProjectTools.cmake
159 set (
160  BASIS_METADATA_LIST
162  ${BASIS_METADATA_LIST_SINGLE}
163  ${BASIS_METADATA_LIST_MULTI}
164 )
165 
166 ## @brief Names of additional meta-data for Slicer modules with only one argument.
167 set (
168  BASIS_SLICER_METADATA_LIST_SINGLE
169  HOMEPAGE
170  ICONURL
171  STATUS
172  SCREENSHOTURLS
173 )
174 
175 ## @brief Names of additional meta-data for Slicer modules with multiple arguments.
176 set (
177  BASIS_SLICER_METADATA_LIST_MULTI
178  ACKNOWLEDGEMENTS
179  CATEGORY
180  CONTRIBUTORS
181  LICENSE_SHORT_DESCRIPTION
182 )
183 
184 ## @brief Names of additional meta-data for Slicer modules.
185 set (
186  BASIS_SLICER_METADATA_LIST
187  ${BASIS_SLICER_METADATA_LIST_SINGLE}
188  ${BASIS_SLICER_METADATA_LIST_MULTI}
189 )
190 
191 # ============================================================================
192 # constants and global settings
193 # ============================================================================
194 
195 ## @brief List of name patterns used for special purpose targets.
196 #
197 # Contains a list of target name patterns that are used by the BASIS functions
198 # for special purposes and are hence not to be used for project targets.
199 set (
200  BASIS_RESERVED_TARGET_NAMES
201  "all"
202  "bundle"
203  "bundle_source"
204  "changelog"
205  "clean"
206  "depend"
207  "doc"
208  "headers"
209  "headers_check"
210  "package"
211  "package_source"
212  "scripts"
213  "test"
214  "uninstall"
215 )
216 
217 ## @brief Names of recognized properties on targets.
218 #
219 # Unfortunately, the @c ARGV and @c ARGN arguments of a CMake function()
220 # or macro() does not preserve values which themselves are lists. Therefore,
221 # it is not possible to distinguish between property names and their values
222 # in the arguments passed to set_target_properties() or
223 # basis_set_target_properties(). To overcome this problem, this list specifies
224 # all the possible property names. Everything else is considered to be a
225 # property value except the first argument follwing right after the
226 # @c PROPERTIES keyword. Alternatively, basis_set_property() can be used
227 # as here no disambiguity exists.
228 #
229 # @note Placeholders such as &lt;CONFIG&gt; are allowed. These are treated
230 # as the regular expression "[^ ]+". See basis_list_to_regex().
231 #
232 # @sa https://cmake.org/cmake/help/v3.4/manual/cmake-properties.7.html#properties-on-targets
233 set (BASIS_PROPERTIES_ON_TARGETS
234  # CMake
235  <CONFIG>_OUTPUT_NAME
236  <CONFIG>_POSTFIX
237  ALIASED_TARGET
238  ANDROID_ANT_ADDITIONAL_OPTIONS
239  ANDROID_API
240  ANDROID_API_MIN
241  ANDROID_ARCH
242  ANDROID_ASSETS_DIRECTORIES
243  ANDROID_GUI
244  ANDROID_JAR_DEPENDENCIES
245  ANDROID_JAR_DIRECTORIES
246  ANDROID_JAVA_SOURCE_DIR
247  ANDROID_NATIVE_LIB_DEPENDENCIES
248  ANDROID_NATIVE_LIB_DIRECTORIES
249  ANDROID_PROCESS_MAX
250  ANDROID_PROGUARD
251  ANDROID_PROGUARD_CONFIG_PATH
252  ANDROID_SECURE_PROPS_PATH
253  ANDROID_SKIP_ANT_STEP
254  ANDROID_STL_TYPE
255  ARCHIVE_OUTPUT_DIRECTORY
256  ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
257  ARCHIVE_OUTPUT_NAME
258  ARCHIVE_OUTPUT_NAME_<CONFIG>
259  AUTOGEN_TARGET_DEPENDS
260  AUTOMOC
261  AUTOUIC
262  AUTOUIC_OPTIONS
263  AUTORCC
264  AUTORCC_OPTIONS
265  BINARY_DIR
266  BUILD_WITH_INSTALL_RPATH
267  BUNDLE
268  BUNDLE_EXTENSION
269  C_EXTENSIONS
270  C_STANDARD
271  C_STANDARD_REQUIRED
272  COMPATIBLE_INTERFACE_BOOL
273  COMPATIBLE_INTERFACE_NUMBER_MAX
274  COMPATIBLE_INTERFACE_NUMBER_MIN
275  COMPATIBLE_INTERFACE_STRING
276  COMPILE_DEFINITIONS
277  COMPILE_DEFINITIONS_<CONFIG>
278  COMPILE_FEATURES
279  COMPILE_FLAGS
280  COMPILE_OPTIONS
281  COMPILE_PDB_NAME
282  COMPILE_PDB_NAME_<CONFIG>
283  <CONFIG>_OUTPUT_NAME
284  <CONFIG>_PREFIX
285  CROSSCOMPILING_EMULATOR
286  CXX_EXTENSIONS
287  CXX_STANDARD
288  CXX_STANDARD_REQUIRED
289  DEBUG_POSTFIX
290  DEFINE_SYMBOL
291  EchoString
292  ENABLE_EXPORTS
293  EXCLUDE_FROM_ALL
294  EXCLUDE_FROM_DEFAULT_BUILD
295  EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>
296  EXPORT_NAME
297  FOLDER
298  Fortran_FORMAT
299  Fortran_MODULE_DIRECTORY
300  FRAMEWORK
301  FRAMEWORK_VERSION
302  GENERATOR_FILE_NAME
303  GNUtoMS
304  HAS_CXX
305  IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
306  IMPORTED
307  IMPORTED_CONFIGURATIONS
308  IMPORTED_IMPLIB
309  IMPORTED_IMPLIB_<CONFIG>
310  IMPORTED_LINK_DEPENDENT_LIBRARIES
311  IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>
312  IMPORTED_LINK_INTERFACE_LANGUAGES
313  IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>
314  IMPORTED_LINK_INTERFACE_LIBRARIES
315  IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>
316  IMPORTED_LINK_INTERFACE_MULTIPLICITY
317  IMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>
318  IMPORTED_LOCATION
319  IMPORTED_LOCATION_<CONFIG>
320  IMPORTED_NO_SONAME
321  IMPORTED_NO_SONAME_<CONFIG>
322  IMPORTED_SONAME
323  IMPORTED_SONAME_<CONFIG>
324  IMPORT_PREFIX
325  IMPORT_SUFFIX
326  INCLUDE_DIRECTORIES
327  INSTALL_NAME_DIR
328  INSTALL_RPATH
329  INSTALL_RPATH_USE_LINK_PATH
330  INTERFACE_AUTOUIC_OPTIONS
331  INTERFACE_COMPILE_DEFINITIONS
332  INTERFACE_COMPILE_FEATURES
333  INTERFACE_COMPILE_OPTIONS
334  INTERFACE_INCLUDE_DIRECTORIES
335  INTERFACE_LINK_LIBRARIES
336  INTERFACE_POSITION_INDEPENDENT_CODE
337  INTERFACE_SOURCES
338  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
339  INTERPROCEDURAL_OPTIMIZATION
340  INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
341  JOB_POOL_COMPILE
342  JOB_POOL_LINK
343  LABELS
344  <LANG>_COMPILER_LAUNCHER
345  <LANG>_INCLUDE_WHAT_YOU_USE
346  <LANG>_VISIBILITY_PRESET
347  LIBRARY_OUTPUT_DIRECTORY
348  LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
349  LIBRARY_OUTPUT_NAME
350  LIBRARY_OUTPUT_NAME_<CONFIG>
351  LINKER_LANGUAGE
352  LINK_DEPENDS
353  LINK_DEPENDS_NO_SHARED
354  LINK_FLAGS
355  LINK_FLAGS_<CONFIG>
356  LINK_INTERFACE_LIBRARIES
357  LINK_INTERFACE_LIBRARIES_<CONFIG>
358  LINK_INTERFACE_MULTIPLICITY
359  LINK_INTERFACE_MULTIPLICITY_<CONFIG>
360  LINK_LIBRARIES
361  LINK_SEARCH_END_STATIC
362  LINK_SEARCH_START_STATIC
363  LOCATION
364  LOCATION_<CONFIG>
365  MACOSX_BUNDLE
366  MACOSX_BUNDLE_INFO_PLIST
367  MACOSX_FRAMEWORK_INFO_PLIST
368  MACOSX_RPATH
369  MAP_IMPORTED_CONFIG_<CONFIG>
370  NAME
371  NO_SONAME
372  NO_SYSTEM_FROM_IMPORTED
373  OSX_ARCHITECTURES
374  OSX_ARCHITECTURES_<CONFIG>
375  OUTPUT_NAME
376  OUTPUT_NAME_<CONFIG>
377  PDB_NAME
378  PDB_NAME_<CONFIG>
379  PDB_OUTPUT_DIRECTORY
380  PDB_OUTPUT_DIRECTORY_<CONFIG>
381  POSITION_INDEPENDENT_CODE
382  POST_INSTALL_SCRIPT
383  PREFIX
384  PRE_INSTALL_SCRIPT
385  PRIVATE_HEADER
386  PROJECT_LABEL
387  PUBLIC_HEADER
388  RESOURCE
389  RULE_LAUNCH_COMPILE
390  RULE_LAUNCH_CUSTOM
391  RULE_LAUNCH_LINK
392  RUNTIME_OUTPUT_DIRECTORY
393  RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
394  RUNTIME_OUTPUT_NAME
395  RUNTIME_OUTPUT_NAME_<CONFIG>
396  SKIP_BUILD_RPATH
397  SOURCE_DIR
398  SOURCES
399  SOVERSION
400  STATIC_LIBRARY_FLAGS
401  STATIC_LIBRARY_FLAGS_<CONFIG>
402  SUFFIX
403  TYPE
404  VERSION
405  VISIBILITY_INLINES_HIDDEN
406  VS_DESKTOP_EXTENSIONS_VERSION
407  VS_DOTNET_REFERENCES
408  VS_DOTNET_TARGET_FRAMEWORK_VERSION
409  VS_GLOBAL_KEYWORD
410  VS_GLOBAL_PROJECT_TYPES
411  VS_GLOBAL_ROOTNAMESPACE
412  VS_GLOBAL_<variable>
413  VS_IOT_EXTENSIONS_VERSION
414  VS_IOT_STARTUP_TASK
415  VS_KEYWORD
416  VS_MOBILE_EXTENSIONS_VERSION
417  VS_SCC_AUXPATH
418  VS_SCC_LOCALPATH
419  VS_SCC_PROJECTNAME
420  VS_SCC_PROVIDER
421  VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
422  VS_WINRT_COMPONENT
423  VS_WINRT_EXTENSIONS
424  VS_WINRT_REFERENCES
425  WIN32_EXECUTABLE
426  WINDOWS_EXPORT_ALL_SYMBOLS
427  XCODE_ATTRIBUTE_<an-attribute>
428  XCTEST
429  # BASIS
430  BASIS_INCLUDE_DIRECTORIES # include directories
431  BASIS_LINK_DIRECTORIES # link directories
432  BASIS_LINK_DEPENDS # link libraries
433  BASIS_TYPE # BASIS type of target
434  BASIS_UTILITIES # whether BASIS utilities are used by this target
435  BUNDLED # whether target belongs to same bundle/superbuild
436  SCRIPT_DEFINITIONS # script configuration code
437  SCRIPT_DEFINITIONS_FILE # script configuration file
438  LANGUAGE # language of source files
439  COMPILE # enable/disable compilation of script
440  EXPORT # whether to export target
441  LIBEXEC # whether the target is an auxiliary executable
442  TEST # whether the target is a test
443  MFILE # documentation file of MEX-file
444  COMPONENT # package component of build target
445  LIBRARY_COMPONENT # package component of the library component
446  RUNTIME_COMPONENT # package component of the runtime component
447  ARCHIVE_INSTALL_DIRECTORY # installation directory of library
448  LIBRARY_HEADER_DIRECTORY # output directory of generated header files
449  LIBRARY_INSTALL_DIRECTORY # installation directory of library
450  RUNTIME_INSTALL_DIRECTORY # installation directory of runtime
451  OUTPUT_DIRECTORY # output directory for generated files
452  INSTALL_DIRECTORY # installation directory for generated files
453  HTML_OUTPUT_DIRECTORY # Doxygen/Sphinx HTML output directory
454  HTML_INSTALL_DIRECTORY # Doxygen/Sphinx HTML installation directory
455  DIRHTML_OUTPUT_DIRECTORY # Sphinx HTML output directory
456  DIRHTML_INSTALL_DIRECTORY # Sphinx HTML installation directory
457  SINGLEHTML_OUTPUT_DIRECTORY # Sphinx HTML output directory
458  SINGLEHTML_INSTALL_DIRECTORY # Sphinx HTML installation directory
459  LINKCHECK_OUTPUT_DIRECTORY # Sphinx linkcheck output directory
460  LINKCHECK_INSTALL_DIRECTORY # Sphinx linkcheck installation directory
461  XML_OUTPUT_DIRECTORY # Doxygen XML output directory
462  XML_INSTALL_DIRECTORY # Doxygen XML installation directory
463  MAN_OUTPUT_DIRECTORY # Doxygen/Sphinx MAN output directory
464  MAN_INSTALL_DIRECTORY # Doxygen/Sphinx MAN installation directory
465  TEXT_OUTPUT_DIRECTORY # Sphinx text output directory
466  TEXT_INSTALL_DIRECTORY # Sphinx text installation directory
467  TEXINFO_OUTPUT_DIRECTORY # Sphinx Texinfo output directory
468  TEXINFO_INSTALL_DIRECTORY # Sphinx Texinfo installation directory
469  LATEX_OUTPUT_DIRECTORY # Doxygen/Sphinx LaTeX output directory
470  LATEX_INSTALL_DIRECTORY # Doxygen/Sphinx LaTeX installation directory
471  PDF_OUTPUT_DIRECTORY # Doxygen/Sphinx PDF output directory
472  PDF_INSTALL_DIRECTORY # Doxygen/Sphinx PDF installation directory
473  RTF_OUTPUT_DIRECTORY # Doxygen RTF output directory
474  RTF_INSTALL_DIRECTORY # Doxygen RTF installation directory
475  DOXYFILE # Doxygen configuration file
476  OUTPUT # Doxygen output formats
477  TAGFILE # Doxygen tag file
478  BUILD_DIRECTORY # CMakeFiles build directory of target
479  CONFIG_DIRECTORY # Sphinx configuration directory
480  BINARY_DIRECTORY # CMake build tree directory
481  SOURCE_DIRECTORY # CMake or Sphinx source directory
482  BUILDERS # Sphinx builders
483 )
484 
485 # convert list of property names into regular expression
486 basis_list_to_regex (BASIS_PROPERTIES_ON_TARGETS_RE ${BASIS_PROPERTIES_ON_TARGETS})
487 
488 ## @brief Whether BASIS shall use target UIDs.
489 #
490 # If this option is OFF, target UIDs are idential to the target names
491 # given as arguments to the "basis_add_*" functions.
492 #
493 # The target UIDs ensure that no name conflict between the targets
494 # of this project and those of an external library which are imported
495 # occurs. Another reason for using these target UIDs is to avoid
496 # target name conflicts between modules or subprojects which may
497 # be developed by different teams.
498 #
499 # The downside of using target UIDs is, however, a slower configuration
500 # of the build system because every target name must be mapped to its
501 # target UID and possibly vice versa. Moreover, the use of target UIDs
502 # is less intuitive for those new to BASIS but experienced with CMake.
503 basis_set_if_not_set (BASIS_USE_TARGET_UIDS OFF)
504 
505 ## @brief Whether BASIS shall use fully-qualified target UIDs.
506 #
507 # If this option is OFF, the namespace of the top-level BASIS project is
508 # not prepended to the actual CMake build target names.
509 #
510 # For example, instead of the fully-qualified target UID
511 # "@PROJECT_NAME_L@.target", the CMake target name will simply
512 # be "target". Only when the target is referenced from another project,
513 # the fully-qualified target UID is usually required.
514 basis_set_if_not_set (BASIS_USE_FULLY_QUALIFIED_UIDS OFF)
515 
516 ## @brief Default component used for library targets when no component is specified.
517 #
518 # The default component a library target and its auxiliary files
519 # are associated with if no component was specified, explicitly.
520 set (BASIS_LIBRARY_COMPONENT "Development")
521 
522 ## @brief Default component used for executables when no component is specified.
523 #
524 # The default component an executable target and its auxiliary files
525 # are associated with if no component was specified, explicitly.
526 set (BASIS_RUNTIME_COMPONENT "Runtime")
527 
528 ## @brief Enable the automatic detection of the use of the BASIS utilities.
529 #
530 # If @c TRUE, the basis_add_executable() and basis_add_library() commands will try to
531 # automatically detect whether a given executable or library makes use of the
532 # BASIS utilities. If so, it configures the utilities for this project and adds
533 # a respective library build target as well as a link dependency on this target.
534 # This was the default until BASIS v3.1. Since this version, it is recommended
535 # to either use the @c USE_BASIS_UTILITIES option of basis_add_executable() and
536 # basis_add_library() or to add a link dependency on "basis" (recommended):
537 #
538 # @code
539 # basis_add_executable(foo.cxx)
540 # basis_target_link_libraries(foo basis)
541 # @endcode
542 set (BASIS_UTILITIES FALSE)
543 
544 ## @brief Whether to always build the BASIS C++ utilities even if not required by any target
545 option (BUILD_BASIS_UTILITIES_FOR_CXX "Force the build of the BASIS C++ Utilities even if not used by this project" OFF)
546 ## @brief Whether to always build the BASIS Python utilities even if not required by any target
547 option (BUILD_BASIS_UTILITIES_FOR_PYTHON "Force the build of the BASIS Python Utilities even if not used by this project" OFF)
548 ## @brief Whether to always build the BASIS Perl utilities even if not required by any target
549 option (BUILD_BASIS_UTILITIES_FOR_PERL "Force the build of the BASIS Perl Utilities even if not used by this project" OFF)
550 ## @brief Whether to always build the BASIS Bash utilities even if not required by any target
551 option (BUILD_BASIS_UTILITIES_FOR_BASH "Force the build of the BASIS Bash Utilities even if not used by this project" OFF)
552 
553 mark_as_advanced (BUILD_BASIS_UTILITIES_FOR_CXX
554  BUILD_BASIS_UTILITIES_FOR_PYTHON
555  BUILD_BASIS_UTILITIES_FOR_PERL
556  BUILD_BASIS_UTILITIES_FOR_BASH)
557 
558 ## @brief Whether to export targets by default.
559 #
560 # This global variable specifies the default for the export of build targets if the
561 # @c EXPORT or @c NO_EXPORT options of the basis_add_executable and basis_add_library
562 # commands are not given.
563 set (BASIS_EXPORT_DEFAULT TRUE)
564 
565 ## @brief Suffix used for target exports file "<Package><ExportSuffix>.cmake"
566 set (BASIS_EXPORT_SUFFIX "Exports")
567 
568 ## @brief Whether to create "<Package><ExportSuffix>.cmake" file so other projects can import the exported targets.
569 #
570 # @sa GenerateConfig.cmake, ExportTools.cmake, http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:export
571 set (BASIS_EXPORT_ENABLED ON)
572 
573 basis_is_cached (BASIS_DEPRECATED_CREATE_EXPORTS_FILE_OPTION BASIS_CREATE_EXPORTS_FILE)
574 if (BASIS_DEPRECATED_CREATE_EXPORTS_FILE_OPTION)
575  set (BASIS_EXPORT_ENABLED "${BASIS_CREATE_EXPORTS_FILE}")
576 endif ()
577 
578 ## @brief Disable use of the revision information obtained from the revision
579 # control software such as Subversion or Git.
580 #
581 # If this option is @c TRUE, the revision information is not included in the
582 # @c PROJECT_RELEASE information.
583 option (BASIS_REVISION_INFO "Enable use of the revision information of the revision control software." ON)
584 mark_as_advanced (BASIS_REVISION_INFO)
585 
586 ## @brief Enable compilation of scripts if supported by the language.
587 #
588 # In particular, Python modules are compiled if this option is enabled and
589 # only the compiled modules are installed.
590 #
591 # @sa basis_add_script_target()
592 option (BASIS_COMPILE_SCRIPTS "Enable compilation of scripts if supported by the language." OFF)
593 mark_as_advanced (BASIS_COMPILE_SCRIPTS)
594 
595 
596 ## @brief Enable the installation of scripted modules in site specific default directories.
597 #
598 # If this option is @c ON, scripted modules such as Python and Perl modules, in particular,
599 # are installed in the default installation directories for site packages of the respective
600 # interpreter. This means that these modules may be installed outside the installation
601 # root directory as specified by the @c CMAKE_INSTALL_PREFIX. When this option is set to
602 # @c OFF, all modules are installed in subdirectories of the @c CMAKE_INSTALL_PREFIX.
603 # These directories may have to be added to the search path for modules manually as they
604 # might not be in the default search path of the respective interpreter.
605 #
606 # The installation directories for public modules which are intended for external use
607 # can further be set using the -D option of CMake or be modified by editing the respective
608 # advanced CMake cache variables named <tt>INSTALL_&lt;LANG%gt;_SITE_DIR</tt>.
609 #
610 # @note Even though it is more convenient for the user of a package to have the modules
611 # being installed in the default directories, this option is set to @c OFF by default.
612 # The reasons are that it is in first place expected that the installation will copy
613 # files only to directories within the @c CMAKE_INSTALL_PREFIX. Moreover, it is not
614 # guaranteed that the user has write permissions for the default site packages directories.
615 # Last but not least, when installing public modules located in the @c PROJECT_LIBRARY_DIR
616 # source directory, BASIS does not set a default module @c PREFIX which reduces the risk
617 # of overwriting existing modules of other packages. If the developer of a BASIS package
618 # was not thorough enough and did not follow the guidelines, setting this option to @c ON
619 # has the potential risk of overwriting other packages' modules. Therefore,
620 # modules are only installed in system default locations if explicitly requested.
621 option (BASIS_INSTALL_SITE_PACKAGES "Enable the installation of scripted modules in site specific default directories." OFF)
622 mark_as_advanced (BASIS_INSTALL_SITE_PACKAGES)
623 
624 ## @brief Script used to execute a process in CMake script mode.
625 #
626 # In order to be able to assign a timeout to the execution of a custom command
627 # and to add some error message parsing, this script is used by some build
628 # rules to actually perform the build step. See for example, the build of
629 # executables using the MATLAB Compiler.
630 set (BASIS_SCRIPT_EXECUTE_PROCESS "${BASIS_MODULE_PATH}/ExecuteProcess.cmake")
631 
632 ## @brief File used by default as <tt>--authors</tt> file to <tt>svn2cl</tt>.
633 #
634 # This file lists all Subversion users at SBIA and is used by default for
635 # the mapping of Subversion user names to real names during the generation
636 # of changelogs.
637 set (BASIS_SVN_USERS_FILE "${BASIS_MODULE_PATH}/SubversionUsers.txt")
638 
639 ## @brief Force installation of public header files of BASIS C++ utilities.
640 #
641 # If this variable is set to FALSE, each header file in the @c PROJECT_INCLUDE_DIR
642 # is scanned for an include statement which includes one of the public header
643 # files of the BASIS C++ utilities. If such include statement was found in
644 # a public header file of the project, the public header files of the BASIS
645 # C++ utilities are also installed as the project's public header files depend
646 # on them. You can set this variable to TRUE in the Settings.cmake file of your
647 # project to force the installation of the public header files of the
648 # project-specific BASIS C++ utilities.
649 #
650 # @sa basis_install_public_headers()
652 
653 ## @brief Whether BASIS should configure any public header file with the .in file name suffix.
654 #
655 # If a project does not contain any such public header file (typically one named config.h.in),
656 # this option can be set to @c FALSE in the @c "config/Settings.cmake" file of the project.
657 # For better performance, if only one header file needs to be configured, this can be done
658 # manually by adding a corresponding configure_file() call to the root CMakeLists.txt file
659 # right after basis_project_begin(). The configured files should be written to the
660 # @c BINARY_INCLUDE_DIR which is located in the build tree of the project.
662 
663 ## @brief Whether basis_project_begin() should support the configuration of Slicer modules.
664 #
665 # This option must be set to @c TRUE in @c "config/Settings.cmake" of a project
666 # which either itself or one of its modules is a 3D Slicer Extension.
667 #
668 # @sa http://www.slicer.org
670 
671 ## @brief Enable/disable registration of installed package in CMake registry.
672 option (BASIS_REGISTER "Request registration of installed package in CMake package registry." ON)
673 mark_as_advanced (BASIS_REGISTER)
674 
675 ## @brief EXPERIMENTAL - Build project modules as separate external projects.
676 #
677 # This may improve performance of the initial configure step but comes with the caveats
678 # inherent to the superbuild approach as implemented by the ExternalProject module.
679 option (BASIS_SUPERBUILD_MODULES "EXPERIMENTAL - Build project modules as part of a superbuild. May improve configure speed." OFF)
680 mark_as_advanced (BASIS_SUPERBUILD_MODULES)
681 
682 ## @brief Enable/disable import of targets using the BASIS ImportTools.
683 #
684 # Issues/limitations of CMake's "function" command complicate the definition
685 # of a custom set_target_properties function which can be used to collect
686 # "global" information about targets imported from the CMake package
687 # configuration of project dependencies. The workaround in the custom
688 # set_target_properties function defined in the ImportTools.cmake is
689 # extremely inefficient and slows down the configuration step a lot
690 # (cf. https://github.com/cmake-basis/BASIS/issues/494).
691 #
692 # The only need for collecting this information for all (executable)
693 # targets imported from dependencies is for generating the executable
694 # target info table for the BASIS Utilities (cf. UtilitiesTools.cmake).
695 # Hence, when these are not used, the ImportTools.cmake are not needed.
696 # Further, when a project does not consist of modules, the imported
697 # targets are available in the scope of the project.
698 #
699 # A project has to set BASIS_IMPORT_TARGETS to TRUE in its root CMakeLists.txt
700 # file before basis_project_begin() or basis_project_impl(), respectively,
701 # which in turn include the BASISUse.cmake file. This file includes the
702 # BASIS ImportTools module when BASIS_IMPORT_TARGETS is true.
704 
705 # ============================================================================
706 # programming language specific settings
707 # ============================================================================
708 
709 ## @brief List of programming languages explicitly supported by BASIS.
710 #
711 # @todo Add full support for Java.
712 set (BASIS_LANGUAGES CMake CXX Python Jython Perl Matlab Bash)
713 
714 string (TOLOWER "${BASIS_LANGUAGES}" BASIS_LANGUAGES_L)
715 string (TOUPPER "${BASIS_LANGUAGES}" BASIS_LANGUAGES_U)
716 
717 # ----------------------------------------------------------------------------
718 # namespace delimiters
719 # ----------------------------------------------------------------------------
720 
721 ## @brief Namespace delimiter used in CMake.
723 ## @brief Namespace delimiter used in C++.
725 ## @brief Namespace delimiter used in Python.
727 ## @brief Namespace delimiter used in Jython.
729 ## @brief Namespace delimiter used in Perl.
731 ## @brief Namespace delimiter used in MATLAB.
733 ## @brief Namespace delimiter used in Bash.
734 #
735 # @note Bash itself has no concept of namespaces. This namespace delimiter is
736 # used by the import() function of the BASIS Utilities for Bash.
737 #
738 # @sa BasisBashUtilities
740 
741 # ----------------------------------------------------------------------------
742 # public libraries of script modules
743 # ----------------------------------------------------------------------------
744 
745 ## @brief Name of library target which builds Python modules in @c PROJECT_LIBRARY_DIR.
746 #
747 # This variable is used by basis_configure_script_libraries() which is called
748 # by basis_project_begin() to add a library target of the given name for the
749 # build of the Python modules found in the @c PROJECT_LIBRARY_DIR.
750 #
751 # @note The given target name is argument to the basis_add_library() command.
752 # Overwrite default value in Settings.cmake file of project if desired.
754 
755 ## @brief Name of library target which builds Jython modules in @c PROJECT_LIBRARY_DIR.
756 #
757 # This variable is used by basis_configure_script_libraries() which is called
758 # by basis_project_begin() to add a library target of the given name for the
759 # build of the Jython modules found in the @c PROJECT_LIBRARY_DIR.
760 #
761 # @note The given target name is argument to the basis_add_library() command.
762 # Overwrite default value in Settings.cmake file of project if desired.
764 
765 ## @brief Name of library target which builds Perl modules in @c PROJECT_LIBRARY_DIR.
766 #
767 # This variable is used by basis_configure_script_libraries() which is called
768 # by basis_project_begin() to add a library target of the given name for the
769 # build of the Perl modules found in the @c PROJECT_LIBRARY_DIR.
770 #
771 # @note The given target name is argument to the basis_add_library() command.
772 # Overwrite default value in Settings.cmake file of project if desired.
774 
775 ## @brief Name of library target which builds MATLAB modules in @c PROJECT_LIBRARY_DIR.
776 #
777 # This variable is used by basis_configure_script_libraries() which is called
778 # by basis_project_begin() to add a library target of the given name for the
779 # build of the MATLAB modules found in the @c PROJECT_LIBRARY_DIR.
780 #
781 # @note The given target name is argument to the basis_add_library() command.
782 # Overwrite default value in Settings.cmake file of project if desired.
784 
785 ## @brief Name of library target which builds Bash modules in @c PROJECT_LIBRARY_DIR.
786 #
787 # This variable is used by basis_configure_script_libraries() which is called
788 # by basis_project_begin() to add a library target of the given name for the
789 # build of the Bash modules found in the @c PROJECT_LIBRARY_DIR.
790 #
791 # @note The given target name is argument to the basis_add_library() command.
792 # Overwrite default value in Settings.cmake file of project if desired.
794 
795 # ============================================================================
796 # documentation
797 # ============================================================================
798 
799 ## @brief Advanced non-cached variable to request build of documentation targets as part of ALL target.
800 basis_set_if_not_set (BASIS_ALL_DOC OFF)
801 
802 ## @brief Default Doxygen configuration.
803 set (BASIS_DOXYGEN_DOXYFILE "${CMAKE_CURRENT_LIST_DIR}/Doxyfile.in")
804 
805 ## @brief Default Sphinx configuration.
806 set (BASIS_SPHINX_CONFIG "${CMAKE_CURRENT_LIST_DIR}/sphinx_conf.py.in")
807 
808 ## @brief Default Sphinx theme.
809 set (BASIS_SPHINX_HTML_THEME "default")
810 
811 ## @brief Default Sphinx theme options.
812 set (BASIS_SPHINX_HTML_THEME_OPTIONS
813  PROJECT_LOGO None
814  SHOW_SBIA_LOGO false
815  SHOW_PENN_LOGO false
816  #SHOW_RELBAR2 false
817  #ROOT_RELLINKS "[('home', 'index')]"
818 )
819 
820 # ============================================================================
821 # common options
822 # ============================================================================
823 
824 ## @brief Request verbose messages from BASIS functions.
825 option (BASIS_VERBOSE "Request BASIS functions to output verbose messages." OFF)
826 mark_as_advanced (BASIS_VERBOSE)
827 
828 ## @brief Request debugging messages from BASIS functions.
829 option (BASIS_DEBUG "Request BASIS functions to help debugging." OFF)
830 mark_as_advanced (BASIS_DEBUG)
831 
832 ## @brief Request configuration of software build only, skipping steps related to packaging and installation.
833 option (BASIS_BUILD_ONLY "Request configuration of software build only, skipping steps related to packaging and installation." OFF)
834 mark_as_advanced (BASIS_BUILD_ONLY)
835 
836 # ============================================================================
837 # build configuration
838 # ============================================================================
839 
840 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS AND NOT CMAKE_C_FLAGS)
841  set (
842  CMAKE_BUILD_TYPE "Release"
843  CACHE STRING "Choose the type of build, options are: None (CMAKE_C_FLAGS and CMAKE_CXX_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
844  FORCE
845  )
846 endif ()
847 
848 # the following Mac OS specific variables are yet not further used
849 # hide them from the normal user, as they are usually not required (yet)
850 if (DEFINED CMAKE_OSX_ARCHITECTURES)
851  mark_as_advanced (CMAKE_OSX_ARCHITECTURES)
852 endif ()
853 if (DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
854  mark_as_advanced (CMAKE_OSX_DEPLOYMENT_TARGET)
855 endif ()
856 if (DEFINED CMAKE_OSX_SYSROOT)
857  mark_as_advanced (CMAKE_OSX_SYSROOT)
858 endif ()
859 
860 ## @brief Whether to have BASIS set the RPATH of binaries rather than CMake
861 #
862 # @sa http://www.cmake.org/Wiki/CMake_RPATH_handling for details on how CMake
863 # itself handles the RPATH setting of executables and shared libraries.
864 option (BASIS_INSTALL_RPATH "Whether to have BASIS set the RPATH of binaries rather than CMake" ON)
865 mark_as_advanced (BASIS_INSTALL_RPATH)
866 
867 # use INSTALL_RPATH set by BASIS instead of CMake
868 if (BASIS_INSTALL_RPATH)
869  set (CMAKE_SKIP_RPATH FALSE) # use RPATH for installed project own binaries
870  set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) # do not add directories outside project to RPATH
871 endif ()
872 set (CMAKE_SKIP_BUILD_RPATH FALSE) # use RPATH for project own binaries
873 set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # use different RPATH for build tree executables
874 
875 
876 ## @}
877 # end of Doxygen group
cmake BASIS_PERL_LIBRARY_TARGET
Name of library target which builds Perl modules in PROJECT_LIBRARY_DIR.
cmake LIBRARY_DIR
Directory of shared and module libraries relative to script location.
cmake BASIS_GE_CONFIG
Name of build configuration ("$<CONFIG>") generator expression.
cmake BASIS_DOXYGEN_DOXYFILE
Default Doxygen configuration.
cmake BASIS_UTILITIES
Enable the automatic detection of the use of the BASIS utilities.
cmake BASIS_SPHINX_HTML_THEME
Default Sphinx theme.
cmake BASIS_BASH_LIBRARY_TARGET
Name of library target which builds Bash modules in PROJECT_LIBRARY_DIR.
function is(in result, in expected, in name)
Test whether a given result is equal to the expected result.
def which(command, path=None, verbose=0, exts=None)
Definition: which.py:257
option BASIS_INSTALL_SITE_PACKAGES
Enable the installation of scripted modules in site specific default directories. ...
cmake BASIS_CONFIGURE_PUBLIC_HEADERS
Whether BASIS should configure any public header file with the .in file name suffix.
cmake BASIS_PYTHON_LIBRARY_TARGET
Name of library target which builds Python modules in PROJECT_LIBRARY_DIR.
cmake SOURCES
Definition: glob.cmake:52
option BASIS_REGISTER
Enable/disable registration of installed package in CMake registry.
cmake PROJECT_LIBRARY_DIR
Absolute path to directory of public scripted packages.
cmake BASIS_NAMESPACE_DELIMITER_CXX
Namespace delimiter used in C++.
cmake BASIS_JYTHON_LIBRARY_TARGET
Name of library target which builds Jython modules in PROJECT_LIBRARY_DIR.
cmake BASIS_NAMESPACE_DELIMITER_JYTHON
Namespace delimiter used in Jython.
macro basis_set_if_not_set(out VAR, in ARGN)
Set value of variable only if variable is not defined yet.
cmake BASIS_IMPORT_TARGETS
Enable/disable import of targets using the BASIS ImportTools.
cmake CMAKE_SKIP_BUILD_RPATH
cmake BASIS_NAMESPACE_DELIMITER_MATLAB
Namespace delimiter used in MATLAB.
string COPYRIGHT
Default copyright of executables.
Definition: utilities.sh:91
cmake NAME
function basis_configure_script_libraries()
Add library targets for the public modules in PROJECT_LIBRARY_DIR.
BASIS_METADATA_LIST_SWITCH
Names of project meta-data switches.
cmake BASIS_NAMESPACE_DELIMITER_CMAKE
Namespace delimiter used in CMake.
cmake BASIS_LANGUAGES
List of programming languages explicitly supported by BASIS.
cmake CMAKE_BUILD_WITH_INSTALL_RPATH
string VERSION
Project version.
Definition: utilities.sh:81
string CMAKE_BUILD_TYPE
cmake BASIS_ALL_DOC
Advanced non-cached variable to request build of documentation targets as part of ALL target...
cmake BASIS_SPHINX_CONFIG
Default Sphinx configuration.
cmake BASIS_NAMESPACE_DELIMITER_PYTHON
Namespace delimiter used in Python.
option BUILD_ALL_MODULES
cmake TEMPLATE
macro basis_project_begin()
Marks the begining of a BASIS project.
cmake BASIS_SUPPORT_SLICER_MODULES
Whether basis_project_begin() should support the configuration of Slicer modules. ...
cmake BASIS_INSTALL_PUBLIC_HEADERS_OF_CXX_UTILITIES
Force installation of public header files of BASIS C++ utilities.
cmake CMAKE_INSTALL_RPATH_USE_LINK_PATH
cmake DATA_DIR
Directory of auxiliary data files relative to script location.
macro basis_project(in ARGN)
Sets basic project information including the name, version, and dependencies.
option BASIS_SUPERBUILD_MODULES
EXPERIMENTAL - Build project modules as separate external projects.
option BASIS_DEBUG
Request debugging messages from BASIS functions.
string LICENSE
Default license of executables.
Definition: utilities.sh:93
cmake __BASIS_SETTINGS_INCLUDED
cmake CXX
cmake BASIS_NAMESPACE_DELIMITER_BASH
Namespace delimiter used in Bash.
cmake CMAKE_SKIP_RPATH
cmake BASIS_SCRIPT_EXECUTE_PROCESS
Script used to execute a process in CMake script mode.
option BASIS_VERBOSE
Default Sphinx theme options.
cmake LANGUAGE
Detected scripting language or UNKNOWN.
cmake BASIS_NAMESPACE_DELIMITER_PERL
Namespace delimiter used in Perl.
option BASIS_BUILD_ONLY
Request configuration of software build only, skipping steps related to packaging and installation...
cmake BASIS_MATLAB_LIBRARY_TARGET
Name of library target which builds MATLAB modules in PROJECT_LIBRARY_DIR.
cmake BASIS_SVN_USERS_FILE
File used by default as –authors file to svn2cl.
if(oldcoutbuf)
string CONTACT
Default contact to use for help output of executables.
Definition: utilities.sh:95