aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/log4cpp/CONTROL2
-rw-r--r--ports/log4cpp/fix-export-targets.patch18
-rw-r--r--ports/log4cpp/log4cpp-config.in.cmake7
-rw-r--r--ports/log4cpp/portfile.cmake8
4 files changed, 34 insertions, 1 deletions
diff --git a/ports/log4cpp/CONTROL b/ports/log4cpp/CONTROL
index 11d3c0207..2b43a635c 100644
--- a/ports/log4cpp/CONTROL
+++ b/ports/log4cpp/CONTROL
@@ -1,6 +1,6 @@
Source: log4cpp
Version: 2.9.1
-Port-Version: 3
+Port-Version: 4
Homepage: https://github.com/orocos-toolchain/log4cpp
Description: Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable.
Supports: !uwp
diff --git a/ports/log4cpp/fix-export-targets.patch b/ports/log4cpp/fix-export-targets.patch
new file mode 100644
index 000000000..30b5320cd
--- /dev/null
+++ b/ports/log4cpp/fix-export-targets.patch
@@ -0,0 +1,18 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 19767a0..59dbf6c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -161,11 +161,13 @@ INSTALL (
+ )
+
+ INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME}
++ EXPORT log4cpp-targets
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin)
+
+ INSTALL(FILES package.xml DESTINATION share/log4cpp)
++INSTALL(EXPORT log4cpp-targets NAMESPACE log4cpp:: DESTINATION share/log4cpp)
+
+ ###########################################################
+ # DOCUMENTATION
diff --git a/ports/log4cpp/log4cpp-config.in.cmake b/ports/log4cpp/log4cpp-config.in.cmake
new file mode 100644
index 000000000..cdecd4b70
--- /dev/null
+++ b/ports/log4cpp/log4cpp-config.in.cmake
@@ -0,0 +1,7 @@
+
+if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32)
+ include(CMakeFindDependencyMacro)
+ find_dependency(Threads)
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/log4cpp-targets.cmake)
diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake
index e8de2c0e3..9c9bc600e 100644
--- a/ports/log4cpp/portfile.cmake
+++ b/ports/log4cpp/portfile.cmake
@@ -10,6 +10,7 @@ vcpkg_from_github(
fix-install-targets.patch
Fix-StaticSupport.patch
fix-includepath.patch
+ fix-export-targets.patch
)
vcpkg_configure_cmake(
@@ -21,9 +22,16 @@ vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/pkgconfig TARGET_PATH share/${PORT})
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
vcpkg_copy_pdbs()
+configure_file(
+ ${CMAKE_CURRENT_LIST_DIR}/log4cpp-config.in.cmake
+ ${CURRENT_PACKAGES_DIR}/share/${PORT}/log4cpp-config.cmake
+ @ONLY
+)
+
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)