summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-02-27 23:16:05 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-02-27 23:16:05 -0500
commitb08fe71d3bc6d01e6e7f248bc01a6fc11fa03f4c (patch)
treec5924438cc7e52784f233099c234c5a9890e8ddf /CMakeLists.txt
parent1327dbcf2a4273a8ba6fd978db5f0882530af94d (diff)
downloadlibgit2-b08fe71d3bc6d01e6e7f248bc01a6fc11fa03f4c.tar.gz
cmake: export libraries needed to compile against libgit2
If users are using us as a direct dependency (via `add_subdirectory`) then they may want to know the libraries to link to; tell them.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 763bd437b..750b7089d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,6 +131,14 @@ if(BUILD_FUZZERS)
endif()
+# Export for people who use us as a dependency
+
+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+ set(LIBGIT2_DEPENDENCY_OBJECTS ${LIBGIT2_DEPENDENCY_OBJECTS} PARENT_SCOPE)
+ set(LIBGIT2_SYSTEM_LIBS ${LIBGIT2_SYSTEM_LIBS} PARENT_SCOPE)
+endif()
+
+
# Summary
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")