Skip to content

Commit 362b77a

Browse files
committed
Allow project to be used as a library
See cpm-cmake/CPM.cmake#275 (comment)
1 parent 2ccebdc commit 362b77a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ add_library(fpm INTERFACE)
88

99
target_include_directories(fpm INTERFACE include)
1010

11+
# if this project is being used as a submodule, it's someone elses' dependency.
12+
# in that case, we don't want to set up any testing, since they just want to
13+
# use it as a library.
14+
get_directory_property(hasParent PARENT_DIRECTORY)
15+
if(NOT hasParent)
1116
#
1217
# Test suite
1318
#
@@ -196,3 +201,4 @@ endif()
196201

197202
add_subdirectory(3rdparty/googlebench)
198203
add_subdirectory(3rdparty/googletest)
204+
endif()

0 commit comments

Comments
 (0)