summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-07-11 18:42:41 +0800
committerErik Kundiman <erik@megapahit.org>2023-07-19 10:51:11 +0800
commit2911d635af8b65de35a70f8f0fc176854cf1bdfb (patch)
tree38d646c387733b95f27870b37f78f92e72975ef9 /indra/cmake
parentb2dbc73384ffcb65d3a50a4a38a367466ddb45ea (diff)
Obtain GTK2 required flags when using system libs
So far all of GTK2 dependencies flags, such as for Pango, Cairo, PNG16, etc., seem to be implied by checking the gtk+-2.0 module alone, at least on FreeBSD and Debian.
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/UI.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake
index 8b70192efc..1bb19e59a2 100644
--- a/indra/cmake/UI.cmake
+++ b/indra/cmake/UI.cmake
@@ -4,12 +4,19 @@ include(FreeType)
add_library( ll::uilibraries INTERFACE IMPORTED )
-if (LINUX)
+if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 )
if( USE_CONAN )
target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk )
return()
+ elseif( NOT USE_AUTOBUILD_3P )
+ include(FindPkgConfig)
+ pkg_check_modules(Gtk2 REQUIRED gtk+-2.0)
+ target_include_directories( ll::uilibraries SYSTEM INTERFACE ${Gtk2_INCLUDE_DIRS} )
+ target_link_directories( ll::uilibraries INTERFACE ${Gtk2_LIBRARY_DIRS} )
+ target_link_libraries( ll::uilibraries INTERFACE ${Gtk2_LIBRARIES} )
+ return()
endif()
use_prebuilt_binary(gtk-atk-pango-glib)
@@ -30,7 +37,7 @@ if (LINUX)
Xinerama
ll::freetype
)
-endif (LINUX)
+endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
if( WINDOWS )
target_link_libraries( ll::uilibraries INTERFACE
opengl32