summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-07-11 10:57:18 +0800
committerErik Kundiman <erik@megapahit.org>2023-07-19 10:44:05 +0800
commit066f6d400b7438575075f785ca8e93e435dc4029 (patch)
tree6f9fd3c5d916fd086ff3e2e8c271e3bb694a029d
parentce4362108a90033c5514a1d72230a6e91015f025 (diff)
Obtain APR required flags when using system libs
On some platforms such as FreeBSD or MacPorts, pkg-config --libs apr-util-1 already includes -lapr-1. But on APT, the apr-1 module needs to be checked too.
-rw-r--r--indra/cmake/APR.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake
index 8a0939c92c..29efa634c1 100644
--- a/indra/cmake/APR.cmake
+++ b/indra/cmake/APR.cmake
@@ -5,6 +5,15 @@ include_guard()
add_library( ll::apr INTERFACE IMPORTED )
+if (NOT (USE_AUTOBUILD_3P OR USE_CONAN))
+ include(FindPkgConfig)
+ pkg_check_modules(Apr REQUIRED apr-1 apr-util-1)
+ target_include_directories(ll::apr SYSTEM INTERFACE ${Apr_INCLUDE_DIRS})
+ target_link_directories(ll::apr INTERFACE ${Apr_LIBRARY_DIRS})
+ target_link_libraries(ll::apr INTERFACE ${Apr_LIBRARIES})
+ return ()
+endif ()
+
use_system_binary( apr apr-util )
use_prebuilt_binary(apr_suite)