1414# limitations under the License.
1515#
1616
17+ #
18+ # Specify the minimum cmake version.
19+ #
20+ cmake_minimum_required (VERSION 3.5.0 )
21+
22+ #
23+ # Make sure if() treats constants like TRUE as constants
24+ # rather than implicitly treating them as variables and trying to dereference them.
25+
26+ cmake_policy (SET CMP0012 NEW )
27+
28+ #
29+ # Set the cmake module path.
30+ #
31+ set (SHEAFSYSTEM_CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /cmake_modules"
32+ CACHE STRING "Location of Sheaf System Cmake modules" )
33+ mark_as_advanced (FORCE SHEAFSYSTEM_CMAKE_MODULE_PATH )
34+
35+ # Make the requires and ensures functions available.
36+
37+ include (${SHEAFSYSTEM_CMAKE_MODULE_PATH} /design_by_contract.cmake )
38+
1739# Setting CMAKE_CONFIGURATION_TYPES prior to the project function call
1840# will eliminate the default configuration types (debug,release,RelWithDebugInfo, et al.) --
1941# or at least stop them from appearing in the VS configuration list.
2244
2345if (WIN32 )
2446 set (CMAKE_CONFIGURATION_TYPES Debug_contracts Debug_no_contracts Release_contracts Release_no_contracts
25- RelWithDebInfo_contracts RelWithDebInfo_no_contracts CACHE STRING "Supported configuration types"
26- FORCE )
47+ RelWithDebInfo_contracts RelWithDebInfo_no_contracts
48+ CACHE STRING "Supported configuration types" FORCE )
49+ mark_as_advanced (FORCE CMAKE_CONFIGURATION_TYPES )
2750else ()
2851 set (CMAKE_CONFIGURATION_TYPES Debug_contracts Debug_no_contracts Release_contracts Release_no_contracts
29- CACHE STRING "Supported configuration types"
30- FORCE )
52+ CACHE STRING "Supported configuration types" FORCE )
53+ mark_as_advanced ( FORCE CMAKE_CONFIGURATION_TYPES )
3154endif ()
3255
3356#
3457# Establish the project name
3558#
3659project (SheafSystem)
3760
38- #
39- # Specify the minimum cmake version.
40- #
41- cmake_minimum_required (VERSION 2.8.12 )
42-
4361#
4462# Include variable definitions and functions
4563# unique to and/or required at the system level.
4664#
4765include (system_definitions.cmake )
48-
49- #
50- # Add components to the system
51- #
52- add_components ()
66+ SheafSystem_make_system_definitions ()
5367
5468#
5569# Set up output directories
5670#
57- create_output_dirs ()
71+ SheafSystem_create_output_dirs ()
5872
5973#
60- # Add the documentation targets (doc, docclean)
61- # Doc targets are system level and system scope.
62- # currently there is no notion of building a single
63- # component's documentation.
64- #
65- add_doc_targets ()
66-
67- #
68- # Install the documentation
74+ # Add components to the system
6975#
70- if (INSTALL_DOCS)
71- install_docs ()
72- endif ()
76+ SheafSystem_add_components ()
7377
7478#
75- # Target to generate emacs tags
79+ # Add all the system level targets.
7680#
77- add_tags_target ()
81+ include (${SHEAFSYSTEM_CMAKE_MODULE_PATH} /target_declarations.cmake )
82+ SheafSystem_add_system_targets ()
7883
7984#
80- # Configure the environment scripts.
85+ # Configure the environment variable scripts.
8186#
82- if (LINUX64GNU OR LINUX64INTEL)
83- configure_file (${CMAKE_MODULE_PATH} /set_env_vars.csh.cmake.in ${CMAKE_BINARY_DIR} /set_env_vars.csh )
84- configure_file (${CMAKE_MODULE_PATH} /set_env_vars.sh.cmake.in ${CMAKE_BINARY_DIR} /set_env_vars.sh )
85- endif ()
86-
87- #
88- # System level is responsible for installing the documentation. The component list (see system_definitions.cmake)
89- # determines what components are included in the docs.
90- # NOTE: Prepending of ${CMAKE_INSTALL_PREFIX}/ to the value of DESTINATION is implicit in the install command.
91- # You need only specify the sub-directory within ${CMAKE_INSTALL_PREFIX}, cmake will create the dir.
92- # With no value specified for DESTINATION, all files are placed in ${CMAKE_INSTALL_PREFIX}.
93- #
94- if (INSTALL_DOCS)
95- install (DIRECTORY ${CMAKE_BINARY_DIR} /documentation/ DESTINATION documentation)
87+ if (SHEAFSYSTEM_LINUX)
88+ configure_file (${SHEAFSYSTEM_CMAKE_MODULE_PATH} /set_env_vars.csh.cmake.in ${CMAKE_BINARY_DIR} /set_env_vars.csh )
89+ configure_file (${SHEAFSYSTEM_CMAKE_MODULE_PATH} /set_env_vars.sh.cmake.in ${CMAKE_BINARY_DIR} /set_env_vars.sh )
9690endif ()
9791
9892#
9993# Generate the install configuration file.
10094#
101- generate_install_config_file ()
95+ SheafSystem_generate_install_config_files ()
10296
10397#
10498# Install HDF5 headers to <include> dir
10599#
106- install_prereqs ()
100+ SheafSystem_install_prereqs ()
107101
108102#
109- # Install the exports file
103+ # Install the documentation.
110104#
111- if (LINUX64INTEL OR LINUX64GNU)
112- install (FILES ${PROJECT_BINARY_DIR} /${EXPORTS_FILE} .in DESTINATION ${CMAKE_BUILD_TYPE} /config)
113- else ()
114- install (FILES ${PROJECT_BINARY_DIR} /${EXPORTS_FILE} .in DESTINATION config/\${BUILD_TYPE} )
105+ if (SHEAFSYSTEM_INSTALL_DOCS)
106+ SheafSystem_install_documentation ()
115107endif ()
116108
117109#
118- # Markup the RELEASE_NOTES file.
119- #
120- set (RELEASE_DATE)
121- get_date (RELEASE_DATE )
122-
123- #
124- # Generate some info about the release
110+ # Install the release notes.
125111#
126- file (WRITE ${CMAKE_BINARY_DIR} /VERSION "${PROJECT_NAME} version ${LIB_VERSION} ${RELEASE_DATE} \n " )
127- install (FILES ${PROJECT_BINARY_DIR} /VERSION DESTINATION ${CMAKE_INSTALL_PREFIX} )
128-
129- configure_file (${CMAKE_SOURCE_DIR} /RELEASE_NOTES.in ${CMAKE_BINARY_DIR} /RELEASE_NOTES )
130-
131- #if(TARGET install)
132- if (LINUX64GNU OR LINUX64INTEL)
133- install (FILES ${CMAKE_BINARY_DIR} /RELEASE_NOTES DESTINATION ${CMAKE_INSTALL_PREFIX} )
134- else ()
135- install (FILES ${CMAKE_BINARY_DIR} /RELEASE_NOTES DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME RELEASE_NOTES.txt)
136- endif ()
137- #endif()
112+ SheafSystem_install_release_notes ()
0 commit comments