aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
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