Skip to content

Commit 37e8b02

Browse files
authored
Merge pull request #79 from ellert/install
Enabling unit tests should not disable install of libraries and binaries
2 parents 3b36ea8 + 03f5568 commit 37e8b02

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

CMakeLists.txt

+12-14
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,11 @@ target_link_libraries(scitokens-list-access SciTokens)
6969
add_executable(scitokens-create src/create.cpp)
7070
target_link_libraries(scitokens-create SciTokens)
7171

72-
if( BUILD_UNITTESTS )
73-
if( NOT EXTERNAL_GTEST )
74-
include(ExternalProject)
75-
ExternalProject_Add(gtest
76-
PREFIX external/gtest
77-
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/gtest
78-
INSTALL_COMMAND :
79-
)
80-
endif()
81-
enable_testing()
82-
add_subdirectory(test)
83-
84-
else()
8572
get_directory_property(TARGETS BUILDSYSTEM_TARGETS)
8673
install(
8774
TARGETS ${TARGETS}
8875
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
8976
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
90-
endif()
9177

9278
install(
9379
FILES src/scitokens.h
@@ -100,3 +86,15 @@ set_target_properties(
10086
SOVERSION "0"
10187
)
10288

89+
if( BUILD_UNITTESTS )
90+
if( NOT EXTERNAL_GTEST )
91+
include(ExternalProject)
92+
ExternalProject_Add(gtest
93+
PREFIX external/gtest
94+
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/gtest
95+
INSTALL_COMMAND :
96+
)
97+
endif()
98+
enable_testing()
99+
add_subdirectory(test)
100+
endif()

0 commit comments

Comments
 (0)