Skip to content

Commit

Permalink
Add version check and calls to cmake_minimum_required() (TriBITSPub#522)
Browse files Browse the repository at this point in the history
This addresses an issue where Kokkos updates the KokkosConfig_install.cmake
file to use 'if (... IN_LIST ...)'.

NOTE: There is no test in TriBITS that checks for this change because the
TriBITS-generated <Package>Config.cmake and <Project>Config.cmake files don't
use 'if (... IN_LIST ...)'.  I had to manually test this against Trilinos to
verify this makes the error go away.  All that the TriBITS testing does is
ensure that this change does not break these files for the TriBITS use cases.
  • Loading branch information
bartlettroscoe committed Aug 24, 2022
1 parent 4ab6cae commit ab41942
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
#
##############################################################################

if(CMAKE_VERSION VERSION_LESS 3.3)
set(${PDOLLAR}{CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"${PACKAGE_NAME} requires CMake 3.3 or later for 'if (... IN_LIST ...)'"
)
set(${PDOLLAR}{CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
cmake_minimum_required(VERSION 3.3...${CMAKE_VERSION})

## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME}/${PACKAGE_NAME} build
## ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
#
##############################################################################

if(CMAKE_VERSION VERSION_LESS 3.3)
set(${PDOLLAR}{CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"${PROJECT_NAME} requires CMake 3.3 or later for 'if (... IN_LIST ...)'"
)
set(${PDOLLAR}{CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
cmake_minimum_required(VERSION 3.3...${CMAKE_VERSION})

## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME} build
## ---------------------------------------------------------------------------
Expand Down

0 comments on commit ab41942

Please sign in to comment.