vcpkg/ports/proj4/pkgconfig.patch

54 lines
1.6 KiB
Diff
Raw Normal View History

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 89763d7..f648296 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,7 +342,7 @@ install(FILES ${docfiles}
################################################################################
# pkg-config support
################################################################################
-if(UNIX OR MINGW)
+if(1)
configure_proj_pc()
install(FILES
diff --git a/cmake/ProjUtilities.cmake b/cmake/ProjUtilities.cmake
index 2e0db05..46e5de1 100644
--- a/cmake/ProjUtilities.cmake
+++ b/cmake/ProjUtilities.cmake
@@ -78,15 +78,21 @@ function(configure_proj_pc)
set(VERSION ${PROJ_VERSION})
# Build list for Libs.private
set(EXTRA_LIBS
- -lstdc++
- -lsqlite3
${CMAKE_THREAD_LIBS_INIT}
)
+ set(REQUIRES_PRIVATE "sqlite3")
if(TIFF_ENABLED)
- list(APPEND EXTRA_LIBS -ltiff)
+ string(APPEND REQUIRES_PRIVATE " libtiff-4")
endif()
if(CURL_ENABLED)
- list(APPEND EXTRA_LIBS -lcurl)
+ string(APPEND REQUIRES_PRIVATE " libcurl")
+ endif()
+ if(WIN32 AND NOT MINGW)
+ string(APPEND EXTRA_LIBS " -lole32 -lshell32")
+ elseif(NOT APPLE OR CMAKE_ANDROID_STL_TYPE MATCHES "^gnu")
+ string(APPEND EXTRA_LIBS " -lstdc++")
+ else()
+ string(APPEND EXTRA_LIBS " -lc++")
endif()
if(HAVE_LIBM)
list(APPEND EXTRA_LIBS -lm)
diff --git a/proj.pc.in b/proj.pc.in
index 846310d..3feac38 100644
--- a/proj.pc.in
+++ b/proj.pc.in
@@ -11,4 +11,5 @@ Requires:
Version: @VERSION@
Libs: -L${libdir} -lproj
Libs.private: @EXTRA_LIBS@
+Requires.private: @REQUIRES_PRIVATE@
Cflags: -I${includedir}