Skip to content

Commit 33de65c

Browse files
lopsided98matejk
authored andcommitted
CMake: make utf8proc, PCRE2, zlib and expat private dependencies
In the unbundled build, utf8proc, PCRE2, zlib and expat were all included as part of the CMake link interface, and therefore the CMake config file required find_dependency() calls for each. These libraries are internal implementation details of Poco and are not exposed in any public API. Therefore, we can make them private dependencies and avoid the find_dependency() calls and their associated find scripts.
1 parent a92fff3 commit 33de65c

5 files changed

Lines changed: 2 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,6 @@ install(
562562
Devel
563563
)
564564

565-
if(POCO_UNBUNDLED)
566-
install(FILES cmake/FindPCRE2.cmake DESTINATION "${PocoConfigPackageLocation}")
567-
install(FILES cmake/FindUtf8Proc.cmake DESTINATION "${PocoConfigPackageLocation}")
568-
endif()
569-
570565
message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
571566
message(STATUS "${PROJECT_NAME} package version: ${PROJECT_VERSION}")
572567
if(BUILD_SHARED_LIBS)

Foundation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ set_target_properties(Foundation
110110
)
111111

112112
if(POCO_UNBUNDLED)
113-
target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB Utf8Proc::Utf8Proc)
113+
target_link_libraries(Foundation PRIVATE Pcre2::Pcre2 ZLIB::ZLIB Utf8Proc::Utf8Proc)
114114
target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED)
115115
else()
116116
target_compile_definitions(Foundation PUBLIC UTF8PROC_STATIC)
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
if(@POCO_UNBUNDLED@)
2-
include(CMakeFindDependencyMacro)
3-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
4-
find_dependency(ZLIB REQUIRED)
5-
find_dependency(PCRE2 REQUIRED)
6-
find_dependency(Utf8Proc REQUIRED)
7-
endif()
8-
91
include("${CMAKE_CURRENT_LIST_DIR}/PocoFoundationTargets.cmake")

XML/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ target_include_directories(XML
5050
)
5151

5252
if(POCO_UNBUNDLED)
53-
target_link_libraries(XML PUBLIC EXPAT::EXPAT)
53+
target_link_libraries(XML PRIVATE EXPAT::EXPAT)
5454
target_compile_definitions(XML PUBLIC POCO_UNBUNDLED)
5555
else()
5656
if(WIN32)

XML/cmake/PocoXMLConfig.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
include(CMakeFindDependencyMacro)
22
find_dependency(PocoFoundation)
3-
if(@POCO_UNBUNDLED@)
4-
if(CMAKE_VERSION VERSION_LESS "3.10")
5-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/V39")
6-
endif()
7-
find_dependency(EXPAT REQUIRED)
8-
endif()
9-
103
include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake")

0 commit comments

Comments
 (0)