Skip to content

Commit

Permalink
Merge pull request #266 from cwpearson/fix/cmake-min-version
Browse files Browse the repository at this point in the history
Don't use `cmake_path` before CMake 3.20
  • Loading branch information
dalg24 authored Jul 31, 2024
2 parents 5e895a3 + 509750b commit 7604355
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ endif()
# Libraries
if(KokkosTools_ENABLE_PAPI)
find_package(PAPI REQUIRED) # TODO: papi-connector requires v6.0 or newer
cmake_path(GET PAPI_INCLUDE_DIR PARENT_PATH PAPI_ROOT)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
cmake_path(GET PAPI_INCLUDE_DIR PARENT_PATH PAPI_ROOT)
else()
get_filename_component(PAPI_ROOT ${PAPI_INCLUDE_DIR} DIRECTORY)
endif()
message(STATUS "Found PAPI ${PAPI_VERSION_STRING} at ${PAPI_ROOT}")
set(KokkosTools_HAS_PAPI ON)
else()
Expand Down

0 comments on commit 7604355

Please sign in to comment.