From f0851a025deaaa8636cde6ee8339529eb6322d3d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 08:22:43 +0800 Subject: Set CMake USESYSTEMLIBS on to use system libraries Its use_system_binary implementation first tries to use pkg-config to generate the necessary flags. But if it doesn't find the package, then it will try to use find_package. The USESYSTEMLIBS is also brought back again though only in 1 place, and the name because it's the one still on the wiki page (the building the viewer with Autobuild one), so the CMake variable is not totally new. --- indra/cmake/Prebuilt.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 634cc15c21..b0acae279b 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -67,6 +67,22 @@ macro ( use_system_binary package ) endif() endforeach() return() + elseif( NOT USE_AUTOBUILD_3P ) + include(FindPkgConfig) + pkg_check_modules(${package} ${package}) + if( ${package}_FOUND ) + target_link_directories( ll::${package} INTERFACE ${${package}_LIBRARY_DIRS} ) + else() + pkg_check_modules(${package} lib${package}) + if( ${package}_FOUND ) + target_link_directories( ll::${package} INTERFACE ${${package}_LIBRARY_DIRS} ) + else() + find_package( ${package} REQUIRED ) + endif() + endif() + target_include_directories( ll::${package} SYSTEM INTERFACE ${${package}_INCLUDE_DIRS} ) + target_link_libraries( ll::${package} INTERFACE ${${package}_LIBRARIES} ) + return() endif() endmacro() -- cgit v1.2.3 From 351f8d2162e57751f9a4d0d47655a861ac2b37ad Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 10 Jul 2023 17:58:14 +0800 Subject: Fix PKG_CONFIG_MULTI_GUESS value It was set to the same value as PKG_CONFIG_MULTI_LOCAL_GUESS before. That's why it couldn't find any package installed by the package manager on a GNU/Linux distro. --- indra/cmake/ConfigurePkgConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake index 55d865392e..a2d5b31e25 100644 --- a/indra/cmake/ConfigurePkgConfig.cmake +++ b/indra/cmake/ConfigurePkgConfig.cmake @@ -14,7 +14,7 @@ IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") else (ADDRESS_SIZE EQUAL 32) SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib) SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib) - SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu) + SET(PKG_CONFIG_MULTI_GUESS /usr/lib/x86_64-linux-gnu) SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu) endif (ADDRESS_SIZE EQUAL 32) -- cgit v1.2.3 From ce4362108a90033c5514a1d72230a6e91015f025 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 10:41:11 +0800 Subject: OpenAL system lib flags by checking frealut module --- indra/cmake/OPENAL.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 0b6a7c2853..cc7deac2d9 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -18,6 +18,17 @@ endif() if (USE_OPENAL) add_library( ll::openal INTERFACE IMPORTED ) + + if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1) + include(FindPkgConfig) + pkg_check_modules(Openal REQUIRED freealut) + target_include_directories(ll::openal SYSTEM INTERFACE ${Openal_INCLUDE_DIRS}) + target_link_directories(ll::openal INTERFACE ${Openal_LIBRARY_DIRS}) + target_link_libraries(ll::openal INTERFACE ${Openal_LIBRARIES}) + return () + endif () + target_include_directories( ll::openal SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/AL") target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1) use_prebuilt_binary(openal) -- cgit v1.2.3 From 066f6d400b7438575075f785ca8e93e435dc4029 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 10:57:18 +0800 Subject: 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. --- indra/cmake/APR.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/cmake') 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) -- cgit v1.2.3 From 7943a9e01ae970eaa39cabccda68501e47340688 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 13:16:45 +0800 Subject: Obtain Boost include dir when using system libs The necessary linker flags to link the required Boost libraries are somehow not obtained from find_package. Passing boost_context, boost_fiber, or so on to find_package didn't help getting the linker flags either. Hence the manual listing of the Boost libraries to link. --- indra/cmake/Boost.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 601a23a86d..0c5abd885c 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -8,6 +8,21 @@ if( USE_CONAN ) target_link_libraries( ll::boost INTERFACE CONAN_PKG::boost ) target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() +elseif( NOT USE_AUTOBUILD_3P ) + find_package( Boost REQUIRED ) + target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) + if (DARWIN) + set(sfx "-mt") + endif() + target_link_libraries( ll::boost INTERFACE + boost_context${sfx} + boost_fiber${sfx} + boost_filesystem${sfx} + boost_program_options${sfx} + boost_regex${sfx} + boost_system${sfx} + boost_thread${sfx}) + return() endif() use_prebuilt_binary(boost) -- cgit v1.2.3 From 9a3c16da3bd845964de4bc9dfe297bb3901ad84f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 13:53:54 +0800 Subject: Only make sure there's xxHash when using sys libs --- indra/cmake/xxHash.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/xxHash.cmake b/indra/cmake/xxHash.cmake index a7c1cba62c..2dcab005ba 100644 --- a/indra/cmake/xxHash.cmake +++ b/indra/cmake/xxHash.cmake @@ -5,4 +5,11 @@ endif (XXHASH_CMAKE_INCLUDED) set (XXHASH_CMAKE_INCLUDED TRUE) include(Prebuilt) + +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Xxhash REQUIRED libxxhash) + return () +endif () + use_prebuilt_binary(xxhash) -- cgit v1.2.3 From f02ec9ba5df6c788399a28d57942485ca21529b7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 13:58:37 +0800 Subject: Keep using Zlib (no -ng) when using system libs Calls to zlib-ng in the viewer code aren't prefixed. And in order to build, the zlib-ng package needs to be configured with the ZLIB_COMPAT option on. Some package managers may not have provided the option on, or to turn that on, yet. --- indra/cmake/ZLIBNG.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 5d99cd9709..60164116dd 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -8,6 +8,12 @@ add_library( ll::zlib-ng INTERFACE IMPORTED ) if(USE_CONAN ) target_link_libraries( ll::zlib-ng INTERFACE CONAN_PKG::zlib ) return() +elseif(NOT USE_AUTOBUILD_3P) + pkg_check_modules(Zlib REQUIRED zlib) + target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${Zlib_INCLUDE_DIRS}) + target_link_directories( ll::zlib-ng INTERFACE ${Zlib_LIBRARY_DIRS} ) + target_link_libraries( ll::zlib-ng INTERFACE ${Zlib_LIBRARIES}) + return() endif() use_prebuilt_binary(zlib-ng) -- cgit v1.2.3 From 79b91a4ed2d826308e5dd2c9493efb449b380ff7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 14:28:24 +0800 Subject: Not use use_system_binary for system xmlrpc-epi The xmlrpc-epi package has no .pc or .cmake files. On some platforms, the header and the library directories don't have special paths. On GNU/Linux, at least on Debian, the headers are encapsulated in the packages's own directory. On macOS, both MacPorts & Homebrew don't have the package. On the other hand, Fink, that has the package, still doesn't support recent versions of macOS as of this writing. So it's very likely that on macOS, xmlrpc-epi is installed in /usr/local. --- indra/cmake/XmlRpcEpi.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 6409f9d6e2..b7d2fa6ce6 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,8 +4,18 @@ include(Prebuilt) include_guard() add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) +if (USE_AUTOBUILD_3P OR USE_CONAN) use_system_binary( xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) +endif () + target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) + +if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) +elseif (LINUX) +target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/include/xmlrpc-epi) +elseif (DARWIN) +target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) +endif () -- cgit v1.2.3 From 78fc526400e253500f809e15b2da50061883d8c8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 15:53:04 +0800 Subject: Not use use_system_binary for system OpenSSL Some distros already include OpenSSL as part of the distribution, that OpenSSL may not be provided with its .pc files, even though they're available upstream. --- indra/cmake/OpenSSL.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 3387c74f45..c9147f1d5e 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,8 +4,11 @@ include(Prebuilt) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) +if (USE_AUTOBUILD_3P OR USE_CONAN) use_system_binary(openssl) use_prebuilt_binary(openssl) +endif () + if (WINDOWS) target_link_libraries(ll::openssl INTERFACE libssl libcrypto) elseif (LINUX) @@ -13,5 +16,6 @@ elseif (LINUX) else() target_link_libraries(ll::openssl INTERFACE ssl crypto) endif (WINDOWS) +if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - +endif () -- cgit v1.2.3 From b4d1301f272e707548f30f52671db76576273eaa Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 14:58:08 +0800 Subject: Not use use_system_binary for system GLH No package manager that I know of provide such package. So this one is expected to be installed in /usr/local/include. --- indra/cmake/GLH.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index 0cefc3543a..49c4e3b37a 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -3,5 +3,10 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_include_directories( ll::glh_linear SYSTEM INTERFACE /usr/local/include ) + return () +endif () + use_system_binary( glh_linear ) use_prebuilt_binary(glh_linear) -- cgit v1.2.3 From c718c518f86e3bd78bd71bbd07fbc626373bbe96 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 15:45:07 +0800 Subject: Not use use_system_binary for system GLEXT for the same reason as GLH, but since the headers are expected to be installed in the same directory as GLH (and GLEXT.cmake includes GLH.cmake), we can skip any additional directory to look the headers for. --- indra/cmake/GLEXT.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 434b6f0ee8..2e46d1bea8 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -3,6 +3,11 @@ include(Prebuilt) include(GLH) add_library( ll::glext INTERFACE IMPORTED ) + +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + return () +endif () + if (WINDOWS OR LINUX) use_system_binary(glext) use_prebuilt_binary(glext) -- cgit v1.2.3 From 593e7199e2dece84584882ed90b5dcc0ffb4d52b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 19:29:32 +0800 Subject: Obtain OpenJPEG flags when using system libs The module name to check with pkgconf is different, hence the special treatment. --- indra/cmake/OpenJPEG.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index c4aab2e9e5..3f86bfd025 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Openjpeg REQUIRED libopenjp2) + target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) + target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) + target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) + return () +endif () + use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) -- cgit v1.2.3 From d7a2947c4f24726df622749fa45b9306d1ed43e8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 20:02:46 +0800 Subject: Obtain Meshoptimizer flags when using system libs The Meshoptimizer CMake files don't seem to be working right. On more than one platform, they always conclude the package as not found. Nevertheless, the library is typically installed in standard paths, that no special paths need to be included for Meshoptimizer to be found. Except on macOS (so far), as existing package managers don't have that package yet, hence the /usr/local/include addition. It's a safe path to include anyway on other un*x platforms. --- indra/cmake/Meshoptimizer.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index fd144d2b97..6cf8343dd6 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -6,6 +6,12 @@ include(Prebuilt) include_guard() add_library( ll::meshoptimizer INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_include_directories( ll::meshoptimizer SYSTEM INTERFACE /usr/local/include ) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) + return () +endif () + use_system_binary(meshoptimizer) use_prebuilt_binary(meshoptimizer) -- cgit v1.2.3 From 45b9eed30320c6281efcfb748098a8789b15f15f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 16:56:16 +0800 Subject: LL physics extensions stub Since the CMakeLists.txt includes some same .cmake files as the viewer, I think the project might as well be a part of the Linden libraries code. And for now is put under llprimitive (might not be consistent, in fact the opposite, with they way llplugin relates to slplugin), but I think this way results the least change, and it still works. The differences include: - all files (common llphysicsextensions headers to be included by library users and the stub implementation files) are put inside one directory, and the CMakeLists.txt is adjusted accordingly; - modernised CMakeLists.txt, so include_directories are now implied by target_link_libraries; - some file name fix; - add_library is not explicitly set to STATIC; --- indra/cmake/LLPhysicsExtensions.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 36821447c9..b2151dc781 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -26,6 +26,9 @@ if (HAVOK) elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) +elseif (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) + return () else (HAVOK) use_prebuilt_binary(llphysicsextensions_stub) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) -- cgit v1.2.3 From 16d30ec8b5a8bca3fac191d7bfe617a08913f803 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 20:29:48 +0800 Subject: Obtain COLLADA DOM flags when using system libs There are also several additional flags from running pkgconf that we don't get from pkg_check_modules. At least 1 is needed later when compiling llprimitive. --- indra/cmake/LLPrimitive.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 3d8499cbc3..387cae61d8 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -11,6 +11,16 @@ add_library( ll::minizip-ng INTERFACE IMPORTED ) add_library( ll::libxml INTERFACE IMPORTED ) add_library( ll::colladadom INTERFACE IMPORTED ) +if ( NOT (USE_AUTOBUILD_3P OR USE_CONAN) ) + include(FindPkgConfig) + pkg_check_modules(Colladadom REQUIRED collada-dom) + target_compile_definitions( ll::colladadom INTERFACE COLLADA_DOM_SUPPORT141 ) + target_include_directories( ll::colladadom SYSTEM INTERFACE ${Colladadom_INCLUDE_DIRS} ${Colladadom_INCLUDE_DIRS}/1.4 ) + target_link_directories( ll::colladadom INTERFACE ${Colladadom_LIBRARY_DIRS} ) + target_link_libraries( ll::colladadom INTERFACE ${Colladadom_LIBRARIES} ) + return () +endif () + # ND, needs fixup in collada conan pkg if( USE_CONAN ) target_include_directories( ll::colladadom SYSTEM INTERFACE -- cgit v1.2.3 From b2dbc73384ffcb65d3a50a4a38a367466ddb45ea Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 20:35:40 +0800 Subject: Obtain FreeType flags when using system libs The module name to check with pkgconf is different, hence the special treatment. --- indra/cmake/FreeType.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 77140af641..fbf188d100 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Freetype REQUIRED freetype2) + target_include_directories( ll::freetype SYSTEM INTERFACE ${Freetype_INCLUDE_DIRS} ) + target_link_directories( ll::freetype INTERFACE ${Freetype_LIBRARY_DIRS} ) + target_link_libraries( ll::freetype INTERFACE ${Freetype_LIBRARIES} ) + return () +endif () + use_system_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) -- cgit v1.2.3 From 2911d635af8b65de35a70f8f0fc176854cf1bdfb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 18:42:41 +0800 Subject: 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. --- indra/cmake/UI.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/cmake') 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 -- cgit v1.2.3 From 2fc3845e1b23a1efd5666241a2d1cc78340d4b61 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 18:54:50 +0800 Subject: Obtain FontConfig flags when using system libs and at the same time escape use_prebuilt_binary commands in the file. --- indra/cmake/ViewerMiscLibs.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 00f8b77106..52128414c9 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,6 +1,12 @@ # -*- cmake -*- include(Prebuilt) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + add_library( ll::fontconfig INTERFACE IMPORTED ) + use_system_binary(fontconfig) + return () +endif () + if (LINUX) #use_prebuilt_binary(libuuid) add_library( ll::fontconfig INTERFACE IMPORTED ) -- cgit v1.2.3 From 7360923f0888e48294921bd931c585c7c502a443 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 19:19:55 +0800 Subject: Disable dictionaries when using system libs for now. Dictionaries should later be enabled when we have arrived at the point where everything has run well that the next stage would be the packaging for the distribution stage. --- indra/cmake/Hunspell.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index bb037c0237..96c75ad262 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -2,7 +2,9 @@ include(Prebuilt) include_guard() +if (USE_AUTOBUILD_3P OR USE_CONAN) use_prebuilt_binary(dictionaries) +endif () add_library( ll::hunspell INTERFACE IMPORTED ) use_system_binary(hunspell) -- cgit v1.2.3 From fe29edcff99d5e69bb4cf401870f7503089cf69c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:42:07 +0800 Subject: Use system SDL on FreeBSD too X11 is still required too, that's why it's still added for linking. On Darwin, SDL is disabled for now. --- indra/cmake/LLWindow.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index b36e970560..f952383a27 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -7,6 +7,16 @@ include(Prebuilt) include_guard() add_library( ll::SDL INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) + include(FindPkgConfig) + pkg_check_modules(Sdl REQUIRED sdl) + target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) + target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl_INCLUDE_DIRS}) + target_link_directories(ll::SDL INTERFACE ${Sdl_LIBRARY_DIRS}) + target_link_libraries(ll::SDL INTERFACE ${Sdl_LIBRARIES} X11) + return () +endif () + if (LINUX) #Must come first as use_system_binary can exit this file early -- cgit v1.2.3 From 59eb9cc368b359c069f1ddb187ea23aff4808d1c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 17:08:29 +0800 Subject: Mac frameworks not linked for "the remaining" OSes --- indra/cmake/Linking.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 4a501f420b..14b5e76877 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -64,7 +64,7 @@ elseif (WINDOWS) dbghelp legacy_stdio_definitions ) -else() +elseif (DARWIN) include(CMakeFindFrameworks) find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(CARBON_LIBRARY Carbon) -- cgit v1.2.3 From 7a2a5c5c0ba9d04528d909f59c2ccfac35412e15 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 20:11:26 +0800 Subject: Obtain Vorbis & Ogg flags when using system libs On some platforms, pkg-config --libs vorbis might not necessarily imply -logg. vorbisenc & vorbisfile need their own checks anyway. --- indra/cmake/Audio.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 38547bb017..4c1a141dc5 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::vorbis INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Vorbis REQUIRED ogg vorbis vorbisenc vorbisfile) + target_include_directories(ll::vorbis SYSTEM INTERFACE ${Vorbis_INCLUDE_DIRS}) + target_link_directories(ll::vorbis INTERFACE ${Vorbis_LIBRARY_DIRS}) + target_link_libraries(ll::vorbis INTERFACE ${Vorbis_LIBRARIES}) + return () +endif () + use_system_binary(vorbis) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) -- cgit v1.2.3 From c2e755287eee1e9c9af4f918b20a4b2fa5f361f7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 14:29:52 +0800 Subject: Start adding LibVLC support when using system libs Streaming is not working yet, though. Until it's made sure that the dynamic library and plugins needed are on the paths the executable is expecting them to be. --- indra/cmake/LibVLCPlugin.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 599ce02844..271202be4d 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,9 +5,26 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) +if (USE_AUTOBUILD_3P OR USE_CONAN) use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") +else () + include(FindPkgConfig) + if (DARWIN) + set(CMAKE_PREFIX_PATH /opt/local/libexec/vlc3/lib/pkgconfig) + pkg_check_modules(Libvlc REQUIRED libvlc) + target_link_libraries( ll::libvlc INTERFACE vlccore ) + else () + pkg_check_modules(Libvlc REQUIRED libvlc vlc-plugin) + endif () + target_include_directories( ll::libvlc SYSTEM INTERFACE ${Libvlc_INCLUDE_DIRS} ) + target_link_directories( ll::libvlc INTERFACE ${Libvlc_LIBRARY_DIRS} ) + target_link_libraries( ll::libvlc INTERFACE ${Libvlc_LIBRARIES} ) + set(LIBVLCPLUGIN ON CACHE BOOL + "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") + return() +endif () if (WINDOWS) target_link_libraries( ll::libvlc INTERFACE -- cgit v1.2.3 From 665a55a1a232877ccb499dbfd17806f438385e82 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 21:07:13 +0800 Subject: The Linden libraries can be installed now Useful when installed as shared libraries, so other viewer executables can share these libraries. --- indra/cmake/LibraryInstall.cmake | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 indra/cmake/LibraryInstall.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/LibraryInstall.cmake b/indra/cmake/LibraryInstall.cmake new file mode 100644 index 0000000000..5a55c215ed --- /dev/null +++ b/indra/cmake/LibraryInstall.cmake @@ -0,0 +1,4 @@ +list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES CMakeLists.txt) +install(FILES ${${PROJECT_NAME}_HEADER_FILES} + DESTINATION include/${PROJECT_NAME}) +install(TARGETS ${PROJECT_NAME} DESTINATION lib) -- cgit v1.2.3 From 849113dcafc35a4dfdcd778e3cf64c44112145ee Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 21:18:28 +0800 Subject: Viewer & resources can be installed on the system --- indra/cmake/UnixInstall.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/UnixInstall.cmake b/indra/cmake/UnixInstall.cmake index 139be0a008..ecec0e3417 100644 --- a/indra/cmake/UnixInstall.cmake +++ b/indra/cmake/UnixInstall.cmake @@ -6,7 +6,7 @@ set(INSTALL OFF CACHE BOOL "Generate install target.") if (INSTALL) - set(INSTALL_PREFIX /usr CACHE PATH + set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Top-level installation directory.") if (EXISTS /lib64) @@ -21,11 +21,11 @@ if (INSTALL) set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH "Installation directory for read-only shared files.") - set(APP_BINARY_DIR ${INSTALL_LIBRARY_DIR}/secondlife-${viewer_VERSION} + set(APP_BINARY_DIR ${INSTALL_PREFIX}/bin CACHE PATH "Installation directory for binaries.") - set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/secondlife-${viewer_VERSION} + set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME} CACHE PATH "Installation directory for read-only data files.") endif (INSTALL) -- cgit v1.2.3 From d3c70f1795875c4b84af0f21b5473de152dec9e9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 22:00:30 +0800 Subject: Fix CMAKE_PREFIX_PATH setting syntax for Darwin --- indra/cmake/LibVLCPlugin.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 271202be4d..f4ec34ec1b 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -12,7 +12,7 @@ set(LIBVLCPLUGIN ON CACHE BOOL else () include(FindPkgConfig) if (DARWIN) - set(CMAKE_PREFIX_PATH /opt/local/libexec/vlc3/lib/pkgconfig) + set(CMAKE_PREFIX_PATH "/opt/local/libexec/vlc3/lib/pkgconfig") pkg_check_modules(Libvlc REQUIRED libvlc) target_link_libraries( ll::libvlc INTERFACE vlccore ) else () -- cgit v1.2.3 From d224330cb78bfe2a766023cbccbe26a471d88712 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 22:01:11 +0800 Subject: Darwin escapes prebuilt dir inclusion on sys libs --- indra/cmake/UI.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 1bb19e59a2..03bdf4e434 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -55,7 +55,9 @@ if( WINDOWS ) ) endif() +if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::uilibraries SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) +endif () -- cgit v1.2.3 From f711733280410c40cf3e96de43692b34cebed186 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 22:35:19 +0800 Subject: Add system XMLRPC-EPI include directory for Darwin --- indra/cmake/XmlRpcEpi.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index b7d2fa6ce6..ae2ed6a83f 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -17,5 +17,6 @@ target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR} elseif (LINUX) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/include/xmlrpc-epi) elseif (DARWIN) +target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) endif () -- cgit v1.2.3 From e08ad14176502a8cc26b401c48b7161ce8c39140 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 30 Jul 2023 19:02:54 +0800 Subject: SLPlugin is in libexec when installed to system --- indra/cmake/UnixInstall.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/UnixInstall.cmake b/indra/cmake/UnixInstall.cmake index ecec0e3417..55b6889836 100644 --- a/indra/cmake/UnixInstall.cmake +++ b/indra/cmake/UnixInstall.cmake @@ -28,4 +28,8 @@ if (INSTALL) set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME} CACHE PATH "Installation directory for read-only data files.") + + set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME} + CACHE PATH + "Installation directory for non-manual executables.") endif (INSTALL) -- cgit v1.2.3 From 6d31ea65d2c597397971fb97fc17610277104e1b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 15 Aug 2023 16:28:26 +0800 Subject: SDL 1.2 to 2.0 migration Both keycodes and scancodes are now 32 bits, so the key type is lengthened from U16 to U32. --- indra/cmake/LLWindow.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index f952383a27..09b8fdb83d 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,11 +9,11 @@ add_library( ll::SDL INTERFACE IMPORTED ) if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) include(FindPkgConfig) - pkg_check_modules(Sdl REQUIRED sdl) + pkg_check_modules(Sdl2 REQUIRED sdl2) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) - target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl_INCLUDE_DIRS}) - target_link_directories(ll::SDL INTERFACE ${Sdl_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl_LIBRARIES} X11) + target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) + target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) return () endif () -- cgit v1.2.3 From d883a11567252d9a0baff653bb16c38817a7c21c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 16 Aug 2023 01:28:53 +0800 Subject: Try not to rely (explicitly) on X11 --- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/UI.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 09b8fdb83d..91453936f5 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -13,7 +13,7 @@ if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES}) return () endif () diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 03bdf4e434..2e0709317b 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,7 +5,8 @@ include(FreeType) add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) + #target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) + target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1) if( USE_CONAN ) target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) -- cgit v1.2.3 From 12487dc5c00d68cd742f2ef4ee0a0b0713cce9f1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 16 Aug 2023 16:13:30 +0800 Subject: Revert "Try not to rely (explicitly) on X11" This reverts commit d883a11567252d9a0baff653bb16c38817a7c21c. --- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/UI.cmake | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 91453936f5..09b8fdb83d 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -13,7 +13,7 @@ if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES}) + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) return () endif () diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 2e0709317b..03bdf4e434 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,8 +5,7 @@ include(FreeType) add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - #target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1) + target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) if( USE_CONAN ) target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) -- cgit v1.2.3 From 99e4f282ba8df6dcaa3032fa1bfbb5f88884d9a6 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 16:25:38 +0800 Subject: Darwin & any platform can, and should, use SDL The alt mouse click to cam is broken for now on macOS, but this is the path we've chosen. --- indra/cmake/LLWindow.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 09b8fdb83d..8cb383d718 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -7,13 +7,16 @@ include(Prebuilt) include_guard() add_library( ll::SDL INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) +if (USESYSTEMLIBS) include(FindPkgConfig) pkg_check_modules(Sdl2 REQUIRED sdl2) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) + if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + list(APPEND Sdl2_LIBRARIES X11) + endif () + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES}) return () endif () -- cgit v1.2.3 From e24c3ed7d3baef9ea313a0f528075ef229257975 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 13:53:34 +0800 Subject: Add sysroot to XMLRPC-EPI include path on Linux Useful when cross compiling. --- indra/cmake/XmlRpcEpi.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index ae2ed6a83f..337e4b8974 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -15,7 +15,8 @@ target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) elseif (LINUX) -target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/include/xmlrpc-epi) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE + ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) elseif (DARWIN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) -- cgit v1.2.3 From 319ed3a59df9dbd2b51ece3d6a698040dcb47135 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 17:58:50 +0800 Subject: Fix target_link_directories argument Only found out after using CMake 3.26 for Darwin. It wasn't an error when using CMake 3.24. --- indra/cmake/XmlRpcEpi.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 337e4b8974..aefc3e895f 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -19,5 +19,5 @@ elseif (LINUX) ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) elseif (DARWIN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) -target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) +target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) endif () -- cgit v1.2.3 From 5918eedb06b6441e5608ed7958a2b3ca01dc8010 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 18:03:39 +0800 Subject: Reindented --- indra/cmake/XmlRpcEpi.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index aefc3e895f..994df3d128 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -18,6 +18,6 @@ elseif (LINUX) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) elseif (DARWIN) -target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) -target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) + target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) endif () -- cgit v1.2.3 From a09352872b2f1a9db452d9cc313088abd5fb75c0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 14:04:20 +0800 Subject: Add sysroot to GLH & Meshoptimizer include paths When cross-compiling, the host's /usr/local/include would be unsafely included before. The problem with this was that it leaked other host library headers unexpectedly, like Boost. The target compilation caught some function from the host headers which of a newer version, and then when trying to link to the target libraries, the function wasn't available yet in the older version. --- indra/cmake/GLH.cmake | 7 ++++--- indra/cmake/Meshoptimizer.cmake | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index 49c4e3b37a..09f7d568be 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -3,9 +3,10 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - target_include_directories( ll::glh_linear SYSTEM INTERFACE /usr/local/include ) - return () +if (USESYSTEMLIBS) + target_include_directories(ll::glh_linear SYSTEM INTERFACE + ${CMAKE_SYSROOT}/usr/local/include) + return () endif () use_system_binary( glh_linear ) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index 6cf8343dd6..70b3a2c088 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -7,7 +7,7 @@ include_guard() add_library( ll::meshoptimizer INTERFACE IMPORTED ) if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - target_include_directories( ll::meshoptimizer SYSTEM INTERFACE /usr/local/include ) + target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/local/include ) target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) return () endif () -- cgit v1.2.3 From 00be9e00107c51a35c04f64fe917c559b8325564 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 15:46:12 +0800 Subject: CPack for packaging (when PACKAGE set to on) Since we could use the dynamic versioning from the configuration phase of CMake, the inclusion is put in BuildVersion.cmake. Other CPACK variables are usually static so can be set when running cmake. CPack somehow doesn't pick up the DESTINATION values in ViewerInstall (slplugin & libvlc too) from UnixInstall, so they're they're partially hardcoded again there. --- indra/cmake/BuildVersion.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index b531f29ee2..a56829bf14 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -55,4 +55,10 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" "LLBUILD_CONFIG=\"${CMAKE_BUILD_TYPE}\"" ) +if (PACKAGE) + include(CPack) + set(CPACK_PACKAGE_VERSION + ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} + CACHE STRING "Viewer major.minor.patch.revision versions.") +endif (PACKAGE) endif (NOT DEFINED VIEWER_SHORT_VERSION) -- cgit v1.2.3 From 79cc50c4f93ebe813ddda562b6450561e7650a9d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 19:22:22 +0800 Subject: Don't install the headers for now until we've tried building another project, but based on this project's liblinden. It's also because these headers would be in a separate -dev Debian package. --- indra/cmake/LibraryInstall.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LibraryInstall.cmake b/indra/cmake/LibraryInstall.cmake index 5a55c215ed..dfc777c1cd 100644 --- a/indra/cmake/LibraryInstall.cmake +++ b/indra/cmake/LibraryInstall.cmake @@ -1,4 +1,4 @@ list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES CMakeLists.txt) -install(FILES ${${PROJECT_NAME}_HEADER_FILES} - DESTINATION include/${PROJECT_NAME}) +#install(FILES ${${PROJECT_NAME}_HEADER_FILES} +# DESTINATION include/${PROJECT_NAME}) install(TARGETS ${PROJECT_NAME} DESTINATION lib) -- cgit v1.2.3 From b0428375e14c4c9e6bc9dc723bdc94983d3dde6b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 19:25:14 +0800 Subject: Don't install the libraries when they're static For runtime, they're already part of the executable. For development, we're not there yet. So this reduces the overall package size for now. --- indra/cmake/LibraryInstall.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LibraryInstall.cmake b/indra/cmake/LibraryInstall.cmake index dfc777c1cd..01838fe42e 100644 --- a/indra/cmake/LibraryInstall.cmake +++ b/indra/cmake/LibraryInstall.cmake @@ -1,4 +1,6 @@ list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES CMakeLists.txt) #install(FILES ${${PROJECT_NAME}_HEADER_FILES} # DESTINATION include/${PROJECT_NAME}) -install(TARGETS ${PROJECT_NAME} DESTINATION lib) +if (BUILD_SHARED_LIBS) + install(TARGETS ${PROJECT_NAME} DESTINATION lib) +endif () -- cgit v1.2.3 From 8e70361fc38b5a735f95459c1e717d41e639c708 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 27 Aug 2023 07:12:12 +0800 Subject: Force FreeBSD to accept TOS via external browser This forces the use of external browser for links too for now, as we don't have a solution for the HTML media plugin yet. --- indra/cmake/00-Common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index c708199309..f81bdbf311 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -110,7 +110,7 @@ if (WINDOWS) endif (WINDOWS) -if (LINUX) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(CMAKE_SKIP_RPATH TRUE) # EXTERNAL_TOS @@ -151,7 +151,7 @@ if (LINUX) set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") -endif (LINUX) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if (DARWIN) -- cgit v1.2.3 From e7e2fa632a11da614e7afaaf766673ac41c12ba9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 27 Aug 2023 07:37:49 +0800 Subject: Hidden visibility only when building static libs Otherwise it would fail to link SLPlugin. --- indra/cmake/00-Common.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index f81bdbf311..ebb3a73a62 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -138,9 +138,12 @@ if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -pthread -Wno-parentheses -Wno-deprecated - -fvisibility=hidden ) + if (NOT BUILD_SHARED_LIBS) + add_compile_options(-fvisibility=hidden) + endif (NOT BUILD_SHARED_LIBS) + if (ADDRESS_SIZE EQUAL 32) add_compile_options(-march=pentium4) endif (ADDRESS_SIZE EQUAL 32) -- cgit v1.2.3 From 0797257992ee7f88456d3083ebf214485b75c139 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 12:50:44 +0800 Subject: Use prebuilt OpenJPEG for now until we figure out what's causing crashes with vanilla OpenJPEG. --- indra/cmake/OpenJPEG.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 3f86bfd025..83b959e140 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,17 +4,17 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - include(FindPkgConfig) - pkg_check_modules(Openjpeg REQUIRED libopenjp2) - target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) - target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) - target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) - return () -endif () +#if (USESYSTEMLIBS) +# include(FindPkgConfig) +# pkg_check_modules(Openjpeg REQUIRED libopenjp2) +# target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) +# target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) +# target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) +# return () +#endif () -use_system_binary(openjpeg) -use_prebuilt_binary(openjpeg) +#use_system_binary(openjpeg) +#use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjp2 ) target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) -- cgit v1.2.3