Skip to content

Commit 7f2acd8

Browse files
cmake: use gnuinstalldirs
1 parent dca6f4c commit 7f2acd8

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ option( BUILD_UNITTESTS "Build the scitokens-cpp unit tests" OFF )
66

77
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
88

9+
include(GNUInstallDirs)
10+
911
find_package( jwt-cpp REQUIRED )
1012
find_package( CURL REQUIRED )
1113
find_package( UUID REQUIRED )
@@ -66,14 +68,6 @@ target_link_libraries(scitokens-list-access SciTokens)
6668
add_executable(scitokens-create src/create.cpp)
6769
target_link_libraries(scitokens-create SciTokens)
6870

69-
if (NOT DEFINED LIB_INSTALL_DIR)
70-
SET(LIB_INSTALL_DIR "lib")
71-
endif()
72-
73-
if (NOT DEFINED INCLUDE_INSTALL_DIR)
74-
SET(INCLUDE_INSTALL_DIR "include")
75-
endif()
76-
7771
if( BUILD_UNITTESTS )
7872

7973
include(ExternalProject)
@@ -88,11 +82,11 @@ endif()
8882

8983
install(
9084
TARGETS SciTokens
91-
LIBRARY DESTINATION ${LIB_INSTALL_DIR} )
85+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
9286

9387
install(
9488
FILES src/scitokens.h
95-
DESTINATION ${INCLUDE_INSTALL_DIR}/scitokens )
89+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/scitokens )
9690

9791
set_target_properties(
9892
SciTokens

0 commit comments

Comments
 (0)