aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2021-08-28 22:06:41 +1200
committerGitHub <noreply@github.com>2021-08-28 22:06:41 +1200
commita2713d85eab58eff28da416942e0b0c73edd4fcb (patch)
treec27a21b9915e482b094ced6107098fa94487c1da /cmake
parent3bb6c1bf02c454686edf557a520ae6c70d6ae5d9 (diff)
downloadPROJ-a2713d85eab58eff28da416942e0b0c73edd4fcb.tar.gz
PROJ-a2713d85eab58eff28da416942e0b0c73edd4fcb.zip
proj.pc.in: add -lm -ldl in Libs.private (#2825)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/ProjConfig.cmake1
-rw-r--r--cmake/ProjUtilities.cmake10
2 files changed, 11 insertions, 0 deletions
diff --git a/cmake/ProjConfig.cmake b/cmake/ProjConfig.cmake
index d43a2767..a53c3af1 100644
--- a/cmake/ProjConfig.cmake
+++ b/cmake/ProjConfig.cmake
@@ -15,6 +15,7 @@ check_function_exists(localeconv HAVE_LOCALECONV)
check_function_exists(strerror HAVE_STRERROR)
if(NOT WIN32)
check_library_exists(dl dladdr "" HAVE_LIBDL)
+ check_library_exists(m exp "" HAVE_LIBM)
endif()
set(PACKAGE "proj")
diff --git a/cmake/ProjUtilities.cmake b/cmake/ProjUtilities.cmake
index f8688cd6..55d53cbb 100644
--- a/cmake/ProjUtilities.cmake
+++ b/cmake/ProjUtilities.cmake
@@ -83,6 +83,16 @@ function(configure_proj_pc)
if(CURL_ENABLED)
set(CURL_LIBS -lcurl)
endif()
+ set(EXTRA_LIBS "-lstdc++")
+ if(HAVE_LIBM)
+ list(APPEND EXTRA_LIBS "-lm")
+ endif()
+ if(HAVE_LIBDL)
+ list(APPEND EXTRA_LIBS "-ldl")
+ endif()
+ # Join list with a space
+ string(REPLACE ";" " " _tmp_str "${EXTRA_LIBS}")
+ set(EXTRA_LIBS "${_tmp_str}")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/proj.pc.in