Skip to content

Commit 7604355

Browse files
authored
Merge pull request #266 from cwpearson/fix/cmake-min-version
Don't use `cmake_path` before CMake 3.20
2 parents 5e895a3 + 509750b commit 7604355

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ endif()
7777
# Libraries
7878
if(KokkosTools_ENABLE_PAPI)
7979
find_package(PAPI REQUIRED) # TODO: papi-connector requires v6.0 or newer
80-
cmake_path(GET PAPI_INCLUDE_DIR PARENT_PATH PAPI_ROOT)
80+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
81+
cmake_path(GET PAPI_INCLUDE_DIR PARENT_PATH PAPI_ROOT)
82+
else()
83+
get_filename_component(PAPI_ROOT ${PAPI_INCLUDE_DIR} DIRECTORY)
84+
endif()
8185
message(STATUS "Found PAPI ${PAPI_VERSION_STRING} at ${PAPI_ROOT}")
8286
set(KokkosTools_HAS_PAPI ON)
8387
else()

0 commit comments

Comments
 (0)