Skip to content

Commit 17f8f9c

Browse files
authored
Merge pull request #45 from duncanmmacleod/gnuinstalldirs
Use GNUInstallDirs to define default cmake install destinations
2 parents dca6f4c + 329ee0e commit 17f8f9c

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
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

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ add_test(
99
NAME
1010
unit
1111
COMMAND
12-
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/test/scitokens-gtest
12+
${CMAKE_CURRENT_BINARY_DIR}/scitokens-gtest
1313
)

0 commit comments

Comments
 (0)