Skip to content

Commit

Permalink
Assert TriBITS min CMake version in TriBITS itself
Browse files Browse the repository at this point in the history
Now that the minimum CMake version is 2.8.11, it seems that CMake now allows
to to assert the minimum CMake version in an included file.  Now we can take
the assertion of the minimum CMake version out of the base TriBITS project
CMakeLists.txt file.
  • Loading branch information
Roscoe A. Bartlett committed Dec 5, 2014
1 parent 2f103fd commit f8c1682
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 4 additions & 2 deletions tribits/core/package_arch/TribitsProjectImpl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ IF (${PROJECT_NAME}_VERBOSE_CONFIGURE)
MESSAGE("CMAKE_MODULE_PATH='${CMAKE_MODULE_PATH}'")
ENDIF()

INCLUDE(TribitsIncludeDirectories)

INCLUDE(TribitsConstants)

CMAKE_MINIMUM_REQUIRED(VERSION ${TRIBITS_CMAKE_MINIMUM_REQUIRED} FATAL_ERROR)

INCLUDE(TribitsIncludeDirectories)
INCLUDE(TribitsGlobalMacros)
INCLUDE(TribitsConfigureCTestCustom)

Expand Down
5 changes: 1 addition & 4 deletions tribits/examples/TribitsExampleProject/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SET(CMAKE_LEGACY_CYGWIN_WIN32 1 CACHE BOOL "" FORCE)
# don't process this file.
#

# Get PROJECT_NAME (must be in file for other parts of system to read)
# Get PROJECT_NAME (must be in a file for other parts of system to read)
INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake")

# CMake requires that you declare the CMake project in the top-level file and
Expand All @@ -32,9 +32,6 @@ SET(${PROJECT_NAME}_TRIBITS_DIR
"TriBITS base directory (default assumes in TriBITS source tree)")
INCLUDE("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")

# CMake requires this be in the top file and not in an include file :-(
CMAKE_MINIMUM_REQUIRED(VERSION ${TRIBITS_CMAKE_MINIMUM_REQUIRED})

# Set default location for header-only TPL to make easy to configure out of
# the TriBITS source tree.
SET(HeaderOnlyTpl_INCLUDE_DIRS
Expand Down
7 changes: 3 additions & 4 deletions tribits/examples/TribitsHelloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake)
PROJECT(${PROJECT_NAME} NONE)

SET(${PROJECT_NAME}_TRIBITS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..
CACHE PATH "Path to TriBITS.")
INCLUDE("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")
CACHE PATH "TriBITS base directory (default assumes in TriBITS source tree).")

# CMake requires this be in the top file and not in an include file :-(
CMAKE_MINIMUM_REQUIRED(VERSION ${TRIBITS_CMAKE_MINIMUM_REQUIRED})
# Include the TriBITS system
INCLUDE("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")

# Disable MPI and Fortran
SET(TPL_ENABLE_MPI OFF CACHE BOOL "" FORCE)
Expand Down

0 comments on commit f8c1682

Please sign in to comment.