This is an automated email from the ASF dual-hosted git repository.
rleigh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xerces-c.git
The following commit(s) were added to refs/heads/master by this push:
new 549592880 Mark Xerces Dependencies as PRIVATE in CMake
new 0f109e531 Merge pull request #49 from oci-labs/xercesc-2236
549592880 is described below
commit 549592880ec8d97f1ab8140cb72b1414ed285768
Author: Fred Hornsey <[email protected]>
AuthorDate: Tue May 17 16:37:21 2022 -0500
Mark Xerces Dependencies as PRIVATE in CMake
Fixes https://issues.apache.org/jira/browse/XERCESC-2236, where trying
to use the generated CMake config package doesn't work because the
dependencies are not loaded using find_package in the config package.
This change assumes they're not necessary for users of the library and
marks them as PRIVATE so they don't end up in the config package in the
first place.
---
src/CMakeLists.txt | 2 +-
tests/CMakeLists.txt | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c29aa257b..9a81e50c6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1271,7 +1271,7 @@ set_target_properties(xerces-c-headers PROPERTIES FOLDER
"Library")
add_library(xerces-c
${libxerces_c_SOURCES}
${libxerces_c_RESOURCES})
-target_link_libraries(xerces-c ${libxerces_c_DEPS})
+target_link_libraries(xerces-c PRIVATE ${libxerces_c_DEPS})
if(XERCES_USE_NETACCESSOR_CURL)
target_include_directories(xerces-c SYSTEM PRIVATE ${CURL_INCLUDE_DIRS})
endif()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 78cd1171d..e87ccaa94 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -112,6 +112,7 @@ if(NOT XERCES_USE_MUTEXMGR_NOTHREAD)
add_test_executable(ThreadTest
src/ThreadTest/ThreadTest.cpp
)
+ target_link_libraries(ThreadTest Threads::Threads)
endif()
# Fails to compile under gcc 4 (ambiguous calls to NullPointerException)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]