diff --git a/.gitignore b/.gitignore index ee015624..eb1d639d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.pyc *.autosave +CMakeLists.txt.user.* diff --git a/BasisProject.cmake b/BasisProject.cmake index 365eadde..a0c0df17 100644 --- a/BasisProject.cmake +++ b/BasisProject.cmake @@ -1,6 +1,6 @@ # ============================================================================ # Copyright (c) 2011-2012 University of Pennsylvania -# Copyright (c) 2013-2014 Carnegie Melon University +# Copyright (c) 2013-2014 Carnegie Mellon University # Copyright (c) 2013-2014 Andreas Schuh # All rights reserved. # @@ -83,7 +83,7 @@ basis_project ( # -------------------------------------------------------------------------- # meta-data NAME "BASIS" - VERSION "3.0.0" + VERSION "3.1.0" AUTHORS "Andreas Schuh" DESCRIPTION "This package implements and supports the development of " "software which follows the CMake Build system And Software " diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f8b91f6..d8cd0cdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ cmake_minimum_required (VERSION 2.8.4) # include BASIS policies, settings, macros, and functions # The following variables would be set by the BASISConfig.cmake file if -# this would be a project which uses BASIS. +# this is a project that uses BASIS. set (BASIS_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/cmake") diff --git a/COPYING.txt b/COPYING.txt index 582a5d28..22832a18 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -2,7 +2,7 @@ CMake BASIS License =================== Copyright (c) 2011-2012 University of Pennsylvania - Copyright (c) 2013-2014 Carnegie Melon University + Copyright (c) 2013-2014 Carnegie Mellon University Copyright (c) 2013-2014 Andreas Schuh All rights reserved. diff --git a/ChangeLog.txt b/ChangeLog.txt index d87f300d..9b158c5a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,30 @@ .. This file is formatted using reStructuredText (reST) and included by doc/changelog.rst ! +.. _v3.1.0: + +Release 3.1.0 (Mar 28, 2014) +---------------------------- + +- Custom project layout by overriding the default directory names. +- Revised concept of project modules vs. subprojects. +- Enable build of each module by default. +- Enhanced documentation of project modularization. +- Added project configuraton how-to detailing the various configuration files. +- Allow - and _ in project name. +- Allow use of characters -, _, and + in target names. +- Various improvements to reduce build configuration time. +- Require explicit declaration of link dependency to BASIS Utilities. +- Make RPATH setting optional. +- Root documentation files such as README and COPYING file are now optional. +- Conversion of target name to UID is now disabled by default. +- Added shell script which performs the Quick Start steps. +- Default CMakeList.txt template bootstraps BASIS if no installation found. +- Fixed addition of shared libraries. +- Fixed basis_set_project_property(APPEND PROJECT OtherModule ...). +- Fixed TEST property used by basis_build_script_library. +- Fixed help output of basisproject command. + + .. _v3.0.0: Release 3.0.0 (Jan 15, 2014) diff --git a/config/CTestCustom.cmake.in b/config/CTestCustom.cmake.in index 0b2c06d7..c38454db 100644 --- a/config/CTestCustom.cmake.in +++ b/config/CTestCustom.cmake.in @@ -140,7 +140,7 @@ set ( ${CTEST_CUSTOM_COVERAGE_EXCLUDE} # keep current exclude expressions "/CMakeFiles/CMakeTmp/" # exclude try_compile sources "./test/.*" # exclude test implementations - "./modules/.*/test/.*" # exclude test implementations of modules + "${PROJECT_MODULES_DIR}/.*/test/.*" # exclude test implementations of modules # add further exclude expressions here "/gtest/" # tested by Google "/gmock/" # tested by Google diff --git a/config/ConfigUse.cmake.in b/config/ConfigUse.cmake.in index 4aea362f..c3019a72 100644 --- a/config/ConfigUse.cmake.in +++ b/config/ConfigUse.cmake.in @@ -38,6 +38,9 @@ # @PROJECT_NAME@ configuration # ============================================================================ +# ---------------------------------------------------------------------------- +# Import configured script executables + # The following statements ensure that all scripts and modules are # configured/compiled using the same version of the interpreters. # Yet, the user can modify these variables, though this is not recommended. @@ -84,3 +87,10 @@ if (BASIS_BASH_EXECUTABLE) ) mark_as_advanced (BASH_EXECUTABLE) endif () + +# ---------------------------------------------------------------------------- +# include further required BASIS CMake modules +# base tools included by @PROJECT_NAME@Config.cmake already +if (BASIS_SUPER_BUILD_MODULES) + include (${BASIS_MODULE_PATH}/SuperBuildTools.cmake) +endif () diff --git a/config/Settings.cmake b/config/Settings.cmake index b84cbd38..1172ad8c 100644 --- a/config/Settings.cmake +++ b/config/Settings.cmake @@ -15,7 +15,7 @@ # required and optional dependencies and the CMake variables related to the # project directory structure were defined (see BASISDirectories.cmake file # in @c PROJECT_BINARY_DIR, where BASIS is here the name of the project). -# It is further included before the BasisSettings.cmake file. +# It is also included before the BasisSettings.cmake file. # # In particular, build options should be added in this file using CMake's # @@ -66,7 +66,7 @@ set (INSTALL_TEMPLATE_DIR "${INSTALL_SHARE_DIR}/templates" CACHE PATH "Installat # force default template to be set if (NOT DEFAULT_TEMPLATE) - set_property (CACHE DEFAULT_TEMPLATE PROPERTY VALUE "basis/1.0") + set_property (CACHE DEFAULT_TEMPLATE PROPERTY VALUE "basis/1.1") endif () # disable installation of templates if no destination specified if (NOT INSTALL_TEMPLATE_DIR) @@ -131,6 +131,52 @@ endif () # utilities # ============================================================================ +# system checks +include (CheckTypeSize) +include (CheckIncludeFileCXX) + +# check if type long long is supported +CHECK_TYPE_SIZE ("long long" LONG_LONG) + +if (HAVE_LONG_LONG) + set (HAVE_LONG_LONG 1) +else () + set (HAVE_LONG_LONG 0) +endif () + +# check for presence of sstream header +include (TestForSSTREAM) + +if (CMAKE_NO_ANSI_STRING_STREAM) + set (HAVE_SSTREAM 0) +else () + set (HAVE_SSTREAM 1) +endif () + +# check if tr/tuple header file is available +if (CMAKE_GENERATOR MATCHES "Visual Studio [1-9][0-9]+") + set (HAVE_TR1_TUPLE 1) +else () + CHECK_INCLUDE_FILE_CXX ("tr1/tuple" HAVE_TR1_TUPLE) + if (HAVE_TR1_TUPLE) + set (HAVE_TR1_TUPLE 1) + else () + set (HAVE_TR1_TUPLE 0) + endif () +endif () + +# check for availibility of pthreads library +# defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT +find_package (Threads) + +if (Threads_FOUND) + if (CMAKE_USE_PTHREADS_INIT) + set (HAVE_PTHREAD 1) + else () + set (HAVE_PTHREAD 0) + endif () +endif () + # list of enabled utilities # in case of other projects defined by BASISConfig.cmake set (BASIS_UTILITIES_ENABLED CXX) @@ -164,7 +210,7 @@ endif () # target UIDs of BASIS libraries; these would be set by the package configuration # file if this BASIS project would not be BASIS itself -if (BASIS_USE_FULLY_QUALIFIED_UIDS) +if (BASIS_USE_TARGET_UIDS AND BASIS_USE_FULLY_QUALIFIED_UIDS) set (NS "basis.") else () set (NS) @@ -175,3 +221,6 @@ set (BASIS_PERL_UTILITIES_LIBRARY "${NS}utilities_perl") set (BASIS_BASH_UTILITIES_LIBRARY "${NS}utilities_bash") set (BASIS_TEST_LIBRARY "${NS}testlib") set (BASIS_TEST_MAIN_LIBRARY "${NS}testmain") + +configure_file(include/basis/config.h.in ${BINARY_INCLUDE_DIR}/basis/config.h) + diff --git a/data/templates/basis/1.0/config/CTestCustom.cmake.in b/data/templates/basis/1.0/config/CTestCustom.cmake.in index e9286b52..64137171 100644 --- a/data/templates/basis/1.0/config/CTestCustom.cmake.in +++ b/data/templates/basis/1.0/config/CTestCustom.cmake.in @@ -134,7 +134,7 @@ set ( ${CTEST_CUSTOM_COVERAGE_EXCLUDE} # keep current exclude expressions "/CMakeFiles/CMakeTmp/" # exclude try_compile sources "./test/.*" # exclude test implementations - "./modules/.*/test/.*" # exclude test implementations of modules + "${PROJECT_MODULES_DIR}/.*/test/.*" # exclude test implementations of modules # add further exclude expressions here ) diff --git a/data/templates/basis/1.0/config/Settings.cmake b/data/templates/basis/1.0/config/Settings.cmake index ab28bb66..165e4e98 100644 --- a/data/templates/basis/1.0/config/Settings.cmake +++ b/data/templates/basis/1.0/config/Settings.cmake @@ -12,7 +12,7 @@ # This file is included by basis_project_impl(), after it looked for the # required and optional dependencies and the CMake variables related to the # project directory structure were defined (see Directories.cmake file in -# @c BINARY_CONFIG_DIR). It is further included before the BasisSettings.cmake +# @c BINARY_CONFIG_DIR). It is also included before the BasisSettings.cmake # file. # # In particular build options should be added in this file using CMake's diff --git a/data/templates/basis/1.1/BasisBootstrapping.cmake b/data/templates/basis/1.1/BasisBootstrapping.cmake new file mode 100644 index 00000000..241e835c --- /dev/null +++ b/data/templates/basis/1.1/BasisBootstrapping.cmake @@ -0,0 +1,179 @@ +# ============================================================================ +# Copyright (c) +# All rights reserved. +# +# +# ============================================================================ + +############################################################################## +# @file BasisBootstrapping.cmake +# @brief Auxiliary function to bootstrap the build of CMake BASIS. +############################################################################## + +include (CMakeParseArguments) + +# ---------------------------------------------------------------------------- +## @brief Boostrap build of CMake BASIS during configuration of project. +# +# This function downloads, configures, and builds CMake BASIS. If the (cached) +# variable @c BASIS_INSTALL_PREFIX is set, it also installs BASIS into the +# specified directory. This is only required if the project uses the +# BASIS Utilities. Otherwise, the BASIS build tree can be used directly to +# build the software project which bootstrapped BASIS. It is not required +# during runtime of the software. +# +# @param[in] ARGN The list of arguments is parsed as follows: +# @par +# +# +# @tp @b VERSION major.minor.patch @endtp +# +# +# +# @tp @b DOWNLOAD_URL url @endtp +# +# +# +# @tp @b INFORM_USER @endtp +# +# +# +# @tp @b BASIS_VARIABLE_NAME value @endtp +# +# +#
Version of CMake BASIS to download.
URL from which to download the CMake BASIS source distribution package. +# The given URL can be either a complete download URL which includes the +# package name (which must end with .tar.gz or .zip) or the path of +# a remote directory which contains the CMake BASIS packages named +# cmake-basis-version.zip (for Windows) and cmake-basis-version.tar.gz (for Unix). +# (default: http://opensource.andreasschuh.com/cmake-basis/_downloads)
This option causes this function to abort the initial configure step +# of CMake. It informs the user that this project required BASIS for +# the build configuration and that it upon the next configure run it +# will attempt to download and build BASIS automatically. It further +# notes that the user can set the @c BASIS_DIR variable prior to the +# next configure run in order to use an existing BASIS installation. +# (default: off)
Adds a build configuration to the CMake command used to configure +# the build of CMake BASIS using the -D option of @c cmake. The +# @c BASIS_VARIABLE_NAME can be any CMake option or variable that +# is normally used to configure a BASIS build using CMake. For example, +# USE_PythonInterp, USE_BASH, USE_DOXYGEN.
+# +# @returns Sets the @c BASIS_DIR variable to the bootstrapped BASIS build. +function (basis_bootstrap) + # parse arguments -- unparsed arguments are passed on to CMake using -D + CMAKE_PARSE_ARGUMENTS (BASIS "INFORM_USER" "VERSION;DOWNLOAD_URL" "" ${ARGN}) + if (NOT BASIS_VERSION) + message (FATAL_ERROR "No CMake BASIS version specified! Use 'VERSION 3.0.0', for example.") + endif () + # abort the first time to give users a chance to specify where their + # CMake BASIS installation is located by setting BASIS_DIR in the GUI + if (BASIS_INFORM_USER) + if (DEFINED BASIS_DIR AND NOT DEFINED BASIS_INSTALL_PREFIX) + set (BASIS_INSTALL_PREFIX "" CACHE PATH "Installation prefix for CMake BASIS.") + message (FATAL_ERROR "Could not find an existing CMake BASIS installation!\n" + "This project uses CMake BASIS for the build configuration." + " Next time you configure this build by running CMake again," + " BASIS version ${BASIS_VERSION} will be automatically downloaded" + " and build as part of the build configuration of this project." + " If you want to install this version permanently," + " specify an installation prefix for CMake BASIS using" + " BASIS_INSTALL_PREFIX. Otherwise, leave it blank.\n" + "If you installed CMake BASIS already on your system, please" + " specify its location by setting the BASIS_DIR variable" + " before you re-configure the build system of this project.\n" + "Visit http://opensource.andreasschuh.com/cmake-basis for" + " more information about the CMake BASIS package.\n") + endif () + endif () + + set (DOWNLOAD_PATH "${CMAKE_CURRENT_BINARY_DIR}") + if (WIN32) + set (BASIS_ARCHIVE "cmake-basis-${BASIS_VERSION}.zip") + else () + set (BASIS_ARCHIVE "cmake-basis-${BASIS_VERSION}.tar.gz") + endif () + if (NOT BASIS_DOWNLOAD_URL) + set (BASIS_DOWNLOAD_URL "http://opensource.andreasschuh.com/cmake-basis/_downloads") + endif () + if (NOT BASIS_DOWNLOAD_URL MATCHES "\\.(zip|tar\\.gz)$") + set (BASIS_DOWNLOAD_URL "${BASIS_DOWNLOAD_URL}/${BASIS_ARCHIVE}") + endif () + set (BASIS_SOURCE_DIR "${DOWNLOAD_PATH}/cmake-basis-${BASIS_VERSION}") + set (BASIS_BINARY_DIR "${DOWNLOAD_PATH}/cmake-basis-${BASIS_VERSION}/build") + + # bootstrap BASIS build/installation only if not done before + # or when BASIS_INSTALL_PREFIX has changed + if ( NOT IS_DIRECTORY "${BASIS_BINARY_DIR}" + OR NOT DEFINED BASIS_INSTALL_PREFIX_CONFIGURED + OR NOT BASIS_INSTALL_PREFIX_CONFIGURED STREQUAL "${BASIS_INSTALL_PREFIX}") + + # download and extract source code if not done before + if (NOT EXISTS "${BASIS_SOURCE_DIR}/BasisProject.cmake") + # download source code distribution package + if (NOT EXISTS "${DOWNLOAD_PATH}/${BASIS_ARCHIVE}") + message (STATUS "Downloading CMake BASIS v${BASIS_VERSION}...") + file (DOWNLOAD "${BASIS_DOWNLOAD_URL}" "${DOWNLOAD_PATH}/${BASIS_ARCHIVE}" STATUS RETVAL) + list (GET RETVAL 1 ERRMSG) + list (GET RETVAL 0 RETVAL) + if (NOT RETVAL EQUAL 0) + message (FATAL_ERROR "Failed to download CMake BASIS v${BASIS_VERSION} from\n" + "\t${BASIS_DOWNLOAD_URL}\n" + "Error: ${ERRMSG}\n" + "Either try again or follow the instructions at\n" + "\thttp://opensource.andreasschuh.com/cmake-basis/\n" + "to download and install it manually before configuring this project.\n") + endif () + message (STATUS "Downloading CMake BASIS v${BASIS_VERSION}... - done") + endif () + # extract source package + message (STATUS "Extracting CMake BASIS...") + execute_process (COMMAND ${CMAKE_COMMAND} -E tar -xvzf "${DOWNLOAD_PATH}/${BASIS_ARCHIVE}" RESULT_VARIABLE RETVAL) + if (NOT RETVAL EQUAL 0) + file (REMOVE_RECURSE "${BASIS_SOURCE_DIR}") + message (FATAL_ERROR "Failed to extract the downloaded archive file ${DOWNLOAD_PATH}/${BASIS_ARCHIVE}!") + endif () + message (STATUS "Extracting CMake BASIS... - done") + endif () + + # configure + # TODO: Does this work on Windows as well ? Do we need "-G${CMAKE_GENERATOR}" ? + file (MAKE_DIRECTORY "${BASIS_BINARY_DIR}") + + set (CMAKE_ARGUMENTS "-DBASIS_REGISTER:BOOL=OFF") # do not register this BASIS build/installation + # as it should only be used by this project + if (BASIS_INSTALL_PREFIX) + list (APPEND CMAKE_ARGUMENTS "-DCMAKE_INSTALL_PREFIX=${BASIS_INSTALL_PREFIX}") + endif () + list (LENGTH BASIS_UNPARSED_ARGUMENTS N) + while (N GREATER 0) + list (GET BASIS_UNPARSED_ARGUMENTS 0 VARIABLE_NAME) + list (GET BASIS_UNPARSED_ARGUMENTS 1 VARIABLE_VALUE) + list (APPEND CMAKE_ARGUMENTS "-D${VARIABLE_NAME}=${VARIABLE_VALUE}") + list (REMOVE_AT BASIS_UNPARSED_ARGUMENTS 0 1) + math (EXPR N "${N} - 2") + endwhile () + execute_process ( + COMMAND "${CMAKE_COMMAND}" ${CMAKE_ARGUMENTS} "${BASIS_SOURCE_DIR}" + WORKING_DIRECTORY "${BASIS_BINARY_DIR}" + ) + # build + execute_process (COMMAND "${CMAKE_BUILD_TOOL}" all WORKING_DIRECTORY "${BASIS_BINARY_DIR}") + # install + if (BASIS_INSTALL_PREFIX) + execute_process (COMMAND "${CMAKE_BUILD_TOOL}" install WORKING_DIRECTORY "${BASIS_BINARY_DIR}") + set (BASIS_DIR "${BASIS_INSTALL_PREFIX}" PARENT_SCOPE) + else () + set (BASIS_DIR "${BASIS_BINARY_DIR}" PARENT_SCOPE) + endif () + + # remember in which directory BASIS was installed to avoid re-running + # the bootstrapping every time the project needs to be re-configured + set (BASIS_INSTALL_PREFIX_CONFIGURED "${BASIS_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE) + + elseif (BASIS_INSTALL_PREFIX_CONFIGURED) + set (BASIS_DIR "${BASIS_INSTALL_PREFIX_CONFIGURED}" PARENT_SCOPE) + else () + set (BASIS_DIR "${BASIS_BINARY_DIR}" PARENT_SCOPE) + endif () + +endfunction (basis_bootstrap) diff --git a/data/templates/basis/1.1/CMakeLists.txt b/data/templates/basis/1.1/CMakeLists.txt new file mode 100644 index 00000000..30e34be9 --- /dev/null +++ b/data/templates/basis/1.1/CMakeLists.txt @@ -0,0 +1,97 @@ +# ============================================================================ +# Copyright (c) +# All rights reserved. +# +# +# ============================================================================ + +############################################################################## +# @file CMakeLists.txt +# @brief Root build configuration file. +# +# @note This package utilizes
CMake BASIS. +# +############################################################################## + +# ---------------------------------------------------------------------------- +# minimum required CMake version +cmake_minimum_required (VERSION 2.8.4) + +# ---------------------------------------------------------------------------- +# include BASIS policies, settings, macros, and functions + +# circumvent issue with CMake's find_package() interpreting these variables +# relative to the current binary directory instead of the top-level directory +if (BASIS_DIR AND NOT IS_ABSOLUTE "${BASIS_DIR}") + set (BASIS_DIR "${CMAKE_BINARY_DIR}/${BASIS_DIR}") + get_filename_component (BASIS_DIR "${BASIS_DIR}" ABSOLUTE) +endif () + +# users tend to specify the directory where BASIS was installed +# rather than the directory containing a BASISConfig.cmake, +# so add a workaround to allow that to work as well +if (IS_DIRECTORY "${BASIS_DIR}") + list (INSERT CMAKE_PREFIX_PATH 0 "${BASIS_DIR}") +endif () + +# look for an existing CMake BASIS installation and use it if found +# otherwise, attempt to download and install it locally +find_package (BASIS QUIET) +if (NOT BASIS_FOUND) + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/BasisBootstrapping.cmake") + include ("${CMAKE_CURRENT_SOURCE_DIR}/BasisBootstrapping.cmake") + else () + message (FATAL_ERROR "Could not find an existing CMake BASIS installation!\n" + "This project uses CMake BASIS for the build configuration." + " Visit http://opensource.andreasschuh.com/cmake-basis for" + " more information about the CMake BASIS package.\n") + endif () + # download and install BASIS in build tree of project + basis_bootstrap( + VERSION 3.1.0 # CMake BASIS version to download + USE_MATLAB FALSE # Enable/disable Matlab support + USE_PythonInterp FALSE # Enable/disable Python support + USE_JythonInterp FALSE # Enable/disable Jython support + USE_Perl FALSE # Enable/disalbe Perl support + USE_BASH FALSE # Enable/disable Bash support + USE_Doxygen TRUE # Enable/disable documentation generation using Doxygen + USE_Sphinx TRUE # Enable/disable documentation generation using Sphinx + USE_ITK FALSE # Enable/disable image processing regression testing + INFORM_USER # Inform user during first configure step + # that BASIS needs to be bootstrapped or installed manually + ) + # look for local installation + find_package (BASIS QUIET) + if (NOT BASIS_FOUND) + message (FATAL_ERROR "CMake BASIS setup failed. Please take the following steps:\n" + "\t1. Clear the CMake cache and try from scratch\n" + "\t2. Check the CMake BASIS website:\n" + "\t\thttp://opensource.andreasschuh.com/cmake-basis/\n" + "\t3. Search for an existing issue:\n" + "\t\thttps://github.com/schuhschuh/cmake-basis/issues/\n" + "\t4. If this did not resolve the issue, please report your problem:\n" + "\t\thttps://github.com/schuhschuh/cmake-basis/issues/new\n" + "\t5. Try a manual build of CMake BASIS following the instructions at:\n" + "\t\thttp://opensource.andreasschuh.com/cmake-basis/quickstart.html" + ) + endif () +else () + set (BASIS_INSTALL_PREFIX "${BASIS_DIR}") +endif () + +# ---------------------------------------------------------------------------- +# configure build system +basis_project_impl () + +# raise error if project uses the BASIS Utilities, +# but BASIS was not installed as part of the bootstrapping +if (DEFINED BASIS_INSTALL_PREFIX_CONFIGURED AND NOT BASIS_INSTALL_PREFIX_CONFIGURED) + basis_get_project_uses_utilities (PROJECT_USES_BASIS_UTILITIES) + if (PROJECT_USES_BASIS_UTILITIES) + message (FATAL_ERROR "This project uses the BASIS Utilities. Therefore CMake BASIS" + " must be installed permanently. Please specify the location" + " where to install BASIS using the BASIS_INSTALL_PREFIX" + " variable and re-run CMake in order to first install BASIS" + " and then re-configure this project to use this installation.") + endif () +endif () diff --git a/data/templates/basis/1.1/_config.py b/data/templates/basis/1.1/_config.py new file mode 100644 index 00000000..c686d261 --- /dev/null +++ b/data/templates/basis/1.1/_config.py @@ -0,0 +1,242 @@ +# project template configuration script for basisproject tool + +# ------------------------------------------------------------------------------ +# required project files +required = [ + 'CMakeLists.txt', + 'BasisProject.cmake' +] + +# ------------------------------------------------------------------------------ +# optional project files +options = { + # bootstrapping support + 'bootstrapping' : { + 'desc' : 'Enable bootstrapping of CMake BASIS if no installation found.', + 'path' : [ 'BasisBootstrapping.cmake' ] + }, + # additional configuration files + 'config-settings' : { + 'desc' : 'Include/exclude custom Settings.cmake file.', + 'path' : [ 'config/Settings.cmake' ] + }, + 'config-depends' : { + 'desc' : 'Include/exclude custom Depends.cmake file.', + 'path' : [ 'config/Depends.cmake' ] + }, + 'config-components' : { + 'desc' : 'Include/exclude custom Components.cmake file.', + 'path' : [ 'config/Components.cmake' ] + }, + 'config-package' : { + 'desc' : 'Include/exclude custom Package.cmake file.', + 'path' : [ 'config/Package.cmake' ] + }, + 'config-find' : { + 'desc' : 'Include/exclude custom Config.cmake.in file.', + 'path' : [ + 'config/Config.cmake.in', + 'config/ConfigSettings.cmake' + ] + }, + 'config-find-version' : { + 'desc' : 'Include/exclude custom ConfigVersion.cmake.in file.', + 'path' : [ 'config/ConfigVersion.cmake.in' ] + }, + 'config-script' : { + 'desc' : 'Include/exclude custom ScriptConfig.cmake.in file.', + 'path' : [ 'config/ScriptConfig.cmake.in' ] + }, + 'config-test' : { + 'desc' : 'Include/exclude custom CTestCustom.cmake.in file.', + 'path' : [ 'config/CTestCustom.cmake.in' ] + }, + 'config-use' : { + 'desc' : 'Include/exclude custom ConfigUse.cmake.in file.', + 'path' : [ 'config/ConfigUse.cmake.in' ] + }, + 'config' : { + 'desc' : 'Include/exclude all custom configuration files.', + 'deps' : [ + 'config-settings', + 'config-depends', + 'config-components', + 'config-package', + 'config-find', + 'config-find-version', + 'config-script', + 'config-test', + 'config-use' + ] + }, + # software data + 'data' : { + 'desc' : 'Add/remove directory for auxiliary data files.', + 'path' : [ 'data/CMakeLists.txt' ] + }, + # documentation + 'readme' : { + 'desc' : 'Root documentation files: AUTHORS, README, INSTALL, and COPYING file.', + 'path' : [ + 'AUTHORS.md', + 'README.md', + 'INSTALL.md', + 'COPYING.txt' + ] + }, + 'changelog': { + 'desc' : 'Add ChangeLog.txt file for release notes.', + 'path' : [ 'ChangeLog.txt' ] + }, + 'doc' : { + 'desc' : 'Add/remove (basic) documentation files.', + 'path' : [ + 'doc/CMakeLists.txt', + 'doc/apidoc/apidoc.dox', + 'doc/apidoc/doxygen_extra.css.in', + 'doc/apidoc/doxygen_footer.html.in', + 'doc/apidoc/doxygen_header.html.in', + 'doc/static/logo.svg' + ] + }, + 'rst' : { + 'desc' : 'Add/remove reStructuredText (.rst) files for software manual/web site.', + 'path' : [ + 'doc/apidoc.rst', + 'doc/changelog.rst', + 'doc/contents.rst', + 'doc/download.rst', + 'doc/features.rst', + 'doc/howto.rst', + 'doc/index.rst', + 'doc/intro.rst', + 'doc/reference.rst', + 'doc/install.rst', + 'doc/manual.rst', + 'doc/people.rst', + 'doc/help.rst', + 'doc/quickstart.rst', + 'doc/sidebar.rst', + 'doc/apidoc/files.rst', + 'doc/apidoc/modules.rst', + 'doc/apidoc/namespaces.rst', + 'doc/apidoc/classlist.rst', + 'doc/howto/do-this.rst' + ], + 'deps' : [ 'changelog', 'doc' ] + }, + # usage example + 'example' : { + 'desc' : 'Add/remove directory for example files.', + 'path' : [ 'example/CMakeLists.txt' ] + }, + # project modules + 'modules' : { + 'desc' : 'Add/remove support for modularization.', + 'path' : [ 'modules/' ] + }, + # source files + 'include' : { + 'desc' : 'Add/remove directory for public header files.', + 'path' : [ 'include/' ] + }, + 'src' : { + 'desc' : 'Add/remove directory for project source files.', + 'path' : [ 'src/CMakeLists.txt' ] + }, + # testing tree + 'test' : { + 'desc' : 'Add/remove support for testing.', + 'path' : [ + 'CTestConfig.cmake', + 'test/CMakeLists.txt' + ] + }, + 'test-internal' : { + 'desc' : 'Add/remove support for internal testing.', + 'path' : 'test/internal/CMakeLists.txt', + 'deps' : 'test' + } +} + +# ------------------------------------------------------------------------------ +# preset template options +presets = { + 'minimal' : { + 'desc' : 'Choose minimal project template.', + 'args' : [ 'src' ] + }, + 'default' : { + 'desc' : 'Choose default project template.', + 'args' : [ 'bootstrapping', 'readme', 'changelog', 'doc', 'rst', 'include', 'src', 'test' ] + }, + 'toplevel' : { + 'desc' : 'Create top-level project.', + 'args' : [ 'bootstrapping', 'readme', 'changelog', 'doc', 'rst', 'modules' ] + }, + 'module' : { + 'desc' : 'Create module/subproject of top-level project.', + 'args' : [ 'include', 'src', 'test' ] + } +} + +# ------------------------------------------------------------------------------ +# additional substitutions besides ,