From 7522cea2528f9cfdf5283a7920dd3434417b20f4 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 16:31:53 +0200 Subject: Use git for version detection fallback --- indra/cmake/BuildVersion.cmake | 44 ++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 157fdd07e4..b531f29ee2 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -19,33 +19,23 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n message(STATUS "Revision (from autobuild environment): ${VIEWER_VERSION_REVISION}") else (DEFINED ENV{revision}) - find_program(MERCURIAL - NAMES hg - PATHS [HKEY_LOCAL_MACHINE\\Software\\TortoiseHG] - PATH_SUFFIXES Mercurial) - mark_as_advanced(MERCURIAL) - if (MERCURIAL) - execute_process(COMMAND ${MERCURIAL} identify --num --rev tip - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - RESULT_VARIABLE hg_id_result - ERROR_VARIABLE hg_id_error - OUTPUT_VARIABLE VIEWER_VERSION_REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT ${hg_id_result} EQUAL 0) - message(SEND_ERROR "Revision number generation failed with output:\n${hg_id_error}") - else (NOT ${hg_id_result} EQUAL 0) - string(REGEX REPLACE "[^0-9a-f]" "" VIEWER_VERSION_REVISION ${VIEWER_VERSION_REVISION}) - endif (NOT ${hg_id_result} EQUAL 0) - if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") - message(STATUS "Revision (from hg) ${VIEWER_VERSION_REVISION}") - else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") - message(STATUS "Revision not set (repository not found?); using 0") - set(VIEWER_VERSION_REVISION 0 ) - endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") - else (MERCURIAL) - message(STATUS "Revision not set: mercurial not found; using 0") - set(VIEWER_VERSION_REVISION 0) - endif (MERCURIAL) + find_program(GIT git) + if (DEFINED GIT ) + execute_process( + COMMAND ${GIT} rev-list --count HEAD + OUTPUT_VARIABLE VIEWER_VERSION_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") + message(STATUS "Revision (from git) ${VIEWER_VERSION_REVISION}") + else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") + message(STATUS "Revision not set (repository not found?); using 0") + set(VIEWER_VERSION_REVISION 0 ) + endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") + else (DEFINED GIT ) + message(STATUS "Revision not set: 'git' found; using 0") + set(VIEWER_VERSION_REVISION 0) + endif (DEFINED GIT) endif (DEFINED ENV{revision}) message(STATUS "Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") else ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) -- cgit v1.2.3 From 786b291d9c6b784c7ce6ceef0e38a4ec76ea14db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 16:32:52 +0200 Subject: Move CMake files to modernized cmake syntax, step 1. Change projects to cmake targetsto get rid of havig to hardcore include directories and link libraries in consumer projects. --- indra/cmake/00-Common.cmake | 25 ++++----- indra/cmake/APR.cmake | 51 ++++++++--------- indra/cmake/Atmosphere.cmake | 5 -- indra/cmake/Audio.cmake | 33 +++-------- indra/cmake/Boost.cmake | 103 ++++++++++------------------------ indra/cmake/CEFPlugin.cmake | 13 +++-- indra/cmake/CMakeLists.txt | 17 +----- indra/cmake/CURL.cmake | 14 ++--- indra/cmake/EXPAT.cmake | 12 ++-- indra/cmake/FMODSTUDIO.cmake | 26 +++++---- indra/cmake/FreeType.cmake | 10 +++- indra/cmake/GLOD.cmake | 11 +++- indra/cmake/Hunspell.cmake | 14 +++-- indra/cmake/JPEG.cmake | 15 +++-- indra/cmake/JsonCpp.cmake | 17 +++--- indra/cmake/LLAddBuildTest.cmake | 38 ++++++------- indra/cmake/LLAppearance.cmake | 12 ---- indra/cmake/LLAudio.cmake | 7 --- indra/cmake/LLCharacter.cmake | 7 --- indra/cmake/LLCommon.cmake | 35 +----------- indra/cmake/LLCoreHttp.cmake | 14 +---- indra/cmake/LLCrashLogger.cmake | 7 --- indra/cmake/LLFileSystem.cmake | 7 --- indra/cmake/LLImage.cmake | 9 +-- indra/cmake/LLImageJ2COJ.cmake | 5 -- indra/cmake/LLInventory.cmake | 7 --- indra/cmake/LLKDU.cmake | 18 ++++-- indra/cmake/LLLogin.cmake | 7 --- indra/cmake/LLMessage.cmake | 13 ----- indra/cmake/LLPhysicsExtensions.cmake | 16 +++--- indra/cmake/LLPlugin.cmake | 14 ----- indra/cmake/LLPrimitive.cmake | 66 ++++++++++------------ indra/cmake/LLRender.cmake | 20 ------- indra/cmake/LLUI.cmake | 7 --- indra/cmake/LLWindow.cmake | 12 ---- indra/cmake/LLXML.cmake | 14 ----- indra/cmake/LibVLCPlugin.cmake | 17 ++++-- indra/cmake/MediaPluginBase.cmake | 8 --- indra/cmake/NDOF.cmake | 14 ++--- indra/cmake/NGHTTP2.cmake | 16 +++--- indra/cmake/NVAPI.cmake | 3 +- indra/cmake/OPENAL.cmake | 12 +++- indra/cmake/OpenJPEG.cmake | 18 ++---- indra/cmake/OpenSSL.cmake | 21 ++++--- indra/cmake/PNG.cmake | 26 +++------ indra/cmake/Prebuilt.cmake | 11 ++++ indra/cmake/URIPARSER.cmake | 29 +++------- indra/cmake/XmlRpcEpi.cmake | 17 ++---- indra/cmake/ZLIBNG.cmake | 33 +++-------- indra/cmake/bugsplat.cmake | 10 ++-- 50 files changed, 324 insertions(+), 612 deletions(-) delete mode 100644 indra/cmake/Atmosphere.cmake delete mode 100644 indra/cmake/LLCharacter.cmake delete mode 100644 indra/cmake/LLCrashLogger.cmake delete mode 100644 indra/cmake/LLFileSystem.cmake delete mode 100644 indra/cmake/LLImageJ2COJ.cmake delete mode 100644 indra/cmake/LLInventory.cmake delete mode 100644 indra/cmake/LLLogin.cmake delete mode 100644 indra/cmake/LLMessage.cmake delete mode 100644 indra/cmake/LLPlugin.cmake delete mode 100644 indra/cmake/LLRender.cmake delete mode 100644 indra/cmake/LLUI.cmake delete mode 100644 indra/cmake/LLXML.cmake delete mode 100644 indra/cmake/MediaPluginBase.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 0ab7fa2456..45c81b1b30 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -70,12 +70,6 @@ if (WINDOWS) if( ADDRESS_SIZE EQUAL 32 ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64") endif() - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo" - CACHE STRING "C++ compiler release-with-debug options" FORCE) - set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo" - CACHE STRING "C++ compiler release options" FORCE) # zlib has assembly-language object files incompatible with SAFESEH set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099") @@ -87,15 +81,16 @@ if (WINDOWS) # /DDOM_DYNAMIC # For shared library colladadom ) add_compile_options( - /GS - /TP - /W3 - /c - /Zc:forScope - /nologo - /Oy- -# /arch:SSE2 - /fp:fast + + /Zo + /GS + /TP + /W3 + /c + /Zc:forScope + /nologo + /Oy- + /fp:fast ) # Nicky: x64 implies SSE2 diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 9b64bc6160..5a7c504af8 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -1,11 +1,11 @@ include(Linking) include(Prebuilt) -set(APR_FIND_QUIETLY ON) -set(APR_FIND_REQUIRED ON) +if( TARGET apr::apr ) + return() +endif() -set(APRUTIL_FIND_QUIETLY ON) -set(APRUTIL_FIND_REQUIRED ON) +create_target( apr::apr) if (USESYSTEMLIBS) include(FindAPR) @@ -17,18 +17,11 @@ else (USESYSTEMLIBS) else (LLCOMMON_LINK_SHARED) set(APR_selector "") endif (LLCOMMON_LINK_SHARED) - set(APR_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib - ) - set(APRICONV_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib - ) - set(APRUTIL_LIBRARIES - debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES} - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES} - ) + set_target_libraries( apr::apr + ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib + ) elseif (DARWIN) if (LLCOMMON_LINK_SHARED) set(APR_selector "0.dylib") @@ -37,18 +30,20 @@ else (USESYSTEMLIBS) set(APR_selector "a") set(APRUTIL_selector "a") endif (LLCOMMON_LINK_SHARED) - set(APR_LIBRARIES libapr-1.${APR_selector}) - set(APRUTIL_LIBRARIES libaprutil-1.${APRUTIL_selector}) - set(APRICONV_LIBRARIES iconv) + + set_target_libraries( apr::apr + libapr-1.${APR_selector} + libaprutil-1.${APRUTIL_selector} + iconv + ) else (WINDOWS) - set(APR_LIBRARIES apr-1) - set(APRUTIL_LIBRARIES aprutil-1) - set(APRICONV_LIBRARIES iconv) + set_target_libraries( apr::apr + apr-1 + aprutil-1 + iconv + uuid + rt + ) endif (WINDOWS) - set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1) - - if (LINUX) - list(APPEND APRUTIL_LIBRARIES uuid) - list(APPEND APRUTIL_LIBRARIES rt) - endif (LINUX) + set_target_include_dirs( apr::apr ${LIBS_PREBUILT_DIR}/include/apr-1 ) endif (USESYSTEMLIBS) diff --git a/indra/cmake/Atmosphere.cmake b/indra/cmake/Atmosphere.cmake deleted file mode 100644 index 9c14df2a11..0000000000 --- a/indra/cmake/Atmosphere.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) -use_prebuilt_binary(libatmosphere) -set(LIBATMOSPHERE_LIBRARIES atmosphere) -set(LIBATMOSPHERE_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/atmosphere) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index f95439245a..bc11e62de5 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -1,6 +1,11 @@ # -*- cmake -*- include(Prebuilt) +if(TARGET vorbis::vorbis) + return() +endif() +create_target(vorbis::vorbis) + if (USESYSTEMLIBS) include(FindPkgConfig) pkg_check_modules(OGG REQUIRED ogg) @@ -9,34 +14,12 @@ if (USESYSTEMLIBS) pkg_check_modules(VORBISFILE REQUIRED vorbisfile) else (USESYSTEMLIBS) use_prebuilt_binary(ogg_vorbis) - set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) - set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) - set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) + set_target_include_dirs( vorbis::vorbis ${LIBS_PREBUILT_DIR}/include ) if (WINDOWS) - set(OGG_LIBRARIES - optimized ogg_static - debug ogg_static_d) - set(VORBIS_LIBRARIES - optimized vorbis_static - debug vorbis_static_d) - set(VORBISENC_LIBRARIES - optimized vorbisenc_static - debug vorbisenc_static_d) - set(VORBISFILE_LIBRARIES - optimized vorbisfile_static - debug vorbisfile_static_d) + set_target_libraries(vorbis::vorbis ogg_static vorbis_static vorbisenc_static vorbisfile_static ) else (WINDOWS) - set(OGG_LIBRARIES ogg) - set(VORBIS_LIBRARIES vorbis) - set(VORBISENC_LIBRARIES vorbisenc) - set(VORBISFILE_LIBRARIES vorbisfile) + set_target_libraries(vorbis::vorbis ogg vorbis vorbisenc vorbisfile ) endif (WINDOWS) endif (USESYSTEMLIBS) -link_directories( - ${VORBIS_LIBRARY_DIRS} - ${VORBISENC_LIBRARY_DIRS} - ${VORBISFILE_LIBRARY_DIRS} - ${OGG_LIBRARY_DIRS} - ) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 0a61e33532..00bfedfb71 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -1,6 +1,11 @@ # -*- cmake -*- include(Prebuilt) +if( TARGET boost::boost ) + return() +endif() +create_target( boost::boost ) + set(Boost_FIND_QUIETLY ON) set(Boost_FIND_REQUIRED ON) @@ -24,80 +29,34 @@ else (USESYSTEMLIBS) set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) - set(BOOST_CONTEXT_LIBRARY - optimized libboost_context-mt${addrsfx} - debug libboost_context-mt${addrsfx}-gd) - set(BOOST_FIBER_LIBRARY - optimized libboost_fiber-mt${addrsfx} - debug libboost_fiber-mt${addrsfx}-gd) - set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-mt${addrsfx} - debug libboost_filesystem-mt${addrsfx}-gd) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized libboost_program_options-mt${addrsfx} - debug libboost_program_options-mt${addrsfx}-gd) - set(BOOST_REGEX_LIBRARY - optimized libboost_regex-mt${addrsfx} - debug libboost_regex-mt${addrsfx}-gd) - set(BOOST_SIGNALS_LIBRARY - optimized libboost_signals-mt${addrsfx} - debug libboost_signals-mt${addrsfx}-gd) - set(BOOST_SYSTEM_LIBRARY - optimized libboost_system-mt${addrsfx} - debug libboost_system-mt${addrsfx}-gd) - set(BOOST_THREAD_LIBRARY - optimized libboost_thread-mt${addrsfx} - debug libboost_thread-mt${addrsfx}-gd) + set_target_libraries( boost::boost + libboost_context-mt${addrsfx} + libboost_fiber-mt${addrsfx} + libboost_filesystem-mt${addrsfx} + libboost_program_options-mt${addrsfx} + libboost_regex-mt${addrsfx} + libboost_system-mt${addrsfx} + libboost_thread-mt${addrsfx}) elseif (LINUX) - set(BOOST_CONTEXT_LIBRARY - optimized boost_context-mt${addrsfx} - debug boost_context-mt${addrsfx}-d) - set(BOOST_FIBER_LIBRARY - optimized boost_fiber-mt${addrsfx} - debug boost_fiber-mt${addrsfx}-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt${addrsfx} - debug boost_filesystem-mt${addrsfx}-d) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized boost_program_options-mt${addrsfx} - debug boost_program_options-mt${addrsfx}-d) - set(BOOST_REGEX_LIBRARY - optimized boost_regex-mt${addrsfx} - debug boost_regex-mt${addrsfx}-d) - set(BOOST_SIGNALS_LIBRARY - optimized boost_signals-mt${addrsfx} - debug boost_signals-mt${addrsfx}-d) - set(BOOST_SYSTEM_LIBRARY - optimized boost_system-mt${addrsfx} - debug boost_system-mt${addrsfx}-d) - set(BOOST_THREAD_LIBRARY - optimized boost_thread-mt${addrsfx} - debug boost_thread-mt${addrsfx}-d) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_signals-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) elseif (DARWIN) - set(BOOST_CONTEXT_LIBRARY - optimized boost_context-mt${addrsfx} - debug boost_context-mt${addrsfx}-d) - set(BOOST_FIBER_LIBRARY - optimized boost_fiber-mt${addrsfx} - debug boost_fiber-mt${addrsfx}-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt${addrsfx} - debug boost_filesystem-mt${addrsfx}-d) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized boost_program_options-mt${addrsfx} - debug boost_program_options-mt${addrsfx}-d) - set(BOOST_REGEX_LIBRARY - optimized boost_regex-mt${addrsfx} - debug boost_regex-mt${addrsfx}-d) - set(BOOST_SIGNALS_LIBRARY - optimized boost_signals-mt${addrsfx} - debug boost_signals-mt${addrsfx}-d) - set(BOOST_SYSTEM_LIBRARY - optimized boost_system-mt${addrsfx} - debug boost_system-mt${addrsfx}-d) - set(BOOST_THREAD_LIBRARY - optimized boost_thread-mt${addrsfx} - debug boost_thread-mt${addrsfx}-d) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_signals-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) endif (WINDOWS) endif (USESYSTEMLIBS) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 7d8bfb1b0f..706730b226 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -2,18 +2,21 @@ include(Linking) include(Prebuilt) +if(TARGET cef::cef) + return() +endif() +create_target( cef::cef ) + if (USESYSTEMLIBS) set(CEFPLUGIN OFF CACHE BOOL "CEFPLUGIN support for the llplugin/llmedia test apps.") else (USESYSTEMLIBS) use_prebuilt_binary(dullahan) - set(CEFPLUGIN ON CACHE BOOL - "CEFPLUGIN support for the llplugin/llmedia test apps.") - set(CEF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/cef) + set_target_include_dirs( cef::cef ${LIBS_PREBUILT_DIR}/include/cef) endif (USESYSTEMLIBS) if (WINDOWS) - set(CEF_PLUGIN_LIBRARIES + set_target_libraries( cef::cef libcef.lib libcef_dll_wrapper.lib dullahan.lib @@ -29,7 +32,7 @@ elseif (DARWIN) message(FATAL_ERROR "CEF not found") endif() - set(CEF_PLUGIN_LIBRARIES + set_target_libraries( cef::cef ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a ${APPKIT_LIBRARY} diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 6778e90ca8..812e35390f 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -39,37 +39,22 @@ set(cmake_SOURCE_FILES GLEXT.cmake GLH.cmake GLOD.cmake -## GStreamer010Plugin.cmake GoogleMock.cmake Havok.cmake Hunspell.cmake - JPEG.cmake - JsonCpp.cmake + JsonCpp.cmake LLAddBuildTest.cmake LLAppearance.cmake LLAudio.cmake - LLCharacter.cmake LLCommon.cmake - LLCrashLogger.cmake LLImage.cmake - LLImageJ2COJ.cmake - LLInventory.cmake LLKDU.cmake - LLLogin.cmake - LLMath.cmake - LLMessage.cmake LLPhysicsExtensions.cmake - LLPlugin.cmake LLPrimitive.cmake - LLRender.cmake LLSharedLibs.cmake LLTestCommand.cmake - LLUI.cmake - LLFileSystem.cmake LLWindow.cmake - LLXML.cmake Linking.cmake - MediaPluginBase.cmake NDOF.cmake OPENAL.cmake OpenGL.cmake diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index 04afae594d..d91eb2e2fd 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -1,19 +1,19 @@ # -*- cmake -*- include(Prebuilt) -set(CURL_FIND_QUIETLY ON) -set(CURL_FIND_REQUIRED ON) +if( TARGET libcurl::libcurl ) + return() +endif() +create_target(libcurl::libcurl) if (USESYSTEMLIBS) include(FindCURL) else (USESYSTEMLIBS) use_prebuilt_binary(curl) if (WINDOWS) - set(CURL_LIBRARIES - debug libcurld.lib - optimized libcurl.lib) + set_target_libraries(libcurl::libcurl libcurl.lib) else (WINDOWS) - set(CURL_LIBRARIES libcurl.a) + set_target_libraries(libcurl::libcurl libcurl.a) endif (WINDOWS) - set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set_target_include_dirs( libcurl::libcurl ${LIBS_PREBUILT_DIR}/include) endif (USESYSTEMLIBS) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index cddc71b227..6f6503ca4d 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -1,23 +1,25 @@ # -*- cmake -*- include(Prebuilt) -set(EXPAT_FIND_QUIETLY ON) -set(EXPAT_FIND_REQUIRED ON) +if( TARGET expat::expat ) + return() +endif() +create_target( expat::expat INTERFACE IMPORTED ) if (USESYSTEMLIBS) include(FindEXPAT) else (USESYSTEMLIBS) use_prebuilt_binary(expat) if (WINDOWS) - set(EXPAT_LIBRARIES libexpatMT) + set_target_libraries( expat::expat libexpatMT ) set(EXPAT_COPY libexpatMT.dll) else (WINDOWS) - set(EXPAT_LIBRARIES expat) + set_target_libraries( expat::expat expat ) if (DARWIN) set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) else () set(EXPAT_COPY libexpat.so.1 libexpat.so) endif () endif (WINDOWS) - set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set_target_include_dirs( expat::expat ${LIBS_PREBUILT_DIR}/include ) endif (USESYSTEMLIBS) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 8840354ac6..e8699cdecd 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -8,9 +8,17 @@ if (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) if (FMODSTUDIO) + if( TARGET fmodstudio::fmodstudio ) + return() + endif() + create_target( fmodstudio::fmodstudio ) + set_target_include_dirs( openal::openal "${LIBS_PREBUILT_DIR}/include/AL") + if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If the path have been specified in the arguments, use that - set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY}) + + set_target_libraries(fmodstudio::fmodstudio ${FMODSTUDIO_LIBRARY}) + set_target_include_dirs(fmodstudio::fmodstudio ${FMODSTUDIO_INCLUDE_DIR}) else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If not, we're going to try to get the package listed in autobuild.xml # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) @@ -18,21 +26,15 @@ if (FMODSTUDIO) include(Prebuilt) use_prebuilt_binary(fmodstudio) if (WINDOWS) - set(FMODSTUDIO_LIBRARY - debug fmodL_vc - optimized fmod_vc) + set_target_libraries( fmodstudio::fmodstudio fmod_vc) elseif (DARWIN) #despite files being called libfmod.dylib, we are searching for fmod - set(FMODSTUDIO_LIBRARY - debug fmodL - optimized fmod) + set_target_libraries( fmodstudio::fmodstudio fmod) elseif (LINUX) - set(FMODSTUDIO_LIBRARY - debug fmodL - optimized fmod) + set_target_libraries( fmodstudio::fmodstudio fmod) endif (WINDOWS) - set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY}) - set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio) + + set_target_include_dirs(fmodstudio::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) endif (FMODSTUDIO) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index a36485f6d0..66f4ae0140 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,14 +1,18 @@ # -*- cmake -*- include(Prebuilt) +if( TARGET freetype::freetype ) + return() +endif() +create_target( freetype::freetype) + if (USESYSTEMLIBS) include(FindPkgConfig) pkg_check_modules(FREETYPE REQUIRED freetype2) else (USESYSTEMLIBS) use_prebuilt_binary(freetype) - set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2/) - set(FREETYPE_LIBRARIES freetype) + set_target_include_dirs( freetype::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) + set_target_libraries( freetype::freetype freetype ) endif (USESYSTEMLIBS) -link_directories(${FREETYPE_LIBRARY_DIRS}) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 6f42b44ab8..8d41db4ea3 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -1,11 +1,18 @@ # -*- cmake -*- include(Prebuilt) +if( TARGET glod::glod ) + return() +endif() +create_target( glod::glod ) + if (NOT USESYSTEMLIBS) use_prebuilt_binary(glod) endif (NOT USESYSTEMLIBS) + + set(GLODLIB ON CACHE BOOL "Using GLOD library") -set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) -set(GLOD_LIBRARIES GLOD) +set_target_include_dirs( glod::glod ${LIBS_PREBUILT_DIR}/include) +set_target_libraries( glod::glod GLOD ) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 06227b3fe2..970b06b81f 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -1,22 +1,24 @@ # -*- cmake -*- include(Prebuilt) -set(HUNSPELL_FIND_QUIETLY ON) -set(HUNSPELL_FIND_REQUIRED ON) +if( TARGET hunspell::hunspell ) + return() +endif() +create_target( hunspell::hunspell ) if (USESYSTEMLIBS) include(FindHUNSPELL) else (USESYSTEMLIBS) use_prebuilt_binary(libhunspell) if (WINDOWS) - set(HUNSPELL_LIBRARY libhunspell) + set_target_libraries( hunspell::hunspell libhunspell) elseif(DARWIN) - set(HUNSPELL_LIBRARY hunspell-1.3) + set_target_libraries( hunspell::hunspell hunspell-1.3) elseif(LINUX) - set(HUNSPELL_LIBRARY hunspell-1.3) + set_target_libraries( hunspell::hunspell hunspell-1.3) else() message(FATAL_ERROR "Invalid platform") endif() - set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell) + set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) endif (USESYSTEMLIBS) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index d6da22aecc..7245ca7b36 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -2,19 +2,22 @@ include(Prebuilt) include(Linking) -set(JPEG_FIND_QUIETLY ON) -set(JPEG_FIND_REQUIRED ON) + +if( TARGET jpeglib::jpeglib ) + return() +endif() +create_target(jpeglib::jpeglib) if (USESYSTEMLIBS) include(FindJPEG) else (USESYSTEMLIBS) use_prebuilt_binary(jpeglib) if (LINUX) - set(JPEG_LIBRARIES jpeg) + set_target_libraries( jpeglib::jpeglib jpeg) elseif (DARWIN) - set(JPEG_LIBRARIES jpeg) + set_target_libraries( jpeglib::jpeglib jpeg) elseif (WINDOWS) - set(JPEG_LIBRARIES jpeglib) + set_target_libraries( jpeglib::jpeglib jpeglib) endif (LINUX) - set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set_target_include_dirs( jpeglib::jpeglib ${LIBS_PREBUILT_DIR}/include) endif (USESYSTEMLIBS) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 079619adf8..14bfd32b6b 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -1,22 +1,21 @@ # -*- cmake -*- include(Prebuilt) - -set(JSONCPP_FIND_QUIETLY ON) -set(JSONCPP_FIND_REQUIRED ON) +if( TARGET jsoncpp::jsoncpp ) + return() +endif() +create_target( jsoncpp::jsoncpp) if (USESYSTEMLIBS) include(FindJsonCpp) else (USESYSTEMLIBS) use_prebuilt_binary(jsoncpp) if (WINDOWS) - set(JSONCPP_LIBRARIES - debug json_libmdd.lib - optimized json_libmd.lib) + set_target_libraries( jsoncpp::jsoncpp json_libmd.lib ) elseif (DARWIN) - set(JSONCPP_LIBRARIES libjson_darwin_libmt.a) + set_target_libraries( jsoncpp::jsoncpp libjson_darwin_libmt.a ) elseif (LINUX) - set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a) + set_target_libraries( jsoncpp::jsoncpp libjson_linux-gcc-4.1.3_libmt.a ) endif (WINDOWS) - set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json") + set_target_include_dirs( jsoncpp::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) endif (USESYSTEMLIBS) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 4937c2a9d7..6860b1f316 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -36,30 +36,29 @@ INCLUDE(GoogleMock) ) SET(alltest_DEP_TARGETS # needed by the test harness itself - ${APRUTIL_LIBRARIES} - ${APR_LIBRARIES} llcommon ) + + SET(alltest_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/test + ${GOOGLEMOCK_INCLUDE_DIRS} + ) + SET(alltest_LIBRARIES + llcommon + ${GOOGLEMOCK_LIBRARIES} + ${PTHREAD_LIBRARY} + ${WINDOWS_LIBRARIES} + ) IF(NOT "${project}" STREQUAL "llmath") # add llmath as a dep unless the tested module *is* llmath! LIST(APPEND alltest_DEP_TARGETS - llmath - ) + llmath + ) + LIST(APPEND alltest_LIBRARIES + llmath + ) ENDIF(NOT "${project}" STREQUAL "llmath") - SET(alltest_INCLUDE_DIRS - ${LLMATH_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LIBS_OPEN_DIR}/test - ${GOOGLEMOCK_INCLUDE_DIRS} - ) - SET(alltest_LIBRARIES - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - ${GOOGLEMOCK_LIBRARIES} - ${PTHREAD_LIBRARY} - ${WINDOWS_LIBRARIES} - ) + # Headers, for convenience in targets. SET(alltest_HEADER_FILES ${CMAKE_SOURCE_DIR}/test/test.h @@ -126,7 +125,8 @@ INCLUDE(GoogleMock) MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}") ENDIF(LL_TEST_VERBOSE) # Add to project - TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${alltest_DEP_TARGETS} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} ) + TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} ) + add_dependencies( PROJECT_${project}_TEST_${name} ${alltest_DEP_TARGETS}) # Compile-time Definitions GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS) SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} diff --git a/indra/cmake/LLAppearance.cmake b/indra/cmake/LLAppearance.cmake index 675330ec72..99399d349a 100644 --- a/indra/cmake/LLAppearance.cmake +++ b/indra/cmake/LLAppearance.cmake @@ -2,26 +2,14 @@ include(Variables) include(Boost) -include(LLMessage) include(LLCoreHttp) -set(LLAPPEARANCE_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llappearance - ) - if (BUILD_HEADLESS) set(LLAPPEARANCE_HEADLESS_LIBRARIES llappearanceheadless ) endif (BUILD_HEADLESS) -set(LLAPPEARANCE_LIBRARIES llappearance - llmessage - llcorehttp - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - ) diff --git a/indra/cmake/LLAudio.cmake b/indra/cmake/LLAudio.cmake index 7c248dfc72..c842c69bfe 100644 --- a/indra/cmake/LLAudio.cmake +++ b/indra/cmake/LLAudio.cmake @@ -1,10 +1,3 @@ # -*- cmake -*- include(Audio) - -set(LLAUDIO_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llaudio - ) - -# be exhaustive here -set(LLAUDIO_LIBRARIES llaudio ${VORBISFILE_LIBRARIES} ${VORBIS_LIBRARIES} ${VORBISENC_LIBRARIES} ${OGG_LIBRARIES} ${OPENAL_LIBRARIES}) diff --git a/indra/cmake/LLCharacter.cmake b/indra/cmake/LLCharacter.cmake deleted file mode 100644 index 9b2f5c4956..0000000000 --- a/indra/cmake/LLCharacter.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLCHARACTER_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llcharacter - ) - -set(LLCHARACTER_LIBRARIES llcharacter) diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 9c8740793a..6d2468695f 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -4,36 +4,5 @@ include(APR) include(Boost) include(EXPAT) include(ZLIBNG) - -set(LLCOMMON_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llcommon - ${APRUTIL_INCLUDE_DIR} - ${APR_INCLUDE_DIR} - ) -set(LLCOMMON_SYSTEM_INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} - ) - -if (LINUX) - # In order to support using ld.gold on linux, we need to explicitely - # specify all libraries that llcommon uses. - # llcommon uses `clock_gettime' which is provided by librt on linux. - set(LLCOMMON_LIBRARIES llcommon - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - rt - ) -else (LINUX) - set(LLCOMMON_LIBRARIES llcommon - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} ) -endif (LINUX) - -set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a static library.") -if(LLCOMMON_LINK_SHARED) - add_definitions(-DLL_COMMON_LINK_SHARED=1) -endif(LLCOMMON_LINK_SHARED) +include(JsonCpp) +include(XmlRpcEpi) \ No newline at end of file diff --git a/indra/cmake/LLCoreHttp.cmake b/indra/cmake/LLCoreHttp.cmake index 613453ab5d..a166c96043 100644 --- a/indra/cmake/LLCoreHttp.cmake +++ b/indra/cmake/LLCoreHttp.cmake @@ -2,16 +2,4 @@ include(CURL) include(OpenSSL) -include(Boost) - -set(LLCOREHTTP_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llcorehttp - ${CURL_INCLUDE_DIRS} - ${OPENSSL_INCLUDE_DIRS} - ${BOOST_INCLUDE_DIRS} - ) - -set(LLCOREHTTP_LIBRARIES llcorehttp - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY}) +include(NGHTTP2) \ No newline at end of file diff --git a/indra/cmake/LLCrashLogger.cmake b/indra/cmake/LLCrashLogger.cmake deleted file mode 100644 index f2cb83eb8b..0000000000 --- a/indra/cmake/LLCrashLogger.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLCRASHLOGGER_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llcrashlogger - ) - -set(LLCRASHLOGGER_LIBRARIES llcrashlogger) diff --git a/indra/cmake/LLFileSystem.cmake b/indra/cmake/LLFileSystem.cmake deleted file mode 100644 index 2e6c42c30c..0000000000 --- a/indra/cmake/LLFileSystem.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLFILESYSTEM_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llfilesystem - ) - -set(LLFILESYSTEM_LIBRARIES llfilesystem) diff --git a/indra/cmake/LLImage.cmake b/indra/cmake/LLImage.cmake index ec3da89081..8e0b44dfe4 100644 --- a/indra/cmake/LLImage.cmake +++ b/indra/cmake/LLImage.cmake @@ -1,11 +1,4 @@ # -*- cmake -*- -include(JPEG) +#include(JPEG) include(PNG) - -set(LLIMAGE_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llimage - ${JPEG_INCLUDE_DIRS} - ) - -set(LLIMAGE_LIBRARIES llimage) diff --git a/indra/cmake/LLImageJ2COJ.cmake b/indra/cmake/LLImageJ2COJ.cmake deleted file mode 100644 index 1bcf205f2d..0000000000 --- a/indra/cmake/LLImageJ2COJ.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# -*- cmake -*- - -include(OpenJPEG) - -set(LLIMAGEJ2COJ_LIBRARIES llimagej2coj) diff --git a/indra/cmake/LLInventory.cmake b/indra/cmake/LLInventory.cmake deleted file mode 100644 index c3dc077a2b..0000000000 --- a/indra/cmake/LLInventory.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLINVENTORY_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llinventory - ) - -set(LLINVENTORY_LIBRARIES llinventory) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index e478b01f84..25762ab066 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -7,15 +7,23 @@ if (INSTALL_PROPRIETARY) set(USE_KDU ON CACHE BOOL "Use Kakadu library.") endif (INSTALL_PROPRIETARY) +if( TARGET kdu::kdu ) + return() +endif() +create_target( kdu::kdu ) + if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - set(KDU_LIBRARY kdu.lib) + set_target_libraries( kdu::kdu kdu.lib) else (WINDOWS) - set(KDU_LIBRARY libkdu.a) + set_target_libraries( kdu::kdu libkdu.a) endif (WINDOWS) - set(KDU_INCLUDE_DIR ${AUTOBUILD_INSTALL_DIR}/include/kdu) - set(LLKDU_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llkdu) - set(LLKDU_LIBRARIES llkdu) + set_target_libraries( kdu::kdu kdu.lib) + + set_target_include_dirs( kdu::kdu + ${AUTOBUILD_INSTALL_DIR}/include/kdu + ${LIBS_OPEN_DIR}/llkdu + ) endif (USE_KDU) diff --git a/indra/cmake/LLLogin.cmake b/indra/cmake/LLLogin.cmake deleted file mode 100644 index 47d171876a..0000000000 --- a/indra/cmake/LLLogin.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLLOGIN_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/viewer_components/login - ) - -set(LLLOGIN_LIBRARIES lllogin) diff --git a/indra/cmake/LLMessage.cmake b/indra/cmake/LLMessage.cmake deleted file mode 100644 index 7be53ec0ec..0000000000 --- a/indra/cmake/LLMessage.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# -*- cmake -*- - -include(CURL) -include(OpenSSL) -include(XmlRpcEpi) - -set(LLMESSAGE_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llmessage - ${CURL_INCLUDE_DIRS} - ${OPENSSL_INCLUDE_DIRS} - ) - -set(LLMESSAGE_LIBRARIES llmessage) diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index e6afee762e..c46a04129a 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -10,6 +10,11 @@ if (INSTALL_PROPRIETARY) set(HAVOK ON CACHE BOOL "Use Havok physics library") endif (INSTALL_PROPRIETARY) +if(TARGET llphysicsextensions ) + return() +endif() +create_target(llphysicsextensions) + # Note that the use_prebuilt_binary macros below do not in fact include binaries; # the llphysicsextensions_* packages are source only and are built here. @@ -19,17 +24,14 @@ if (HAVOK) include(Havok) use_prebuilt_binary(llphysicsextensions_source) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src) - set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensions) - + set_target_libraries( llphysicsextensions llphysicsextensions) elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) - set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensions_tpv) - + set_target_libraries( llphysicsextensions llphysicsextensions_tpv) else (HAVOK) use_prebuilt_binary(llphysicsextensions_stub) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) - set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensionsstub) - + set_target_libraries( llphysicsextensions llphysicsextensionsstub) endif (HAVOK) -set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) +set_target_include_dirs(llphysicsextensions ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) diff --git a/indra/cmake/LLPlugin.cmake b/indra/cmake/LLPlugin.cmake deleted file mode 100644 index 399cb332dd..0000000000 --- a/indra/cmake/LLPlugin.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -*- cmake -*- - - -set(LLPLUGIN_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llplugin - ) - -if (LINUX) - # In order to support using ld.gold on linux, we need to explicitely - # specify all libraries that llplugin uses. - set(LLPLUGIN_LIBRARIES llplugin pthread) -else (LINUX) - set(LLPLUGIN_LIBRARIES llplugin) -endif (LINUX) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 4e34951215..799afc77d1 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -4,49 +4,41 @@ include(Prebuilt) include(Boost) +if( TARGET colladadom::colladadom ) + return() +endif() + use_prebuilt_binary(colladadom) use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(pcre) use_prebuilt_binary(libxml2) -set(LLPRIMITIVE_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llprimitive - ) +create_target( pcre::pcre ) +set_target_libraries( pcre::pcre pcrecpp pcre ) + +create_target( minizip-ng::minizip-ng ) if (WINDOWS) - set(LLPRIMITIVE_LIBRARIES - debug llprimitive - optimized llprimitive - debug libcollada14dom23-sd - optimized libcollada14dom23-s - libxml2_a - debug pcrecppd - optimized pcrecpp - debug pcred - optimized pcre - debug libminizip - optimized libminizip - ${BOOST_SYSTEM_LIBRARIES} + set_target_libraries( minizip-ng::minizip-ng libminizip ) +else() + set_target_libraries( minizip-ng::minizip-ng minizip ) +endif() + +create_target( libxml::libxml ) +if (WINDOWS) + set_target_libraries( libxml::libxml libxml2_a) +else() + set_target_libraries( libxml::libxml xml2) +endif() + +create_target( colladadom::colladadom ) +set_target_include_dirs( colladadom::colladadom + ${LIBS_PREBUILT_DIR}/include/collada + ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) +if (WINDOWS) + set_target_libraries(colladadom::colladadom libcollada14dom23-s libxml::libxml minizip-ng::minizip-ng ) elseif (DARWIN) - set(LLPRIMITIVE_LIBRARIES - llprimitive - debug collada14dom-d - optimized collada14dom - minizip # for collada libminizip.a - xml2 - pcrecpp - pcre - iconv # Required by libxml2 - ) + set_target_libraries(colladadom::colladadom collada14dom libxml::libxml minizip-ng::minizip-ng) elseif (LINUX) - set(LLPRIMITIVE_LIBRARIES - llprimitive - debug collada14dom-d - optimized collada14dom - minizip - xml2 - pcrecpp - pcre - ) -endif (WINDOWS) - + set_target_libraries(colladadom::colladadom collada14dom libxml::libxml minizip-ng::minizip-ng) +endif() \ No newline at end of file diff --git a/indra/cmake/LLRender.cmake b/indra/cmake/LLRender.cmake deleted file mode 100644 index 868922451f..0000000000 --- a/indra/cmake/LLRender.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# -*- cmake -*- - -include(Variables) -include(FreeType) -include(GLH) - -set(LLRENDER_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llrender - ${GLH_INCLUDE_DIR} - ) - -if (BUILD_HEADLESS) - set(LLRENDER_HEADLESS_LIBRARIES - llrenderheadless - ) -endif (BUILD_HEADLESS) -set(LLRENDER_LIBRARIES - llrender - ) - diff --git a/indra/cmake/LLUI.cmake b/indra/cmake/LLUI.cmake deleted file mode 100644 index 34de57108b..0000000000 --- a/indra/cmake/LLUI.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLUI_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llui - ) - -set(LLUI_LIBRARIES llui) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 80af7ff2ab..ac14ead0de 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -26,17 +26,5 @@ if (SDL_FOUND) include_directories(${SDL_INCLUDE_DIR}) endif (SDL_FOUND) -set(LLWINDOW_INCLUDE_DIRS - ${GLEXT_INCLUDE_DIR} - ${LIBS_OPEN_DIR}/llwindow - ) -if (BUILD_HEADLESS) - set(LLWINDOW_HEADLESS_LIBRARIES - llwindowheadless - ) -endif (BUILD_HEADLESS) - set(LLWINDOW_LIBRARIES - llwindow - ) diff --git a/indra/cmake/LLXML.cmake b/indra/cmake/LLXML.cmake deleted file mode 100644 index b093c76297..0000000000 --- a/indra/cmake/LLXML.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -*- cmake -*- - -include(Boost) -include(EXPAT) - -set(LLXML_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llxml - ${EXPAT_INCLUDE_DIRS} - ) -set(LLXML_SYSTEM_INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} - ) - -set(LLXML_LIBRARIES llxml) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index df829b615a..a7acd64d62 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -2,6 +2,11 @@ include(Linking) include(Prebuilt) +if( TARGET libvlc::libvlc ) + return() +endif() +create_target( libvlc::libvlc ) + if (USESYSTEMLIBS) set(LIBVLCPLUGIN OFF CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") @@ -13,18 +18,18 @@ else (USESYSTEMLIBS) endif (USESYSTEMLIBS) if (WINDOWS) - set(VLC_PLUGIN_LIBRARIES - libvlc.lib - libvlccore.lib + set_target_libraries( libvlc::libvlc + libvlc.lib + libvlccore.lib ) elseif (DARWIN) - set(VLC_PLUGIN_LIBRARIES - libvlc.dylib + set_target_libraries( libvlc::libvlc +`` libvlc.dylib libvlccore.dylib ) elseif (LINUX) # Specify a full path to make sure we get a static link - set(VLC_PLUGIN_LIBRARIES + set_target_libraries( liblvc::libvlc ${LIBS_PREBUILT_DIR}/lib/libvlc.a ${LIBS_PREBUILT_DIR}/lib/libvlccore.a ) diff --git a/indra/cmake/MediaPluginBase.cmake b/indra/cmake/MediaPluginBase.cmake deleted file mode 100644 index 2be035b641..0000000000 --- a/indra/cmake/MediaPluginBase.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# -*- cmake -*- - - -set(MEDIA_PLUGIN_BASE_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/media_plugins/base/ - ) - -set(MEDIA_PLUGIN_BASE_LIBRARIES media_plugin_base) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 388df16a52..f22e2246aa 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -3,6 +3,11 @@ include(Prebuilt) set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.") +if ( TARGET ndof::ndof ) + return() +endif() +create_target( ndof::ndof ) + if (NDOF) if (USESYSTEMLIBS) set(NDOF_FIND_REQUIRED ON) @@ -15,22 +20,17 @@ if (NDOF) endif (WINDOWS OR DARWIN) if (WINDOWS) - set(NDOF_LIBRARY libndofdev) + set_target_libraries( ndof::ndof libndofdev) elseif (DARWIN OR LINUX) - set(NDOF_LIBRARY ndofdev) + set_target_libraries( ndof::ndof ndofdev) endif (WINDOWS) - - set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev) set(NDOF_FOUND 1) endif (USESYSTEMLIBS) endif (NDOF) if (NDOF_FOUND) add_definitions(-DLIB_NDOF=1) - include_directories(${NDOF_INCLUDE_DIR}) else (NDOF_FOUND) message(STATUS "Building without N-DoF joystick support") - set(NDOF_INCLUDE_DIR "") - set(NDOF_LIBRARY "") endif (NDOF_FOUND) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index df191ff3c1..5215af5dd9 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -1,20 +1,20 @@ include(Prebuilt) -set(NGHTTP2_FIND_QUIETLY ON) -set(NGHTTP2_FIND_REQUIRED ON) +if( TARGET nghttp2::nghttp2 ) + return() +endif() +create_target( nghttp2::nghttp2 ) if (USESYSTEMLIBS) include(FindNGHTTP2) else (USESYSTEMLIBS) use_prebuilt_binary(nghttp2) if (WINDOWS) - set(NGHTTP2_LIBRARIES - ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib - ) + set_target_libraries( nghttp2::nghttp2 ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) elseif (DARWIN) - set(NGHTTP2_LIBRARIES libnghttp2.dylib) + set_target_libraries( nghttp2::nghttp2 libnghttp2.dylib) else (WINDOWS) - set(NGHTTP2_LIBRARIES libnghttp2.a) + set_target_libraries( nghttp2::nghttp2 libnghttp2.a ) endif (WINDOWS) - set(NGHTTP2_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/nghttp2) + set_target_include_dirs( nghttp2::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) endif (USESYSTEMLIBS) diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index 105f442a30..1eea96784f 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -5,8 +5,9 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) + create_target( nvapi::nvapi ) + set_target_libraries( nvapi::nvapi nvapi) use_prebuilt_binary(nvapi) - set(NVAPI_LIBRARY nvapi) else (WINDOWS) set(NVAPI_LIBRARY "") endif (WINDOWS) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 1bbfff6f98..ab2d258a12 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -9,7 +9,12 @@ else (LINUX) endif (LINUX) if (OPENAL) - set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL") + if( TARGET openal::openal ) + return() + endif() + create_target( openal::openal ) + set_target_include_dirs( openal::openal "${LIBS_PREBUILT_DIR}/include/AL") + if (USESYSTEMLIBS) include(FindPkgConfig) include(FindOpenAL) @@ -18,13 +23,14 @@ if (OPENAL) else (USESYSTEMLIBS) use_prebuilt_binary(openal) endif (USESYSTEMLIBS) + if(WINDOWS) - set(OPENAL_LIBRARIES + set_target_libraries( openal::openal OpenAL32 alut ) else() - set(OPENAL_LIBRARIES + set_target_libraries( openal::openal openal alut ) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index bf0bde2ba7..67292250bb 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -1,22 +1,16 @@ # -*- cmake -*- include(Prebuilt) -set(OPENJPEG_FIND_QUIETLY ON) -set(OPENJPEG_FIND_REQUIRED ON) +if( TARGET openjpeg::openjpeg ) + return() +endif() +create_target( openjpeg::openjpeg ) if (USESYSTEMLIBS) include(FindOpenJPEG) else (USESYSTEMLIBS) use_prebuilt_binary(openjpeg) - if(WINDOWS) - # Windows has differently named release and debug openjpeg(d) libs. - set(OPENJPEG_LIBRARIES - debug openjpegd - optimized openjpeg) - else(WINDOWS) - set(OPENJPEG_LIBRARIES openjpeg) - endif(WINDOWS) - - set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) + set_target_libraries(openjpeg::openjpeg openjpeg ) + set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) endif (USESYSTEMLIBS) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 32400f5e4e..80b419c36e 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -1,23 +1,22 @@ # -*- cmake -*- include(Prebuilt) -set(OpenSSL_FIND_QUIETLY ON) -set(OpenSSL_FIND_REQUIRED ON) +if( TARGET openssl::openssl ) + return() +endif() +create_target(openssl::openssl) if (USESYSTEMLIBS) include(FindOpenSSL) else (USESYSTEMLIBS) use_prebuilt_binary(openssl) if (WINDOWS) - set(OPENSSL_LIBRARIES libssl libcrypto) - else (WINDOWS) - set(OPENSSL_LIBRARIES ssl crypto) + set_target_libraries(openssl::openssl libssl libcrypto) + elseif (LINUX) + set_target_libraries(openssl::openssl ssl crypto dl) + else() + set_target_libraries(openssl::openssl ssl crypto) endif (WINDOWS) - set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set_target_include_dirs(openssl::openssl ${LIBS_PREBUILT_DIR}/include) endif (USESYSTEMLIBS) -if (LINUX) - set(CRYPTO_LIBRARIES crypto dl) -elseif (DARWIN) - set(CRYPTO_LIBRARIES crypto) -endif (LINUX) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 248a875a19..54b2438425 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -1,6 +1,11 @@ # -*- cmake -*- include(Prebuilt) +if( TARGET libpng::libpng ) + return() +endif() +create_target(libpng::libpng) + set(PNG_FIND_QUIETLY ON) set(PNG_FIND_REQUIRED ON) @@ -9,26 +14,9 @@ if (USESYSTEMLIBS) else (USESYSTEMLIBS) use_prebuilt_binary(libpng) if (WINDOWS) - set(PNG_LIBRARIES libpng16) - set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16) - elseif(DARWIN) - set(PNG_LIBRARIES png16) - set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16) + set_target_libraries(libpng::libpng libpng16) else() - # - # When we have updated static libraries in competition with older - # shared libraries and we want the former to win, we need to do some - # extra work. The *_PRELOAD_ARCHIVES settings are invoked early - # and will pull in the entire archive to the binary giving it - # priority in symbol resolution. Beware of cmake moving the - # achive load itself to another place on the link command line. If - # that happens, you can try something like -Wl,-lpng16 here to hide - # the archive. Also be aware that the linker will not tolerate a - # second whole-archive load of the archive. See viewer's - # CMakeLists.txt for more information. - # - set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive) set(PNG_LIBRARIES png16) - set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16) endif() + set_target_include_dirs( libpng::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) endif (USESYSTEMLIBS) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 33a6d76916..9125f2f80f 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -61,4 +61,15 @@ macro (use_prebuilt_binary _binary) endif (NOT USESYSTEMLIBS_${_binary}) endmacro (use_prebuilt_binary _binary) +function( create_target name ) + add_library( ${name} INTERFACE IMPORTED ) +endfunction() +function( set_target_libraries target ) + set_property( TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES ${ARGN} ) +endfunction() +function( set_target_include_dirs target) + set_property( TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ARGN} ) +endfunction() + + endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index ecc5b74ef1..55b38fca28 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -1,7 +1,9 @@ # -*- cmake -*- -set(URIPARSER_FIND_QUIETLY ON) -set(URIPARSER_FIND_REQUIRED ON) +if( TARGET uriparser::uriparser ) + return() +endif() +create_target( uriparser::uriparser ) include(Prebuilt) @@ -10,26 +12,11 @@ if (USESYSTEMLIBS) else (USESYSTEMLIBS) use_prebuilt_binary(uriparser) if (WINDOWS) - set(URIPARSER_LIBRARIES - debug uriparserd - optimized uriparser) + set_target_libraries( uriparser::uriparser uriparser) elseif (LINUX) - # - # When we have updated static libraries in competition with older - # shared libraries and we want the former to win, we need to do some - # extra work. The *_PRELOAD_ARCHIVES settings are invoked early - # and will pull in the entire archive to the binary giving it. - # priority in symbol resolution. Beware of cmake moving the - # achive load itself to another place on the link command line. If - # that happens, you can try something like -Wl,-luriparser here to hide - # the archive. Also be aware that the linker will not tolerate a - # second whole-archive load of the archive. See viewer's - # CMakeLists.txt for more information. - # - set(URIPARSER_PRELOAD_ARCHIVES -Wl,--whole-archive uriparser -Wl,--no-whole-archive) - set(URIPARSER_LIBRARIES uriparser) + set_target_libraries( uriparser::uriparser uriparser) elseif (DARWIN) - set(URIPARSER_LIBRARIES liburiparser.dylib) + set_target_libraries( uriparser::uriparser liburiparser.dylib) endif (WINDOWS) - set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser) + set_target_include_dirs( uriparser::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) endif (USESYSTEMLIBS) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 8c3790ea89..75b94acc50 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -1,20 +1,15 @@ # -*- cmake -*- include(Prebuilt) -set(XMLRPCEPI_FIND_QUIETLY ON) -set(XMLRPCEPI_FIND_REQUIRED ON) +if( TARGET xmlrpc-epi::xmlrpc-epi ) + return() +endif() +create_target( xmlrpc-epi::xmlrpc-epi ) if (USESYSTEMLIBS) include(FindXmlRpcEpi) else (USESYSTEMLIBS) use_prebuilt_binary(xmlrpc-epi) - if (WINDOWS) - set(XMLRPCEPI_LIBRARIES - debug xmlrpc-epid - optimized xmlrpc-epi - ) - else (WINDOWS) - set(XMLRPCEPI_LIBRARIES xmlrpc-epi) - endif (WINDOWS) - set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set_target_libraries(xmlrpc-epi::xmlrpc-epi xmlrpc-epi ) + set_target_include_dirs( xmlrpc-epi::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) endif (USESYSTEMLIBS) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 1f46a23d92..5aaca60664 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -1,35 +1,20 @@ # -*- cmake -*- -set(ZLIBNG_FIND_QUIETLY ON) -set(ZLIBNG_FIND_REQUIRED ON) - include(Prebuilt) +if( TARGET zlib-ng::zlib-ng ) + return() +endif() +create_target(zlib-ng::zlib-ng) + if (USESYSTEMLIBS) include(FindZLIBNG) else (USESYSTEMLIBS) use_prebuilt_binary(zlib-ng) if (WINDOWS) - set(ZLIBNG_LIBRARIES - debug zlib - optimized zlib) - elseif (LINUX) - # - # When we have updated static libraries in competition with older - # shared libraries and we want the former to win, we need to do some - # extra work. The *_PRELOAD_ARCHIVES settings are invoked early - # and will pull in the entire archive to the binary giving it - # priority in symbol resolution. Beware of cmake moving the - # achive load itself to another place on the link command line. If - # that happens, you can try something like -Wl,-lz here to hide - # the archive. Also be aware that the linker will not tolerate a - # second whole-archive load of the archive. See viewer's - # CMakeLists.txt for more information. - # - set(ZLIBNG_PRELOAD_ARCHIVES -Wl,--whole-archive z -Wl,--no-whole-archive) - set(ZLIBNG_LIBRARIES z) - elseif (DARWIN) - set(ZLIBNG_LIBRARIES z) + set_target_libraries( zlib-ng::zlib-ng zlib ) + else() + set_target_libraries( zlib-ng::zlib-ng z ) endif (WINDOWS) - set(ZLIBNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib-ng) + set_target_include_dirs( zlib-ng::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) endif (USESYSTEMLIBS) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 4edc4c59cd..ded109f9f1 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -10,28 +10,30 @@ else (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) if (USE_BUGSPLAT) + create_target(bugsplat::bugsplat) if (NOT USESYSTEMLIBS) include(Prebuilt) use_prebuilt_binary(bugsplat) if (WINDOWS) - set(BUGSPLAT_LIBRARIES + set_target_libraries( bugsplat::bugsplat ${ARCH_PREBUILT_DIRS_RELEASE}/bugsplat.lib ) elseif (DARWIN) find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") + set_target_libraries( bugsplat::bugsplat + ${BUGSPLAT_LIBRARIES} + ) else (WINDOWS) message(FATAL_ERROR "BugSplat is not supported; add -DUSE_BUGSPLAT=OFF") endif (WINDOWS) else (NOT USESYSTEMLIBS) - set(BUGSPLAT_FIND_QUIETLY ON) - set(BUGSPLAT_FIND_REQUIRED ON) include(FindBUGSPLAT) endif (NOT USESYSTEMLIBS) set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") - set(BUGSPLAT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/bugsplat) + set_target_include_dirs( bugsplat::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) set(BUGSPLAT_DEFINE "LL_BUGSPLAT") endif (USE_BUGSPLAT) -- cgit v1.2.3 From 495b35032ce5616cfe99f0fcb58c8963a7454929 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:22:13 +0200 Subject: Remove erroneous lines. --- indra/cmake/FMODSTUDIO.cmake | 1 - indra/cmake/LLKDU.cmake | 1 - 2 files changed, 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index e8699cdecd..41a75741c9 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -12,7 +12,6 @@ if (FMODSTUDIO) return() endif() create_target( fmodstudio::fmodstudio ) - set_target_include_dirs( openal::openal "${LIBS_PREBUILT_DIR}/include/AL") if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If the path have been specified in the arguments, use that diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 25762ab066..a0463be635 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -20,7 +20,6 @@ if (USE_KDU) else (WINDOWS) set_target_libraries( kdu::kdu libkdu.a) endif (WINDOWS) - set_target_libraries( kdu::kdu kdu.lib) set_target_include_dirs( kdu::kdu ${AUTOBUILD_INSTALL_DIR}/include/kdu -- cgit v1.2.3 From 5f7c74fa2e796c04915b6da5e7db013a94c00e2d Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:25:49 +0200 Subject: Create and use sdl::sdl target --- indra/cmake/LLWindow.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index ac14ead0de..d0dca3dfdd 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -4,6 +4,11 @@ include(Variables) include(GLEXT) include(Prebuilt) +if( TARGET sdl::sdl) + return() +endif() +create_target(sdl::sdl) + if (USESYSTEMLIBS) include(FindSDL) @@ -16,15 +21,10 @@ if (USESYSTEMLIBS) else (USESYSTEMLIBS) if (LINUX) use_prebuilt_binary(SDL) - set (SDL_FOUND TRUE) - set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux) - set (SDL_LIBRARY SDL directfb fusion direct X11) + set_target_include_dirs( sdl::sdl ${LIBS_PREBUILT_DIR}/i686-linux) + set_target_libraries( sdl::sdl SDL directfb fusion direct X11) + target_compile_definitions( sdl::sdl INTERFACE LL_SDL=1) endif (LINUX) endif (USESYSTEMLIBS) -if (SDL_FOUND) - include_directories(${SDL_INCLUDE_DIR}) -endif (SDL_FOUND) - - -- cgit v1.2.3 From f6a5b2496dae96e6e0af4ae073433c7e8f413536 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:26:37 +0200 Subject: Create and use bugsplat target --- indra/cmake/bugsplat.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index ded109f9f1..a74518354d 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -9,8 +9,12 @@ else (INSTALL_PROPRIETARY) set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") endif (INSTALL_PROPRIETARY) +if( TARGET bugsplat::bugsplat) + return() +endif() +create_target(bugsplat::bugsplat) + if (USE_BUGSPLAT) - create_target(bugsplat::bugsplat) if (NOT USESYSTEMLIBS) include(Prebuilt) use_prebuilt_binary(bugsplat) @@ -34,6 +38,6 @@ if (USE_BUGSPLAT) set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") set_target_include_dirs( bugsplat::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) - set(BUGSPLAT_DEFINE "LL_BUGSPLAT") + target_compile_definitions( bugsplat::bugsplat INTERFACE LL_BUGSPLAT) endif (USE_BUGSPLAT) -- cgit v1.2.3 From e98a6b52ee5309715b5a3353d63cbb3ea2c8d8db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:35:51 +0200 Subject: Remove boost_signals, it is not included in the 3p package. --- indra/cmake/Boost.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 00bfedfb71..8e5ef66af8 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -54,7 +54,6 @@ else (USESYSTEMLIBS) boost_filesystem-mt${addrsfx} boost_program_options-mt${addrsfx} boost_regex-mt${addrsfx} - boost_signals-mt${addrsfx} boost_system-mt${addrsfx} boost_thread-mt${addrsfx}) endif (WINDOWS) -- cgit v1.2.3 From dae6c3d2bf73a8f49d088682fed86409c5544f63 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:36:42 +0200 Subject: Remove erroneous characters. --- indra/cmake/LibVLCPlugin.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index a7acd64d62..2adedbfae3 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -24,8 +24,8 @@ if (WINDOWS) ) elseif (DARWIN) set_target_libraries( libvlc::libvlc -`` libvlc.dylib - libvlccore.dylib + libvlc.dylib + libvlccore.dylib ) elseif (LINUX) # Specify a full path to make sure we get a static link -- cgit v1.2.3 From be71a255a0831b865bdd6a1a2c8b86ac710fd379 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:37:09 +0200 Subject: Set PNG link targets for OSX and Linux --- indra/cmake/PNG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 54b2438425..cf338ebe5e 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -16,7 +16,7 @@ else (USESYSTEMLIBS) if (WINDOWS) set_target_libraries(libpng::libpng libpng16) else() - set(PNG_LIBRARIES png16) + set_target_libraries(libpng::libpng png16 ) endif() set_target_include_dirs( libpng::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) endif (USESYSTEMLIBS) -- cgit v1.2.3 From d1b6a52fefb483ab75ec60e379d37bfd2e6aff90 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:38:38 +0200 Subject: Googlemock target --- indra/cmake/GoogleMock.cmake | 29 +++++++++++++++-------------- indra/cmake/LLAddBuildTest.cmake | 15 ++++++--------- 2 files changed, 21 insertions(+), 23 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 5a00546927..58975df62e 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -4,25 +4,26 @@ include(Linking) use_prebuilt_binary(googlemock) -set(GOOGLEMOCK_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include) +if( TARGET googlemock::googlemock ) + return() +endif() +create_target( googlemock::googlemock ) +set_target_include_dirs( googlemock::googlemock + ${LIBS_PREBUILT_DIR}/include + ) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set(GOOGLEMOCK_LIBRARIES - gmock -Wl,--no-as-needed - gtest -Wl,--as-needed) + set_target_libraries( googlemock::googlemock gmock gtest) elseif(WINDOWS) - set(GOOGLEMOCK_LIBRARIES - gmock) - set(GOOGLEMOCK_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include/gmock - ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1) + set_target_libraries( googlemock::googlemock gmock) + set_target_include_dirs( googlemock::googlemock + ${LIBS_PREBUILT_DIR}/include + ${LIBS_PREBUILT_DIR}/include/gmock + ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1 ) + elseif(DARWIN) - set(GOOGLEMOCK_LIBRARIES - gmock - gtest) + set_target_libraries( googlemock::googlemock gmock gtest) endif(LINUX) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 6860b1f316..1a8003ea7f 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -45,7 +45,7 @@ INCLUDE(GoogleMock) ) SET(alltest_LIBRARIES llcommon - ${GOOGLEMOCK_LIBRARIES} + googlemock::googlemock ${PTHREAD_LIBRARY} ${WINDOWS_LIBRARIES} ) @@ -206,14 +206,11 @@ FUNCTION(LL_ADD_INTEGRATION_TEST ) SET(libraries - ${LEGACY_STDIO_LIBS} - ${library_dependencies} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - ${GOOGLEMOCK_LIBRARIES} - ${PTHREAD_LIBRARY} - ) + ${LEGACY_STDIO_LIBS} + ${library_dependencies} + googlemock::googlemock + ${PTHREAD_LIBRARY} + ) # Add test executable build target if(TEST_DEBUG) -- cgit v1.2.3 From 248b6a25841fd2ceb07e04cb532b64b4238da83c Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 23:28:33 +0200 Subject: Don't bother with debug builds,, they are long deprecated. --- indra/cmake/00-Common.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 45c81b1b30..e8c956bce3 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -42,9 +42,8 @@ if(NON_RELEASE_CRASH_REPORTING) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1") endif() -# Don't bother with a MinSizeRel build. -set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING - "Supported build types." FORCE) +# Don't bother with a MinSizeRel or Debug build. +set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING "Supported build types." FORCE) # Platform-specific compilation flags. -- cgit v1.2.3 From e447e0231273f9621f50bb447770e31acaa378dd Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 23:29:26 +0200 Subject: CMake 3.8.0 compatibility --- indra/cmake/bugsplat.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index a74518354d..820ca8652c 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -38,6 +38,6 @@ if (USE_BUGSPLAT) set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") set_target_include_dirs( bugsplat::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) - target_compile_definitions( bugsplat::bugsplat INTERFACE LL_BUGSPLAT) + set_property( TARGET bugsplat::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) endif (USE_BUGSPLAT) -- cgit v1.2.3 From 3bcb7fcc716d98a61d77477243cc3a73722ac75f Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 23:29:46 +0200 Subject: Remove noexistant include directory --- indra/cmake/GoogleMock.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 58975df62e..821346ced6 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -19,8 +19,7 @@ elseif(WINDOWS) set_target_libraries( googlemock::googlemock gmock) set_target_include_dirs( googlemock::googlemock ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include/gmock - ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1 ) + ${LIBS_PREBUILT_DIR}/include/gmock) elseif(DARWIN) set_target_libraries( googlemock::googlemock gmock gtest) -- cgit v1.2.3 From 603ad5a4f2450f67d2d253f199b3f6a216b30248 Mon Sep 17 00:00:00 2001 From: Nicky Date: Thu, 7 Apr 2022 02:34:32 +0200 Subject: OpenAL is not avaiable for OSX, error out in case someone selects ot. --- indra/cmake/OPENAL.cmake | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index ab2d258a12..a5058b4bc3 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -12,6 +12,7 @@ if (OPENAL) if( TARGET openal::openal ) return() endif() + create_target( openal::openal ) set_target_include_dirs( openal::openal "${LIBS_PREBUILT_DIR}/include/AL") @@ -26,13 +27,15 @@ if (OPENAL) if(WINDOWS) set_target_libraries( openal::openal - OpenAL32 - alut - ) - else() + OpenAL32 + alut + ) + elseif(LINUX) set_target_libraries( openal::openal - openal - alut - ) + openal + alut + ) + else() + message(FATAL_ERROR "OpenAL is not available for this platform") endif() endif (OPENAL) -- cgit v1.2.3 From cca7e12e1bacb4ab116ca25d2a33e18d095c8d09 Mon Sep 17 00:00:00 2001 From: Nicky Date: Thu, 7 Apr 2022 02:35:47 +0200 Subject: Bring packages formater step on par with 3p installation: - When installing a 3P via use_prebuilt_binary it will pass --installdir=${AUTOBUILD_INSTALL_DIR} to autobuild. On the other hand packages-formater was not passing this option, this could lead to subtle errors when AUTOBUILD_INSTALL_DIR is different to what autobuild.xml stipulates. --- indra/cmake/BuildPackagesInfo.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake index 8f8b6b2330..659ba9d579 100644 --- a/indra/cmake/BuildPackagesInfo.cmake +++ b/indra/cmake/BuildPackagesInfo.cmake @@ -16,5 +16,5 @@ add_custom_command(OUTPUT packages-info.txt COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE} -DAUTOBUILD=${AUTOBUILD_EXECUTABLE} ${PYTHON_EXECUTABLE} - ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt + ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" "${AUTOBUILD_INSTALL_DIR}" > packages-info.txt ) -- cgit v1.2.3 From 37f652206b580e2f174f3e49753b2f702e9c932a Mon Sep 17 00:00:00 2001 From: Nicky Date: Thu, 7 Apr 2022 02:41:35 +0200 Subject: Using Ninja leads to subtly different path than using a multi config generate like xcode or visual studio. --- indra/cmake/Linking.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 3cb235a9d5..d3e82f8c3a 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -18,6 +18,11 @@ elseif (LINUX) elseif (DARWIN) set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs") + if( ${CMAKE_GENERATOR} STREQUAL "Ninja") + set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/${CMAKE_BUILD_TYPE} ") + else() + set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs") + endif() endif (WINDOWS) # Autobuild packages must provide 'release' versions of libraries, but may provide versions for @@ -30,7 +35,13 @@ endif (WINDOWS) if(WINDOWS OR DARWIN) # the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us # fortunately both windows and darwin are case insensitive filesystems so this works. - set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/") + # Ninja on the other hand needs the the full path + if( ${CMAKE_GENERATOR} STREQUAL "Ninja") + string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) + set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}) + else() + set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/") + endif() else(WINDOWS OR DARWIN) # else block is for linux and any other makefile based generators string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) -- cgit v1.2.3 From 37595f90f9f45efc27409795a9b8c21486518882 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 9 Apr 2022 19:05:58 +0200 Subject: Cleanup ... use the appropriate functions to set options. Before this everythig was over the place how it was set, worse even with wrong functions like: - add_definitions( /arch:SSE2 ) - add_definitions(/WX) Those are each options to cl, not definitons. --- indra/cmake/00-Common.cmake | 97 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 50 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index e8c956bce3..4f0a6063db 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -27,25 +27,23 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") # as well? # Portable compilation flags. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADDRESS_SIZE=${ADDRESS_SIZE}") +add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE}) # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds") if(RELEASE_CRASH_REPORTING) - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1") + add_compile_definitions( LL_SEND_CRASH_REPORTS=1) endif() if(NON_RELEASE_CRASH_REPORTING) - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1") -endif() + add_compile_definitions( LL_SEND_CRASH_REPORTS=1) +endif() # Don't bother with a MinSizeRel or Debug build. set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING "Supported build types." FORCE) - # Platform-specific compilation flags. if (WINDOWS) @@ -65,22 +63,20 @@ if (WINDOWS) # CP changed to only append the flag for 32bit builds - on 64bit builds, # locally at least, the build output is spammed with 1000s of 'D9002' # warnings about this switch being ignored. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") if( ADDRESS_SIZE EQUAL 32 ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64") endif() # zlib has assembly-language object files incompatible with SAFESEH - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099") - - set(CMAKE_CXX_STANDARD_LIBRARIES "") - set(CMAKE_C_STANDARD_LIBRARIES "") + add_link_options(/LARGEADDRESSAWARE + /SAFESEH:NO + /NODEFAULTLIB:LIBCMT + /IGNORE:4099) add_definitions( - /DNOMINMAX + -DNOMINMAX # /DDOM_DYNAMIC # For shared library colladadom ) add_compile_options( - /Zo /GS /TP @@ -90,57 +86,61 @@ if (WINDOWS) /nologo /Oy- /fp:fast + /MP ) # Nicky: x64 implies SSE2 if( ADDRESS_SIZE EQUAL 32 ) - add_definitions( /arch:SSE2 ) + add_compile_options( /arch:SSE2 ) endif() # Are we using the crummy Visual Studio KDU build workaround? if (NOT VS_DISABLE_FATAL_WARNINGS) - add_definitions(/WX) + add_compile_options(/WX) endif (NOT VS_DISABLE_FATAL_WARNINGS) + + #ND: When using something like buildcache (https://github.com/mbitsnbites/buildcache) + # to make those wrappers work /Zi must be changed to /Z7, as /Zi due to it's nature is not compatible with caching + if( ${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") + add_compile_options( /Z7 ) + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + endif() endif (WINDOWS) if (LINUX) set(CMAKE_SKIP_RPATH TRUE) - add_definitions(-D_FORTIFY_SOURCE=2) - - set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}") - - # gcc 4.3 and above don't like the LL boost and also - # cause warnings due to our use of deprecated headers - add_definitions(-Wno-parentheses) - - add_definitions( - -D_REENTRANT - ) + add_compile_definitions( + -D_REENTRANT + -D_FORTIFY_SOURCE=2 + -DEXTERNAL_TOS + -DAPPID=secondlife + -DLL_IGNORE_SIGCHLD + ) add_compile_options( - -fexceptions - -fno-math-errno - -fno-strict-aliasing - -fsigned-char - -msse2 - -mfpmath=sse - -pthread - ) + -fexceptions + -fno-math-errno + -fno-strict-aliasing + -fsigned-char + -msse2 + -mfpmath=sse + -pthread + -Wno-parentheses + -Wno-deprecated + -Wno-unused-but-set-variable + -Wno-unused-variable + -fvisibility=hidden + ) - # force this platform to accept TOS via external browser - add_definitions(-DEXTERNAL_TOS) - - add_definitions(-DAPPID=secondlife) - add_compile_options(-fvisibility=hidden) - # don't catch SIGCHLD in our base application class for the viewer - some of - # our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The - # viewer doesn't need to catch SIGCHLD anyway. - add_definitions(-DLL_IGNORE_SIGCHLD) if (ADDRESS_SIZE EQUAL 32) add_compile_options(-march=pentium4) endif (ADDRESS_SIZE EQUAL 32) - #add_compile_options(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 + if (NOT USESYSTEMLIBS) # this stops us requiring a really recent glibc at runtime add_compile_options(-fno-stack-protector) @@ -195,11 +195,8 @@ if (LINUX OR DARWIN) set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor") - set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}") - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ADDRESS_SIZE}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${ADDRESS_SIZE}") + add_compile_options(${GCC_CXX_WARNINGS}) + add_compile_options(-m${ADDRESS_SIZE}) endif (LINUX OR DARWIN) @@ -207,7 +204,7 @@ if (USESYSTEMLIBS) add_definitions(-DLL_USESYSTEMLIBS=1) if (LINUX AND ADDRESS_SIZE EQUAL 32) - add_definitions(-march=pentiumpro) + add_compile_options(-march=pentiumpro) endif (LINUX AND ADDRESS_SIZE EQUAL 32) else (USESYSTEMLIBS) -- cgit v1.2.3 From d01e81f4d122a1f8942f1b296b5d3a4d1cc22ec3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 9 Apr 2022 23:40:22 +0200 Subject: Fix warning supression for Linux/OSX, this was broken after the first round of cmake changes on Windows. -Wno-unused-but-set-variable/-Wno-unused-variable moved from just Linux to also OSX (clang) as there's a lot of those in the code where newer xcode complains. Fixing all those places is going beyond the scope of modernizing cmake. --- indra/cmake/00-Common.cmake | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 4f0a6063db..d203d43545 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -132,8 +132,6 @@ if (LINUX) -pthread -Wno-parentheses -Wno-deprecated - -Wno-unused-but-set-variable - -Wno-unused-variable -fvisibility=hidden ) @@ -183,19 +181,15 @@ if (LINUX OR DARWIN) set(CMAKE_COMPILER_IS_CLANGXX 1) endif (CMAKE_CXX_COMPILER MATCHES ".*clang") - if (CMAKE_COMPILER_IS_GNUCXX) - set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") - elseif (CMAKE_COMPILER_IS_CLANGXX) - set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") - endif() + set(GCC_WARNINGS -Wall -Wno-sign-compare -Wno-trigraphs) if (NOT GCC_DISABLE_FATAL_WARNINGS) - set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") + list(APPEND GCC_WARNINGS -Werror) endif (NOT GCC_DISABLE_FATAL_WARNINGS) - set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor") + list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-but-set-variable -Wno-unused-variable ) - add_compile_options(${GCC_CXX_WARNINGS}) + add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) endif (LINUX OR DARWIN) -- cgit v1.2.3 From 07d388f416b64ad5ea6a79d7dee4bf9e6bab7b74 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 10 Apr 2022 23:43:15 +0200 Subject: Make LIB_NDOF define part of the targets interface --- indra/cmake/NDOF.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index f22e2246aa..7b64b23299 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -24,13 +24,11 @@ if (NDOF) elseif (DARWIN OR LINUX) set_target_libraries( ndof::ndof ndofdev) endif (WINDOWS) - set(NDOF_FOUND 1) + target_compile_definitions( ndof::ndof INTERFACE LIB_NDOF=1) endif (USESYSTEMLIBS) endif (NDOF) -if (NDOF_FOUND) - add_definitions(-DLIB_NDOF=1) -else (NDOF_FOUND) +if (NOT NDOF_FOUND) message(STATUS "Building without N-DoF joystick support") -endif (NDOF_FOUND) +endif () -- cgit v1.2.3 From d3521b4462195cfe882b2cc8eb4e7c5e948c0fb6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 10:28:46 +0200 Subject: Remove obsolete and unmaintained USE_SYSTEMLIBS --- indra/cmake/00-Common.cmake | 33 ++++-------- indra/cmake/APR.cmake | 74 +++++++++++++-------------- indra/cmake/Audio.cmake | 22 +++----- indra/cmake/Boost.cmake | 85 ++++++++++++++----------------- indra/cmake/CEFPlugin.cmake | 9 +--- indra/cmake/CMakeLists.txt | 14 +----- indra/cmake/CURL.cmake | 18 +++---- indra/cmake/Copy3rdPartyLibs.cmake | 10 ++-- indra/cmake/DBusGlib.cmake | 29 ++++------- indra/cmake/DragDrop.cmake | 16 +++--- indra/cmake/EXPAT.cmake | 30 +++++------ indra/cmake/ExamplePlugin.cmake | 7 +-- indra/cmake/FindAPR.cmake | 94 ----------------------------------- indra/cmake/FindGLH.cmake | 30 ----------- indra/cmake/FindGooglePerfTools.cmake | 66 ------------------------ indra/cmake/FindHUNSPELL.cmake | 38 -------------- indra/cmake/FindJsonCpp.cmake | 60 ---------------------- indra/cmake/FindNDOF.cmake | 39 --------------- indra/cmake/FindOpenJPEG.cmake | 50 ------------------- indra/cmake/FindSCP.cmake | 40 --------------- indra/cmake/FindURIPARSER.cmake | 46 ----------------- indra/cmake/FindXmlRpcEpi.cmake | 48 ------------------ indra/cmake/FindZLIBNG.cmake | 46 ----------------- indra/cmake/FreeType.cmake | 12 ++--- indra/cmake/GLEXT.cmake | 12 ++--- indra/cmake/GLH.cmake | 6 +-- indra/cmake/GLOD.cmake | 6 +-- indra/cmake/GStreamer010Plugin.cmake | 10 +--- indra/cmake/Hunspell.cmake | 28 +++++------ indra/cmake/JPEG.cmake | 22 ++++---- indra/cmake/JsonCpp.cmake | 22 ++++---- indra/cmake/LLAddBuildTest.cmake | 10 +--- indra/cmake/LLWindow.cmake | 23 +++------ indra/cmake/LibVLCPlugin.cmake | 11 ++-- indra/cmake/NDOF.cmake | 27 ++++------ indra/cmake/NGHTTP2.cmake | 22 ++++---- indra/cmake/OPENAL.cmake | 9 +--- indra/cmake/OpenJPEG.cmake | 12 ++--- indra/cmake/OpenSSL.cmake | 22 ++++---- indra/cmake/PNG.cmake | 21 +++----- indra/cmake/PulseAudio.cmake | 27 ++++------ indra/cmake/Tut.cmake | 4 +- indra/cmake/UI.cmake | 87 +++++++++++--------------------- indra/cmake/URIPARSER.cmake | 22 ++++---- indra/cmake/Variables.cmake | 1 - indra/cmake/ViewerMiscLibs.cmake | 14 +++--- indra/cmake/XmlRpcEpi.cmake | 10 ++-- indra/cmake/ZLIBNG.cmake | 18 +++---- indra/cmake/bugsplat.cmake | 28 +++++------ 49 files changed, 304 insertions(+), 1086 deletions(-) delete mode 100644 indra/cmake/FindAPR.cmake delete mode 100644 indra/cmake/FindGLH.cmake delete mode 100644 indra/cmake/FindGooglePerfTools.cmake delete mode 100644 indra/cmake/FindHUNSPELL.cmake delete mode 100644 indra/cmake/FindJsonCpp.cmake delete mode 100644 indra/cmake/FindNDOF.cmake delete mode 100644 indra/cmake/FindOpenJPEG.cmake delete mode 100644 indra/cmake/FindSCP.cmake delete mode 100644 indra/cmake/FindURIPARSER.cmake delete mode 100644 indra/cmake/FindXmlRpcEpi.cmake delete mode 100644 indra/cmake/FindZLIBNG.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index d203d43545..54b74b14fb 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -139,12 +139,10 @@ if (LINUX) add_compile_options(-march=pentium4) endif (ADDRESS_SIZE EQUAL 32) - if (NOT USESYSTEMLIBS) - # this stops us requiring a really recent glibc at runtime - add_compile_options(-fno-stack-protector) - # linking can be very memory-hungry, especially the final viewer link - set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") - endif (NOT USESYSTEMLIBS) + # this stops us requiring a really recent glibc at runtime + add_compile_options(-fno-stack-protector) + # linking can be very memory-hungry, especially the final viewer link + set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") endif (LINUX) @@ -194,21 +192,12 @@ if (LINUX OR DARWIN) endif (LINUX OR DARWIN) -if (USESYSTEMLIBS) - add_definitions(-DLL_USESYSTEMLIBS=1) - - if (LINUX AND ADDRESS_SIZE EQUAL 32) - add_compile_options(-march=pentiumpro) - endif (LINUX AND ADDRESS_SIZE EQUAL 32) - -else (USESYSTEMLIBS) - set(${ARCH}_linux_INCLUDES - atk-1.0 - glib-2.0 - gstreamer-0.10 - gtk-2.0 - pango-1.0 - ) -endif (USESYSTEMLIBS) +set(${ARCH}_linux_INCLUDES + atk-1.0 + glib-2.0 + gstreamer-0.10 + gtk-2.0 + pango-1.0 + ) endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 5a7c504af8..63ea195fad 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -7,43 +7,39 @@ endif() create_target( apr::apr) -if (USESYSTEMLIBS) - include(FindAPR) -else (USESYSTEMLIBS) - use_prebuilt_binary(apr_suite) - if (WINDOWS) - if (LLCOMMON_LINK_SHARED) - set(APR_selector "lib") - else (LLCOMMON_LINK_SHARED) - set(APR_selector "") - endif (LLCOMMON_LINK_SHARED) - set_target_libraries( apr::apr - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib - ) - elseif (DARWIN) - if (LLCOMMON_LINK_SHARED) - set(APR_selector "0.dylib") - set(APRUTIL_selector "0.dylib") - else (LLCOMMON_LINK_SHARED) - set(APR_selector "a") - set(APRUTIL_selector "a") - endif (LLCOMMON_LINK_SHARED) +use_prebuilt_binary(apr_suite) +if (WINDOWS) + if (LLCOMMON_LINK_SHARED) + set(APR_selector "lib") + else (LLCOMMON_LINK_SHARED) + set(APR_selector "") + endif (LLCOMMON_LINK_SHARED) + set_target_libraries( apr::apr + ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib + ) +elseif (DARWIN) + if (LLCOMMON_LINK_SHARED) + set(APR_selector "0.dylib") + set(APRUTIL_selector "0.dylib") + else (LLCOMMON_LINK_SHARED) + set(APR_selector "a") + set(APRUTIL_selector "a") + endif (LLCOMMON_LINK_SHARED) - set_target_libraries( apr::apr - libapr-1.${APR_selector} - libaprutil-1.${APRUTIL_selector} - iconv - ) - else (WINDOWS) - set_target_libraries( apr::apr - apr-1 - aprutil-1 - iconv - uuid - rt - ) - endif (WINDOWS) - set_target_include_dirs( apr::apr ${LIBS_PREBUILT_DIR}/include/apr-1 ) -endif (USESYSTEMLIBS) + set_target_libraries( apr::apr + libapr-1.${APR_selector} + libaprutil-1.${APRUTIL_selector} + iconv + ) +else (WINDOWS) + set_target_libraries( apr::apr + apr-1 + aprutil-1 + iconv + uuid + rt + ) +endif (WINDOWS) +set_target_include_dirs( apr::apr ${LIBS_PREBUILT_DIR}/include/apr-1 ) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index bc11e62de5..bf95a8eef1 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -6,20 +6,12 @@ if(TARGET vorbis::vorbis) endif() create_target(vorbis::vorbis) -if (USESYSTEMLIBS) - include(FindPkgConfig) - pkg_check_modules(OGG REQUIRED ogg) - pkg_check_modules(VORBIS REQUIRED vorbis) - pkg_check_modules(VORBISENC REQUIRED vorbisenc) - pkg_check_modules(VORBISFILE REQUIRED vorbisfile) -else (USESYSTEMLIBS) - use_prebuilt_binary(ogg_vorbis) - set_target_include_dirs( vorbis::vorbis ${LIBS_PREBUILT_DIR}/include ) +use_prebuilt_binary(ogg_vorbis) +set_target_include_dirs( vorbis::vorbis ${LIBS_PREBUILT_DIR}/include ) - if (WINDOWS) - set_target_libraries(vorbis::vorbis ogg_static vorbis_static vorbisenc_static vorbisfile_static ) - else (WINDOWS) - set_target_libraries(vorbis::vorbis ogg vorbis vorbisenc vorbisfile ) - endif (WINDOWS) -endif (USESYSTEMLIBS) +if (WINDOWS) + set_target_libraries(vorbis::vorbis ogg_static vorbis_static vorbisenc_static vorbisfile_static ) +else (WINDOWS) + set_target_libraries(vorbis::vorbis ogg vorbis vorbisenc vorbisfile ) +endif (WINDOWS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 8e5ef66af8..2102ee3887 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -9,55 +9,42 @@ create_target( boost::boost ) set(Boost_FIND_QUIETLY ON) set(Boost_FIND_REQUIRED ON) -if (USESYSTEMLIBS) - include(FindBoost) - - set(BOOST_CONTEXT_LIBRARY boost_context-mt) - set(BOOST_FIBER_LIBRARY boost_fiber-mt) - set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) - set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) - set(BOOST_REGEX_LIBRARY boost_regex-mt) - set(BOOST_SIGNALS_LIBRARY boost_signals-mt) - set(BOOST_SYSTEM_LIBRARY boost_system-mt) - set(BOOST_THREAD_LIBRARY boost_thread-mt) -else (USESYSTEMLIBS) - use_prebuilt_binary(boost) - set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) - - # As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed - # with the address size. - set(addrsfx "-x${ADDRESS_SIZE}") - - if (WINDOWS) - set_target_libraries( boost::boost - libboost_context-mt${addrsfx} - libboost_fiber-mt${addrsfx} - libboost_filesystem-mt${addrsfx} - libboost_program_options-mt${addrsfx} - libboost_regex-mt${addrsfx} - libboost_system-mt${addrsfx} - libboost_thread-mt${addrsfx}) - elseif (LINUX) - set_target_libraries( boost::boost - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_signals-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx}) - elseif (DARWIN) - set_target_libraries( boost::boost - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx}) - endif (WINDOWS) -endif (USESYSTEMLIBS) +use_prebuilt_binary(boost) +set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + +# As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed +# with the address size. +set(addrsfx "-x${ADDRESS_SIZE}") + +if (WINDOWS) + set_target_libraries( boost::boost + libboost_context-mt${addrsfx} + libboost_fiber-mt${addrsfx} + libboost_filesystem-mt${addrsfx} + libboost_program_options-mt${addrsfx} + libboost_regex-mt${addrsfx} + libboost_system-mt${addrsfx} + libboost_thread-mt${addrsfx}) +elseif (LINUX) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_signals-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) +elseif (DARWIN) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) +endif (WINDOWS) if (LINUX) set(BOOST_SYSTEM_LIBRARY ${BOOST_SYSTEM_LIBRARY} rt) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 706730b226..bcce4cfa05 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -7,13 +7,8 @@ if(TARGET cef::cef) endif() create_target( cef::cef ) -if (USESYSTEMLIBS) - set(CEFPLUGIN OFF CACHE BOOL - "CEFPLUGIN support for the llplugin/llmedia test apps.") -else (USESYSTEMLIBS) - use_prebuilt_binary(dullahan) - set_target_include_dirs( cef::cef ${LIBS_PREBUILT_DIR}/include/cef) -endif (USESYSTEMLIBS) +use_prebuilt_binary(dullahan) +set_target_include_dirs( cef::cef ${LIBS_PREBUILT_DIR}/include/cef) if (WINDOWS) set_target_libraries( cef::cef diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 812e35390f..48b08b31d6 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -23,18 +23,8 @@ set(cmake_SOURCE_FILES DeploySharedLibs.cmake DragDrop.cmake EXPAT.cmake - FindAPR.cmake - FindAutobuild.cmake - FindGLH.cmake - FindHUNSPELL.cmake - FindJsonCpp.cmake - FindNDOF.cmake - FindOpenJPEG.cmake - FindSCP.cmake - FindURIPARSER.cmake - FindXmlRpcEpi.cmake - FindZLIBNG.cmake - FMODSTUDIO.cmake + FindAutobuild.cmake + FMODSTUDIO.cmake FreeType.cmake GLEXT.cmake GLH.cmake diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index d91eb2e2fd..455d420e48 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -6,14 +6,10 @@ if( TARGET libcurl::libcurl ) endif() create_target(libcurl::libcurl) -if (USESYSTEMLIBS) - include(FindCURL) -else (USESYSTEMLIBS) - use_prebuilt_binary(curl) - if (WINDOWS) - set_target_libraries(libcurl::libcurl libcurl.lib) - else (WINDOWS) - set_target_libraries(libcurl::libcurl libcurl.a) - endif (WINDOWS) - set_target_include_dirs( libcurl::libcurl ${LIBS_PREBUILT_DIR}/include) -endif (USESYSTEMLIBS) +use_prebuilt_binary(curl) +if (WINDOWS) + set_target_libraries(libcurl::libcurl libcurl.lib) +else (WINDOWS) + set_target_libraries(libcurl::libcurl libcurl.a) +endif (WINDOWS) +set_target_include_dirs( libcurl::libcurl ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index b20d23cead..d5b8e6c712 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -280,9 +280,7 @@ to_staging_dirs( ${release_files} ) -if(NOT USESYSTEMLIBS) - add_custom_target( - stage_third_party_libs ALL - DEPENDS ${third_party_targets} - ) -endif(NOT USESYSTEMLIBS) +add_custom_target( + stage_third_party_libs ALL + DEPENDS ${third_party_targets} +) diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 5e46b6711a..7c95bf8c20 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -1,24 +1,17 @@ # -*- cmake -*- include(Prebuilt) -if (USESYSTEMLIBS) - include(FindPkgConfig) - - pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) - -elseif (LINUX) - use_prebuilt_binary(dbus_glib) - set(DBUSGLIB_FOUND ON FORCE BOOL) - set(DBUSGLIB_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include/dbus - ) - # We don't need to explicitly link against dbus-glib itself, because - # the viewer probes for the system's copy at runtime. - set(DBUSGLIB_LIBRARIES - gobject-2.0 - glib-2.0 - ) -endif (USESYSTEMLIBS) +use_prebuilt_binary(dbus_glib) +set(DBUSGLIB_FOUND ON FORCE BOOL) +set(DBUSGLIB_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/include/dbus + ) +# We don't need to explicitly link against dbus-glib itself, because +# the viewer probes for the system's copy at runtime. +set(DBUSGLIB_LIBRARIES + gobject-2.0 + glib-2.0 + ) if (DBUSGLIB_FOUND) set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") diff --git a/indra/cmake/DragDrop.cmake b/indra/cmake/DragDrop.cmake index 73ef59b18f..cbbf5747a7 100644 --- a/indra/cmake/DragDrop.cmake +++ b/indra/cmake/DragDrop.cmake @@ -1,20 +1,16 @@ # -*- cmake -*- - set(OS_DRAG_DROP ON CACHE BOOL "Build the viewer with OS level drag and drop turned on or off") - - if (OS_DRAG_DROP) +set(OS_DRAG_DROP ON CACHE BOOL "Build the viewer with OS level drag and drop turned on or off") +if (OS_DRAG_DROP) if (WINDOWS) - add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) endif (WINDOWS) - if (DARWIN) - add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) endif (DARWIN) - if (LINUX) - add_definitions(-DLL_OS_DRAGDROP_ENABLED=0) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=0) endif (LINUX) - - endif (OS_DRAG_DROP) +endif (OS_DRAG_DROP) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 6f6503ca4d..fb0467987b 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -6,20 +6,16 @@ if( TARGET expat::expat ) endif() create_target( expat::expat INTERFACE IMPORTED ) -if (USESYSTEMLIBS) - include(FindEXPAT) -else (USESYSTEMLIBS) - use_prebuilt_binary(expat) - if (WINDOWS) - set_target_libraries( expat::expat libexpatMT ) - set(EXPAT_COPY libexpatMT.dll) - else (WINDOWS) - set_target_libraries( expat::expat expat ) - if (DARWIN) - set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) - else () - set(EXPAT_COPY libexpat.so.1 libexpat.so) - endif () - endif (WINDOWS) - set_target_include_dirs( expat::expat ${LIBS_PREBUILT_DIR}/include ) -endif (USESYSTEMLIBS) +use_prebuilt_binary(expat) +if (WINDOWS) + set_target_libraries( expat::expat libexpatMT ) + set(EXPAT_COPY libexpatMT.dll) +else (WINDOWS) + set_target_libraries( expat::expat expat ) + if (DARWIN) + set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) + else () + set(EXPAT_COPY libexpat.so.1 libexpat.so) + endif () +endif (WINDOWS) +set_target_include_dirs( expat::expat ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake index 5d826c1f66..c7ffaf024e 100644 --- a/indra/cmake/ExamplePlugin.cmake +++ b/indra/cmake/ExamplePlugin.cmake @@ -2,13 +2,8 @@ include(Linking) include(Prebuilt) -if (USESYSTEMLIBS) - set(EXAMPLEPLUGIN OFF CACHE BOOL +set(EXAMPLEPLUGIN ON CACHE BOOL "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") -else (USESYSTEMLIBS) - set(EXAMPLEPLUGIN ON CACHE BOOL - "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") -endif (USESYSTEMLIBS) if (WINDOWS) elseif (DARWIN) diff --git a/indra/cmake/FindAPR.cmake b/indra/cmake/FindAPR.cmake deleted file mode 100644 index 906b6c9452..0000000000 --- a/indra/cmake/FindAPR.cmake +++ /dev/null @@ -1,94 +0,0 @@ -# -*- cmake -*- - -# - Find Apache Portable Runtime -# Find the APR includes and libraries -# This module defines -# APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc. -# APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR. -# APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR. -# also defined, but not for general use are -# APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library. - -# APR first. - -FIND_PATH(APR_INCLUDE_DIR apr.h -/usr/local/include/apr-1 -/usr/local/include/apr-1.0 -/usr/include/apr-1 -/usr/include/apr-1.0 -) - -SET(APR_NAMES ${APR_NAMES} apr-1) -FIND_LIBRARY(APR_LIBRARY - NAMES ${APR_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (APR_LIBRARY AND APR_INCLUDE_DIR) - SET(APR_LIBRARIES ${APR_LIBRARY}) - SET(APR_FOUND "YES") -ELSE (APR_LIBRARY AND APR_INCLUDE_DIR) - SET(APR_FOUND "NO") -ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR) - - -IF (APR_FOUND) - IF (NOT APR_FIND_QUIETLY) - MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}") - ENDIF (NOT APR_FIND_QUIETLY) -ELSE (APR_FOUND) - IF (APR_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find APR library") - ENDIF (APR_FIND_REQUIRED) -ENDIF (APR_FOUND) - -# Deprecated declarations. -SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} ) -GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH) - -MARK_AS_ADVANCED( - APR_LIBRARY - APR_INCLUDE_DIR - ) - -# Next, APRUTIL. - -FIND_PATH(APRUTIL_INCLUDE_DIR apu.h -/usr/local/include/apr-1 -/usr/local/include/apr-1.0 -/usr/include/apr-1 -/usr/include/apr-1.0 -) - -SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1) -FIND_LIBRARY(APRUTIL_LIBRARY - NAMES ${APRUTIL_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) - SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY}) - SET(APRUTIL_FOUND "YES") -ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) - SET(APRUTIL_FOUND "NO") -ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) - - -IF (APRUTIL_FOUND) - IF (NOT APRUTIL_FIND_QUIETLY) - MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}") - ENDIF (NOT APRUTIL_FIND_QUIETLY) -ELSE (APRUTIL_FOUND) - IF (APRUTIL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find APRUTIL library") - ENDIF (APRUTIL_FIND_REQUIRED) -ENDIF (APRUTIL_FOUND) - -# Deprecated declarations. -SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} ) -GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH) - -MARK_AS_ADVANCED( - APRUTIL_LIBRARY - APRUTIL_INCLUDE_DIR - ) diff --git a/indra/cmake/FindGLH.cmake b/indra/cmake/FindGLH.cmake deleted file mode 100644 index 3d16adaf03..0000000000 --- a/indra/cmake/FindGLH.cmake +++ /dev/null @@ -1,30 +0,0 @@ -# -*- cmake -*- - -# - Find GLH -# Find the Graphic Library Helper includes. -# This module defines -# GLH_INCLUDE_DIR, where to find glh/glh_linear.h. -# GLH_FOUND, If false, do not try to use GLH. - -find_path(GLH_INCLUDE_DIR glh/glh_linear.h - NO_SYSTEM_ENVIRONMENT_PATH - ) - -if (GLH_INCLUDE_DIR) - set(GLH_FOUND "YES") -else (GLH_INCLUDE_DIR) - set(GLH_FOUND "NO") -endif (GLH_INCLUDE_DIR) - -if (GLH_FOUND) - if (NOT GLH_FIND_QUIETLY) - message(STATUS "Found GLH: ${GLH_INCLUDE_DIR}") - set(GLH_FIND_QUIETLY TRUE) # Only alert us the first time - endif (NOT GLH_FIND_QUIETLY) -else (GLH_FOUND) - if (GLH_FIND_REQUIRED) - message(FATAL_ERROR "Could not find GLH") - endif (GLH_FIND_REQUIRED) -endif (GLH_FOUND) - -mark_as_advanced(GLH_INCLUDE_DIR) diff --git a/indra/cmake/FindGooglePerfTools.cmake b/indra/cmake/FindGooglePerfTools.cmake deleted file mode 100644 index bb125d538e..0000000000 --- a/indra/cmake/FindGooglePerfTools.cmake +++ /dev/null @@ -1,66 +0,0 @@ -# -*- cmake -*- - -# - Find Google perftools -# Find the Google perftools includes and libraries -# This module defines -# GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc. -# GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools. -# also defined for general use are -# TCMALLOC_LIBRARIES, where to find the tcmalloc library. -# STACKTRACE_LIBRARIES, where to find the stacktrace library. -# PROFILER_LIBRARIES, where to find the profiler library. - -FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h -/usr/local/include -/usr/include -) - -SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc) -FIND_LIBRARY(TCMALLOC_LIBRARY - NAMES ${TCMALLOC_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - SET(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY}) - SET(GOOGLE_PERFTOOLS_FOUND "YES") -ELSE (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - SET(GOOGLE_PERFTOOLS_FOUND "NO") -ENDIF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - -SET(STACKTRACE_NAMES ${STACKTRACE_NAMES} stacktrace) -FIND_LIBRARY(STACKTRACE_LIBRARY - NAMES ${STACKTRACE_LIBRARY} - PATHS /usr/lib /usr/local/lib - ) - -IF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - SET(STACKTRACE_LIBRARIES ${STACKTRACE_LIBRARY}) -ENDIF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - -SET(PROFILER_NAMES ${PROFILER_NAMES} profiler) -FIND_LIBRARY(PROFILER_LIBRARY - NAMES ${PROFILER_LIBRARY} - PATHS /usr/lib /usr/local/lib - ) - -IF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - SET(PROFILER_LIBRARIES ${PROFILER_LIBRARY}) -ENDIF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) - -IF (GOOGLE_PERFTOOLS_FOUND) - IF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY) - MESSAGE(STATUS "Found Google perftools: ${GOOGLE_PERFTOOLS_LIBRARIES}") - ENDIF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY) -ELSE (GOOGLE_PERFTOOLS_FOUND) - IF (GOOGLE_PERFTOOLS_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Google perftools library") - ENDIF (GOOGLE_PERFTOOLS_FIND_REQUIRED) -ENDIF (GOOGLE_PERFTOOLS_FOUND) - -MARK_AS_ADVANCED( - TCMALLOC_LIBRARY - STACKTRACE_LIBRARY - PROFILER_LIBRARY - GOOGLE_PERFTOOLS_INCLUDE_DIR - ) diff --git a/indra/cmake/FindHUNSPELL.cmake b/indra/cmake/FindHUNSPELL.cmake deleted file mode 100644 index d411bdb9e5..0000000000 --- a/indra/cmake/FindHUNSPELL.cmake +++ /dev/null @@ -1,38 +0,0 @@ -# -*- cmake -*- - -# - Find HUNSPELL -# This module defines -# HUNSPELL_INCLUDE_DIR, where to find libhunspell.h, etc. -# HUNSPELL_LIBRARY, the library needed to use HUNSPELL. -# HUNSPELL_FOUND, If false, do not try to use HUNSPELL. - -find_path(HUNSPELL_INCLUDE_DIR hunspell.h - PATH_SUFFIXES hunspell - ) - -set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3 libhunspell) -find_library(HUNSPELL_LIBRARY - NAMES ${HUNSPELL_NAMES} - ) - -if (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR) - set(HUNSPELL_FOUND "YES") -else (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR) - set(HUNSPELL_FOUND "NO") -endif (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR) - - -if (HUNSPELL_FOUND) - if (NOT HUNSPELL_FIND_QUIETLY) - message(STATUS "Found Hunspell: Library in '${HUNSPELL_LIBRARY}' and header in '${HUNSPELL_INCLUDE_DIR}' ") - endif (NOT HUNSPELL_FIND_QUIETLY) -else (HUNSPELL_FOUND) - if (HUNSPELL_FIND_REQUIRED) - message(FATAL_ERROR " * * *\nCould not find HUNSPELL library! * * *") - endif (HUNSPELL_FIND_REQUIRED) -endif (HUNSPELL_FOUND) - -mark_as_advanced( - HUNSPELL_LIBRARY - HUNSPELL_INCLUDE_DIR - ) diff --git a/indra/cmake/FindJsonCpp.cmake b/indra/cmake/FindJsonCpp.cmake deleted file mode 100644 index 9398779cff..0000000000 --- a/indra/cmake/FindJsonCpp.cmake +++ /dev/null @@ -1,60 +0,0 @@ -# -*- cmake -*- - -# - Find JSONCpp -# Find the JSONCpp includes and library -# This module defines -# JSONCPP_INCLUDE_DIR, where to find json.h, etc. -# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp. -# JSONCPP_FOUND, If false, do not try to use jsoncpp. -# also defined, but not for general use are -# JSONCPP_LIBRARY, where to find the jsoncpp library. - -FIND_PATH(JSONCPP_INCLUDE_DIR jsoncpp/json.h -/usr/local/include -/usr/include -) - -# Get the GCC compiler version -EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE _gcc_COMPILER_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - -# Try to find a library that was compiled with the same compiler version as we currently use. -SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so) -IF (USESYSTEMLIBS) - # On standalone, assume that the system installed library was compiled with the used compiler. - SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so) -ENDIF (USESYSTEMLIBS) -FIND_LIBRARY(JSONCPP_LIBRARY - NAMES ${JSONCPP_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR) - SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY}) - SET(JSONCPP_FOUND "YES") -ELSE (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR) - SET(JSONCPP_FOUND "NO") -ENDIF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR) - - -IF (JSONCPP_FOUND) - IF (NOT JSONCPP_FIND_QUIETLY) - MESSAGE(STATUS "Found JSONCpp: ${JSONCPP_LIBRARIES}") - ENDIF (NOT JSONCPP_FIND_QUIETLY) -ELSE (JSONCPP_FOUND) - IF (JSONCPP_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find JSONCpp library") - ENDIF (JSONCPP_FIND_REQUIRED) -ENDIF (JSONCPP_FOUND) - -# Deprecated declarations. -SET (NATIVE_JSONCPP_INCLUDE_PATH ${JSONCPP_INCLUDE_DIR} ) -GET_FILENAME_COMPONENT (NATIVE_JSONCPP_LIB_PATH ${JSONCPP_LIBRARY} PATH) - -MARK_AS_ADVANCED( - JSONCPP_LIBRARY - JSONCPP_INCLUDE_DIR - ) diff --git a/indra/cmake/FindNDOF.cmake b/indra/cmake/FindNDOF.cmake deleted file mode 100644 index 6dcf590a53..0000000000 --- a/indra/cmake/FindNDOF.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# -*- cmake -*- - -# - Find NDOF -# Find the NDOF includes and library -# This module defines -# NDOF_INCLUDE_DIR, where to find ndofdev_external.h, etc. -# NDOF_LIBRARY, the library needed to use NDOF. -# NDOF_FOUND, If false, do not try to use NDOF. - -find_path(NDOF_INCLUDE_DIR ndofdev_external.h - PATH_SUFFIXES ndofdev - ) - -set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev) -find_library(NDOF_LIBRARY - NAMES ${NDOF_NAMES} - ) - -if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) - set(NDOF_FOUND "YES") -else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) - set(NDOF_FOUND "NO") -endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) - - -if (NDOF_FOUND) - if (NOT NDOF_FIND_QUIETLY) - message(STATUS "Found NDOF: Library in '${NDOF_LIBRARY}' and header in '${NDOF_INCLUDE_DIR}' ") - endif (NOT NDOF_FIND_QUIETLY) -else (NDOF_FOUND) - if (NDOF_FIND_REQUIRED) - message(FATAL_ERROR " * * *\nCould not find NDOF library!\nIf you don't need Space Navigator Joystick support you can skip this test by configuring with -DNDOF:BOOL=OFF\n * * *") - endif (NDOF_FIND_REQUIRED) -endif (NDOF_FOUND) - -mark_as_advanced( - NDOF_LIBRARY - NDOF_INCLUDE_DIR - ) diff --git a/indra/cmake/FindOpenJPEG.cmake b/indra/cmake/FindOpenJPEG.cmake deleted file mode 100644 index 949384eec4..0000000000 --- a/indra/cmake/FindOpenJPEG.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# -*- cmake -*- - -# - Find OpenJPEG -# Find the OpenJPEG includes and library -# This module defines -# OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc. -# OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG. -# OPENJPEG_FOUND, If false, do not try to use OpenJPEG. -# also defined, but not for general use are -# OPENJPEG_LIBRARY, where to find the OpenJPEG library. - -FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h -/usr/local/include/openjpeg -/usr/local/include -/usr/include/openjpeg -/usr/include -) - -SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg) -FIND_LIBRARY(OPENJPEG_LIBRARY - NAMES ${OPENJPEG_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR) - SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY}) - SET(OPENJPEG_FOUND "YES") -ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR) - SET(OPENJPEG_FOUND "NO") -ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR) - - -IF (OPENJPEG_FOUND) - IF (NOT OPENJPEG_FIND_QUIETLY) - MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}") - ENDIF (NOT OPENJPEG_FIND_QUIETLY) -ELSE (OPENJPEG_FOUND) - IF (OPENJPEG_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find OpenJPEG library") - ENDIF (OPENJPEG_FIND_REQUIRED) -ENDIF (OPENJPEG_FOUND) - -# Deprecated declarations. -SET (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} ) -GET_FILENAME_COMPONENT (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH) - -MARK_AS_ADVANCED( - OPENJPEG_LIBRARY - OPENJPEG_INCLUDE_DIR - ) diff --git a/indra/cmake/FindSCP.cmake b/indra/cmake/FindSCP.cmake deleted file mode 100644 index ea02102908..0000000000 --- a/indra/cmake/FindSCP.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# -*- cmake -*- -# -# Find the OpenSSH scp ("secure copy") or Putty pscp command. -# -# Input variables: -# SCP_FIND_REQUIRED - set this if configuration should fail without scp -# -# Output variables: -# -# SCP_FOUND - set if scp was found -# SCP_EXECUTABLE - path to scp or pscp executable -# SCP_BATCH_FLAG - how to put scp/pscp into batch mode - -SET(SCP_EXECUTABLE) -IF (WINDOWS) - FIND_PROGRAM(SCP_EXECUTABLE NAMES pscp pscp.exe) -ELSE (WINDOWS) - FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe) -ENDIF (WINDOWS) - -IF (SCP_EXECUTABLE) - SET(SCP_FOUND ON) -ELSE (SCP_EXECUTABLE) - SET(SCP_FOUND OFF) -ENDIF (SCP_EXECUTABLE) - -IF (SCP_FOUND) - GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE) - IF (_scp_name STREQUAL scp) - SET(SCP_BATCH_FLAG -B) - ELSE (_scp_name STREQUAL scp) - SET(SCP_BATCH_FLAG -batch) - ENDIF (_scp_name STREQUAL scp) -ELSE (SCP_FOUND) - IF (SCP_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find scp or pscp executable") - ENDIF (SCP_FIND_REQUIRED) -ENDIF (SCP_FOUND) - -MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG) diff --git a/indra/cmake/FindURIPARSER.cmake b/indra/cmake/FindURIPARSER.cmake deleted file mode 100644 index 8ab9f0f4ed..0000000000 --- a/indra/cmake/FindURIPARSER.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# -*- cmake -*- - -# - Find uriparser -# Find the URIPARSER includes and library -# This module defines -# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc. -# URIPARSER_LIBRARIES, the libraries needed to use uriparser. -# URIPARSER_FOUND, If false, do not try to use uriparser. -# -# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x), -# because it doesn't look up the version of uriparser, resulting in a dramatic -# speed up for configure (from 4 minutes 22 seconds to 6 seconds). -# -# Note: Since this file is only used for standalone, the windows -# specific parts were left out. - -FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/uri.h - NO_SYSTEM_ENVIRONMENT_PATH - ) - -FIND_LIBRARY(URIPARSER_LIBRARY uriparser) - -if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) - SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR}) - SET(URIPARSER_LIBRARIES ${URIPARSER_LIBRARY}) - SET(URIPARSER_FOUND "YES") -else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) - SET(URIPARSER_FOUND "NO") -endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) - -if (URIPARSER_FOUND) - if (NOT URIPARSER_FIND_QUIETLY) - message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARIES}") - SET(URIPARSER_FIND_QUIETLY TRUE) - endif (NOT URIPARSER_FIND_QUIETLY) -else (URIPARSER_FOUND) - if (URIPARSER_FIND_REQUIRED) - message(FATAL_ERROR "Could not find URIPARSER library") - endif (URIPARSER_FIND_REQUIRED) -endif (URIPARSER_FOUND) - -mark_as_advanced( - URIPARSER_LIBRARY - URIPARSER_INCLUDE_DIR - ) - diff --git a/indra/cmake/FindXmlRpcEpi.cmake b/indra/cmake/FindXmlRpcEpi.cmake deleted file mode 100644 index ba217e7467..0000000000 --- a/indra/cmake/FindXmlRpcEpi.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# -*- cmake -*- - -# - Find XMLRPC-EPI -# Find the XMLRPC-EPI includes and library -# This module defines -# XMLRPCEPI_INCLUDE_DIR, where to find jpeglib.h, etc. -# XMLRPCEPI_LIBRARIES, the libraries needed to use XMLRPC-EPI. -# XMLRPCEPI_FOUND, If false, do not try to use XMLRPC-EPI. -# also defined, but not for general use are -# XMLRPCEPI_LIBRARY, where to find the XMLRPC-EPI library. - -FIND_PATH(XMLRPCEPI_INCLUDE_DIR xmlrpc-epi/xmlrpc.h -/usr/local/include -/usr/include -) - -SET(XMLRPCEPI_NAMES ${XMLRPCEPI_NAMES} xmlrpc-epi) -FIND_LIBRARY(XMLRPCEPI_LIBRARY - NAMES ${XMLRPCEPI_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR) - SET(XMLRPCEPI_LIBRARIES ${XMLRPCEPI_LIBRARY}) - SET(XMLRPCEPI_FOUND "YES") -ELSE (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR) - SET(XMLRPCEPI_FOUND "NO") -ENDIF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR) - - -IF (XMLRPCEPI_FOUND) - IF (NOT XMLRPCEPI_FIND_QUIETLY) - MESSAGE(STATUS "Found XMLRPC-EPI: ${XMLRPCEPI_LIBRARIES}") - ENDIF (NOT XMLRPCEPI_FIND_QUIETLY) -ELSE (XMLRPCEPI_FOUND) - IF (XMLRPCEPI_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find XMLRPC-EPI library") - ENDIF (XMLRPCEPI_FIND_REQUIRED) -ENDIF (XMLRPCEPI_FOUND) - -# Deprecated declarations. -SET (NATIVE_XMLRPCEPI_INCLUDE_PATH ${XMLRPCEPI_INCLUDE_DIR} ) -GET_FILENAME_COMPONENT (NATIVE_XMLRPCEPI_LIB_PATH ${XMLRPCEPI_LIBRARY} PATH) - -MARK_AS_ADVANCED( - XMLRPCEPI_LIBRARY - XMLRPCEPI_INCLUDE_DIR - ) diff --git a/indra/cmake/FindZLIBNG.cmake b/indra/cmake/FindZLIBNG.cmake deleted file mode 100644 index 6e3c8cdddb..0000000000 --- a/indra/cmake/FindZLIBNG.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# -*- cmake -*- - -# - Find zlib-ng -# Find the ZLIB includes and library -# This module defines -# ZLIBNG_INCLUDE_DIRS, where to find zlib.h, etc. -# ZLIBNG_LIBRARIES, the libraries needed to use zlib. -# ZLIBNG_FOUND, If false, do not try to use zlib. -# -# This FindZLIBNG is about 43 times as fast the one provided with cmake (2.8.x), -# because it doesn't look up the version of zlib, resulting in a dramatic -# speed up for configure (from 4 minutes 22 seconds to 6 seconds). -# -# Note: Since this file is only used for standalone, the windows -# specific parts were left out. - -FIND_PATH(ZLIBNG_INCLUDE_DIR zlib.h - NO_SYSTEM_ENVIRONMENT_PATH - ) - -FIND_LIBRARY(ZLIBNG_LIBRARY z) - -if (ZLIBNG_LIBRARY AND ZLIBNG_INCLUDE_DIR) - SET(ZLIBNG_INCLUDE_DIRS ${ZLIBNG_INCLUDE_DIR}) - SET(ZLIBNG_LIBRARIES ${ZLIBNG_LIBRARY}) - SET(ZLIBNG_FOUND "YES") -else (ZLIBNG_LIBRARY AND ZLIBNG_INCLUDE_DIR) - SET(ZLIBNG_FOUND "NO") -endif (ZLINGB_LIBRARY AND ZLIBNG_INCLUDE_DIR) - -if (ZLIBNG_FOUND) - if (NOT ZLIBNG_FIND_QUIETLY) - message(STATUS "Found ZLIBNG: ${ZLIBNG_LIBRARIES}") - SET(ZLIBNG_FIND_QUIETLY TRUE) - endif (NOT ZLIBNG_FIND_QUIETLY) -else (ZLIBNG_FOUND) - if (ZLIBNG_FIND_REQUIRED) - message(FATAL_ERROR "Could not find ZLIBNG library") - endif (ZLIBNG_FIND_REQUIRED) -endif (ZLIBNG_FOUND) - -mark_as_advanced( - ZLIBNG_LIBRARY - ZLIBNG_INCLUDE_DIR - ) - diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 66f4ae0140..429bb5060b 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -6,13 +6,7 @@ if( TARGET freetype::freetype ) endif() create_target( freetype::freetype) -if (USESYSTEMLIBS) - include(FindPkgConfig) - - pkg_check_modules(FREETYPE REQUIRED freetype2) -else (USESYSTEMLIBS) - use_prebuilt_binary(freetype) - set_target_include_dirs( freetype::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) - set_target_libraries( freetype::freetype freetype ) -endif (USESYSTEMLIBS) +use_prebuilt_binary(freetype) +set_target_include_dirs( freetype::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) +set_target_libraries( freetype::freetype freetype ) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 9fd3923bfd..6562082d7e 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -1,10 +1,8 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) - if (WINDOWS OR LINUX) - use_prebuilt_binary(glext) - endif (WINDOWS OR LINUX) - use_prebuilt_binary(glh_linear) - set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) -endif (NOT USESYSTEMLIBS) +if (WINDOWS OR LINUX) + use_prebuilt_binary(glext) +endif (WINDOWS OR LINUX) +use_prebuilt_binary(glh_linear) +set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index d5262f2efa..d7e89afaec 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -4,8 +4,4 @@ include(Prebuilt) set(GLH_FIND_REQUIRED TRUE) set(GLH_FIND_QUIETLY TRUE) -if (USESYSTEMLIBS) - include(FindGLH) -else (USESYSTEMLIBS) - use_prebuilt_binary(glh_linear) -endif (USESYSTEMLIBS) +use_prebuilt_binary(glh_linear) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 8d41db4ea3..1a33644e9e 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -6,11 +6,7 @@ if( TARGET glod::glod ) endif() create_target( glod::glod ) -if (NOT USESYSTEMLIBS) - use_prebuilt_binary(glod) -endif (NOT USESYSTEMLIBS) - - +use_prebuilt_binary(glod) set(GLODLIB ON CACHE BOOL "Using GLOD library") diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake index 3fbc40ef8f..848d4f7fc6 100644 --- a/indra/cmake/GStreamer010Plugin.cmake +++ b/indra/cmake/GStreamer010Plugin.cmake @@ -1,12 +1,6 @@ # -*- cmake -*- include(Prebuilt) - -if (USESYSTEMLIBS) - include(FindPkgConfig) - - pkg_check_modules(GSTREAMER010 REQUIRED gstreamer-0.10) - pkg_check_modules(GSTREAMER010_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10) -elseif (LINUX) +if (LINUX) use_prebuilt_binary(gstreamer) # possible libxml2 should have its own .cmake file instead use_prebuilt_binary(libxml2) @@ -26,7 +20,7 @@ elseif (LINUX) gthread-2.0 glib-2.0 ) -endif (USESYSTEMLIBS) +endif () if (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND) set(GSTREAMER010 ON CACHE BOOL "Build with GStreamer-0.10 streaming media support.") diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 970b06b81f..81702cbd77 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -6,19 +6,15 @@ if( TARGET hunspell::hunspell ) endif() create_target( hunspell::hunspell ) -if (USESYSTEMLIBS) - include(FindHUNSPELL) -else (USESYSTEMLIBS) - use_prebuilt_binary(libhunspell) - if (WINDOWS) - set_target_libraries( hunspell::hunspell libhunspell) - elseif(DARWIN) - set_target_libraries( hunspell::hunspell hunspell-1.3) - elseif(LINUX) - set_target_libraries( hunspell::hunspell hunspell-1.3) - else() - message(FATAL_ERROR "Invalid platform") - endif() - set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) - use_prebuilt_binary(dictionaries) -endif (USESYSTEMLIBS) +use_prebuilt_binary(libhunspell) +if (WINDOWS) + set_target_libraries( hunspell::hunspell libhunspell) +elseif(DARWIN) + set_target_libraries( hunspell::hunspell hunspell-1.3) +elseif(LINUX) + set_target_libraries( hunspell::hunspell hunspell-1.3) +else() + message(FATAL_ERROR "Invalid platform") +endif() +set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) +use_prebuilt_binary(dictionaries) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index 7245ca7b36..d3bec7901f 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -8,16 +8,12 @@ if( TARGET jpeglib::jpeglib ) endif() create_target(jpeglib::jpeglib) -if (USESYSTEMLIBS) - include(FindJPEG) -else (USESYSTEMLIBS) - use_prebuilt_binary(jpeglib) - if (LINUX) - set_target_libraries( jpeglib::jpeglib jpeg) - elseif (DARWIN) - set_target_libraries( jpeglib::jpeglib jpeg) - elseif (WINDOWS) - set_target_libraries( jpeglib::jpeglib jpeglib) - endif (LINUX) - set_target_include_dirs( jpeglib::jpeglib ${LIBS_PREBUILT_DIR}/include) -endif (USESYSTEMLIBS) +use_prebuilt_binary(jpeglib) +if (LINUX) + set_target_libraries( jpeglib::jpeglib jpeg) +elseif (DARWIN) + set_target_libraries( jpeglib::jpeglib jpeg) +elseif (WINDOWS) + set_target_libraries( jpeglib::jpeglib jpeglib) +endif (LINUX) +set_target_include_dirs( jpeglib::jpeglib ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 14bfd32b6b..139735ed05 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -6,16 +6,12 @@ if( TARGET jsoncpp::jsoncpp ) endif() create_target( jsoncpp::jsoncpp) -if (USESYSTEMLIBS) - include(FindJsonCpp) -else (USESYSTEMLIBS) - use_prebuilt_binary(jsoncpp) - if (WINDOWS) - set_target_libraries( jsoncpp::jsoncpp json_libmd.lib ) - elseif (DARWIN) - set_target_libraries( jsoncpp::jsoncpp libjson_darwin_libmt.a ) - elseif (LINUX) - set_target_libraries( jsoncpp::jsoncpp libjson_linux-gcc-4.1.3_libmt.a ) - endif (WINDOWS) - set_target_include_dirs( jsoncpp::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) -endif (USESYSTEMLIBS) +use_prebuilt_binary(jsoncpp) +if (WINDOWS) + set_target_libraries( jsoncpp::jsoncpp json_libmd.lib ) +elseif (DARWIN) + set_target_libraries( jsoncpp::jsoncpp libjson_darwin_libmt.a ) +elseif (LINUX) + set_target_libraries( jsoncpp::jsoncpp libjson_linux-gcc-4.1.3_libmt.a ) +endif (WINDOWS) +set_target_include_dirs( jsoncpp::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 1a8003ea7f..2fa9a7cd96 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -223,10 +223,6 @@ FUNCTION(LL_ADD_INTEGRATION_TEST COMPILE_DEFINITIONS "LL_TEST=${testname};LL_TEST_${testname}" ) - if(USESYSTEMLIBS) - SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}") - endif(USESYSTEMLIBS) - if (USE_BUGSPLAT) SET_PROPERTY(SOURCE ${source_files} APPEND PROPERTY COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}") @@ -304,10 +300,6 @@ MACRO(SET_TEST_PATH LISTVAR) set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) ELSE(WINDOWS) # Linux uses a single staging directory anyway. - IF (USESYSTEMLIBS) - set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib) - ELSE (USESYSTEMLIBS) - set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) - ENDIF (USESYSTEMLIBS) + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) ENDIF(WINDOWS) ENDMACRO(SET_TEST_PATH) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index d0dca3dfdd..42d2a0f2c4 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,22 +9,11 @@ if( TARGET sdl::sdl) endif() create_target(sdl::sdl) -if (USESYSTEMLIBS) - include(FindSDL) - - # This should be done by FindSDL. Sigh. - mark_as_advanced( - SDLMAIN_LIBRARY - SDL_INCLUDE_DIR - SDL_LIBRARY - ) -else (USESYSTEMLIBS) - if (LINUX) - use_prebuilt_binary(SDL) - set_target_include_dirs( sdl::sdl ${LIBS_PREBUILT_DIR}/i686-linux) - set_target_libraries( sdl::sdl SDL directfb fusion direct X11) - target_compile_definitions( sdl::sdl INTERFACE LL_SDL=1) - endif (LINUX) -endif (USESYSTEMLIBS) +if (LINUX) + use_prebuilt_binary(SDL) + set_target_include_dirs( sdl::sdl ${LIBS_PREBUILT_DIR}/i686-linux) + set_target_libraries( sdl::sdl SDL directfb fusion direct X11) + target_compile_definitions( sdl::sdl INTERFACE LL_SDL=1) +endif (LINUX) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 2adedbfae3..12ba1720c7 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -7,15 +7,10 @@ if( TARGET libvlc::libvlc ) endif() create_target( libvlc::libvlc ) -if (USESYSTEMLIBS) - set(LIBVLCPLUGIN OFF CACHE BOOL +use_prebuilt_binary(vlc-bin) +set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -else (USESYSTEMLIBS) - use_prebuilt_binary(vlc-bin) - set(LIBVLCPLUGIN ON CACHE BOOL - "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") - set(VLC_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/vlc) -endif (USESYSTEMLIBS) +set(VLC_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/vlc) if (WINDOWS) set_target_libraries( libvlc::libvlc diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 7b64b23299..e5ec962f4c 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -9,23 +9,18 @@ endif() create_target( ndof::ndof ) if (NDOF) - if (USESYSTEMLIBS) - set(NDOF_FIND_REQUIRED ON) - include(FindNDOF) - else (USESYSTEMLIBS) - if (WINDOWS OR DARWIN) - use_prebuilt_binary(libndofdev) - elseif (LINUX) - use_prebuilt_binary(open-libndofdev) - endif (WINDOWS OR DARWIN) + if (WINDOWS OR DARWIN) + use_prebuilt_binary(libndofdev) + elseif (LINUX) + use_prebuilt_binary(open-libndofdev) + endif (WINDOWS OR DARWIN) - if (WINDOWS) - set_target_libraries( ndof::ndof libndofdev) - elseif (DARWIN OR LINUX) - set_target_libraries( ndof::ndof ndofdev) - endif (WINDOWS) - target_compile_definitions( ndof::ndof INTERFACE LIB_NDOF=1) - endif (USESYSTEMLIBS) + if (WINDOWS) + set_target_libraries( ndof::ndof libndofdev) + elseif (DARWIN OR LINUX) + set_target_libraries( ndof::ndof ndofdev) + endif (WINDOWS) + target_compile_definitions( ndof::ndof INTERFACE LIB_NDOF=1) endif (NDOF) if (NOT NDOF_FOUND) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 5215af5dd9..b1a0d33102 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -5,16 +5,12 @@ if( TARGET nghttp2::nghttp2 ) endif() create_target( nghttp2::nghttp2 ) -if (USESYSTEMLIBS) - include(FindNGHTTP2) -else (USESYSTEMLIBS) - use_prebuilt_binary(nghttp2) - if (WINDOWS) - set_target_libraries( nghttp2::nghttp2 ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) - elseif (DARWIN) - set_target_libraries( nghttp2::nghttp2 libnghttp2.dylib) - else (WINDOWS) - set_target_libraries( nghttp2::nghttp2 libnghttp2.a ) - endif (WINDOWS) - set_target_include_dirs( nghttp2::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) -endif (USESYSTEMLIBS) +use_prebuilt_binary(nghttp2) +if (WINDOWS) + set_target_libraries( nghttp2::nghttp2 ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) +elseif (DARWIN) + set_target_libraries( nghttp2::nghttp2 libnghttp2.dylib) +else (WINDOWS) + set_target_libraries( nghttp2::nghttp2 libnghttp2.a ) +endif (WINDOWS) +set_target_include_dirs( nghttp2::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index a5058b4bc3..ec60876419 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -16,14 +16,7 @@ if (OPENAL) create_target( openal::openal ) set_target_include_dirs( openal::openal "${LIBS_PREBUILT_DIR}/include/AL") - if (USESYSTEMLIBS) - include(FindPkgConfig) - include(FindOpenAL) - pkg_check_modules(OPENAL_LIB REQUIRED openal) - pkg_check_modules(FREEALUT_LIB REQUIRED freealut) - else (USESYSTEMLIBS) - use_prebuilt_binary(openal) - endif (USESYSTEMLIBS) + use_prebuilt_binary(openal) if(WINDOWS) set_target_libraries( openal::openal diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 67292250bb..e8aa231314 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -6,11 +6,7 @@ if( TARGET openjpeg::openjpeg ) endif() create_target( openjpeg::openjpeg ) -if (USESYSTEMLIBS) - include(FindOpenJPEG) -else (USESYSTEMLIBS) - use_prebuilt_binary(openjpeg) - - set_target_libraries(openjpeg::openjpeg openjpeg ) - set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) -endif (USESYSTEMLIBS) +use_prebuilt_binary(openjpeg) + +set_target_libraries(openjpeg::openjpeg openjpeg ) +set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 80b419c36e..0aa95922ed 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -6,17 +6,13 @@ if( TARGET openssl::openssl ) endif() create_target(openssl::openssl) -if (USESYSTEMLIBS) - include(FindOpenSSL) -else (USESYSTEMLIBS) - use_prebuilt_binary(openssl) - if (WINDOWS) - set_target_libraries(openssl::openssl libssl libcrypto) - elseif (LINUX) - set_target_libraries(openssl::openssl ssl crypto dl) - else() - set_target_libraries(openssl::openssl ssl crypto) - endif (WINDOWS) - set_target_include_dirs(openssl::openssl ${LIBS_PREBUILT_DIR}/include) -endif (USESYSTEMLIBS) +use_prebuilt_binary(openssl) +if (WINDOWS) + set_target_libraries(openssl::openssl libssl libcrypto) +elseif (LINUX) + set_target_libraries(openssl::openssl ssl crypto dl) +else() + set_target_libraries(openssl::openssl ssl crypto) +endif (WINDOWS) +set_target_include_dirs(openssl::openssl ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index cf338ebe5e..819904b6bd 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -6,17 +6,10 @@ if( TARGET libpng::libpng ) endif() create_target(libpng::libpng) -set(PNG_FIND_QUIETLY ON) -set(PNG_FIND_REQUIRED ON) - -if (USESYSTEMLIBS) - include(FindPNG) -else (USESYSTEMLIBS) - use_prebuilt_binary(libpng) - if (WINDOWS) - set_target_libraries(libpng::libpng libpng16) - else() - set_target_libraries(libpng::libpng png16 ) - endif() - set_target_include_dirs( libpng::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) -endif (USESYSTEMLIBS) +use_prebuilt_binary(libpng) +if (WINDOWS) + set_target_libraries(libpng::libpng libpng16) +else() + set_target_libraries(libpng::libpng png16 ) +endif() +set_target_include_dirs( libpng::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/PulseAudio.cmake b/indra/cmake/PulseAudio.cmake index cce27f1bdd..1b7adc1a62 100644 --- a/indra/cmake/PulseAudio.cmake +++ b/indra/cmake/PulseAudio.cmake @@ -4,23 +4,16 @@ include(Prebuilt) set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.") if (PULSEAUDIO) - if (USESYSTEMLIBS) - include(FindPkgConfig) - - pkg_check_modules(PULSEAUDIO libpulse) - - elseif (LINUX) - use_prebuilt_binary(pulseaudio) - set(PULSEAUDIO_FOUND ON FORCE BOOL) - set(PULSEAUDIO_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include - ) - # We don't need to explicitly link against pulseaudio itself, because - # the viewer probes for the system's copy at runtime. - set(PULSEAUDIO_LIBRARIES - # none needed! - ) - endif (USESYSTEMLIBS) + use_prebuilt_binary(pulseaudio) + set(PULSEAUDIO_FOUND ON FORCE BOOL) + set(PULSEAUDIO_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/include + ) + # We don't need to explicitly link against pulseaudio itself, because + # the viewer probes for the system's copy at runtime. + set(PULSEAUDIO_LIBRARIES + # none needed! + ) endif (PULSEAUDIO) if (PULSEAUDIO_FOUND) diff --git a/indra/cmake/Tut.cmake b/indra/cmake/Tut.cmake index e11a3c3314..ad93830803 100644 --- a/indra/cmake/Tut.cmake +++ b/indra/cmake/Tut.cmake @@ -1,6 +1,4 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) - use_prebuilt_binary(tut) -endif(NOT USESYSTEMLIBS) +use_prebuilt_binary(tut) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 77fd505df3..c12dca2ab9 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -2,67 +2,36 @@ include(Prebuilt) include(FreeType) -if (USESYSTEMLIBS) - include(FindPkgConfig) - - if (LINUX) - set(PKGCONFIG_PACKAGES - atk - cairo - gdk-2.0 - gdk-pixbuf-2.0 - glib-2.0 - gmodule-2.0 - gtk+-2.0 - gthread-2.0 - libpng - pango - pangoft2 - pangox - pangoxft - sdl - ) - endif (LINUX) - - foreach(pkg ${PKGCONFIG_PACKAGES}) - pkg_check_modules(${pkg} REQUIRED ${pkg}) - include_directories(${${pkg}_INCLUDE_DIRS}) - link_directories(${${pkg}_LIBRARY_DIRS}) - list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES}) - add_definitions(${${pkg}_CFLAGS_OTHERS}) - endforeach(pkg) -else (USESYSTEMLIBS) - if (LINUX) - use_prebuilt_binary(gtk-atk-pango-glib) - endif (LINUX) +if (LINUX) + use_prebuilt_binary(gtk-atk-pango-glib) +endif (LINUX) - if (LINUX) - set(UI_LIBRARIES - atk-1.0 - gdk-x11-2.0 - gdk_pixbuf-2.0 - Xinerama - glib-2.0 - gmodule-2.0 - gobject-2.0 - gthread-2.0 - gtk-x11-2.0 - pango-1.0 - pangoft2-1.0 - pangox-1.0 - pangoxft-1.0 - ${FREETYPE_LIBRARIES} - ) - endif (LINUX) +if (LINUX) + set(UI_LIBRARIES + atk-1.0 + gdk-x11-2.0 + gdk_pixbuf-2.0 + Xinerama + glib-2.0 + gmodule-2.0 + gobject-2.0 + gthread-2.0 + gtk-x11-2.0 + pango-1.0 + pangoft2-1.0 + pangox-1.0 + pangoxft-1.0 + ${FREETYPE_LIBRARIES} + ) +endif (LINUX) - include_directories ( - ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include - ) - foreach(include ${${LL_ARCH}_INCLUDES}) - include_directories(${LIBS_PREBUILT_DIR}/include/${include}) - endforeach(include) -endif (USESYSTEMLIBS) +include_directories ( + ${LIBS_PREBUILT_DIR}/include + ${LIBS_PREBUILT_DIR}/include +) +foreach(include ${${LL_ARCH}_INCLUDES}) + include_directories(${LIBS_PREBUILT_DIR}/include/${include}) +endforeach(include) if (LINUX) add_definitions(-DLL_GTK=1 -DLL_X11=1) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index 55b38fca28..3afd8cd6c9 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -7,16 +7,12 @@ create_target( uriparser::uriparser ) include(Prebuilt) -if (USESYSTEMLIBS) - include(FindURIPARSER) -else (USESYSTEMLIBS) - use_prebuilt_binary(uriparser) - if (WINDOWS) - set_target_libraries( uriparser::uriparser uriparser) - elseif (LINUX) - set_target_libraries( uriparser::uriparser uriparser) - elseif (DARWIN) - set_target_libraries( uriparser::uriparser liburiparser.dylib) - endif (WINDOWS) - set_target_include_dirs( uriparser::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) -endif (USESYSTEMLIBS) +use_prebuilt_binary(uriparser) +if (WINDOWS) + set_target_libraries( uriparser::uriparser uriparser) +elseif (LINUX) + set_target_libraries( uriparser::uriparser uriparser) +elseif (DARWIN) + set_target_libraries( uriparser::uriparser liburiparser.dylib) +endif (WINDOWS) +set_target_include_dirs( uriparser::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index e72475cbc4..56916504b5 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -214,7 +214,6 @@ set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.") set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside") -set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.") set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.") diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index fc5bdedb5a..1dff854855 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,12 +1,10 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) - if (LINUX) - use_prebuilt_binary(libuuid) - use_prebuilt_binary(fontconfig) - endif (LINUX) - use_prebuilt_binary(libhunspell) - use_prebuilt_binary(slvoice) -endif(NOT USESYSTEMLIBS) +if (LINUX) + use_prebuilt_binary(libuuid) + use_prebuilt_binary(fontconfig) +endif (LINUX) +use_prebuilt_binary(libhunspell) +use_prebuilt_binary(slvoice) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 75b94acc50..28a9a10e40 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -6,10 +6,6 @@ if( TARGET xmlrpc-epi::xmlrpc-epi ) endif() create_target( xmlrpc-epi::xmlrpc-epi ) -if (USESYSTEMLIBS) - include(FindXmlRpcEpi) -else (USESYSTEMLIBS) - use_prebuilt_binary(xmlrpc-epi) - set_target_libraries(xmlrpc-epi::xmlrpc-epi xmlrpc-epi ) - set_target_include_dirs( xmlrpc-epi::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) -endif (USESYSTEMLIBS) +use_prebuilt_binary(xmlrpc-epi) +set_target_libraries(xmlrpc-epi::xmlrpc-epi xmlrpc-epi ) +set_target_include_dirs( xmlrpc-epi::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 5aaca60664..d5e882cb68 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -7,14 +7,10 @@ if( TARGET zlib-ng::zlib-ng ) endif() create_target(zlib-ng::zlib-ng) -if (USESYSTEMLIBS) - include(FindZLIBNG) -else (USESYSTEMLIBS) - use_prebuilt_binary(zlib-ng) - if (WINDOWS) - set_target_libraries( zlib-ng::zlib-ng zlib ) - else() - set_target_libraries( zlib-ng::zlib-ng z ) - endif (WINDOWS) - set_target_include_dirs( zlib-ng::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) -endif (USESYSTEMLIBS) +use_prebuilt_binary(zlib-ng) +if (WINDOWS) + set_target_libraries( zlib-ng::zlib-ng zlib ) +else() + set_target_libraries( zlib-ng::zlib-ng z ) +endif (WINDOWS) +set_target_include_dirs( zlib-ng::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 820ca8652c..75d5239b47 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -15,25 +15,21 @@ endif() create_target(bugsplat::bugsplat) if (USE_BUGSPLAT) - if (NOT USESYSTEMLIBS) - include(Prebuilt) - use_prebuilt_binary(bugsplat) - if (WINDOWS) - set_target_libraries( bugsplat::bugsplat + include(Prebuilt) + use_prebuilt_binary(bugsplat) + if (WINDOWS) + set_target_libraries( bugsplat::bugsplat ${ARCH_PREBUILT_DIRS_RELEASE}/bugsplat.lib ) - elseif (DARWIN) - find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED + elseif (DARWIN) + find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") - set_target_libraries( bugsplat::bugsplat - ${BUGSPLAT_LIBRARIES} - ) - else (WINDOWS) - message(FATAL_ERROR "BugSplat is not supported; add -DUSE_BUGSPLAT=OFF") - endif (WINDOWS) - else (NOT USESYSTEMLIBS) - include(FindBUGSPLAT) - endif (NOT USESYSTEMLIBS) + set_target_libraries( bugsplat::bugsplat + ${BUGSPLAT_LIBRARIES} + ) + else (WINDOWS) + message(FATAL_ERROR "BugSplat is not supported; add -DUSE_BUGSPLAT=OFF") + endif (WINDOWS) set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") -- cgit v1.2.3 From 241919e7f7986c11586a49bff53cf19c2c0e0ea6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:21:55 +0200 Subject: Rework cmake, the original plan was to maybe be able to use conan targets with the same name (that's why 3ps had names like apr::apr), but it's safer and saner to put the LL 3ps under the ll:: prefix. This also allows means it is possible to get rid of that bad "if( TRAGET ...) return() endif()" pattern and rather use include_guard(). --- indra/cmake/00-Common.cmake | 5 +---- indra/cmake/APR.cmake | 14 ++++++-------- indra/cmake/Audio.cmake | 12 +++++------- indra/cmake/Boost.cmake | 16 +++++----------- indra/cmake/CEFPlugin.cmake | 4 +--- indra/cmake/CURL.cmake | 12 +++++------- indra/cmake/EXPAT.cmake | 12 +++++------- indra/cmake/FMODSTUDIO.cmake | 15 +++++++-------- indra/cmake/FreeType.cmake | 10 ++++------ indra/cmake/GLOD.cmake | 10 ++++------ indra/cmake/GoogleMock.cmake | 17 ++++++++--------- indra/cmake/Havok.cmake | 4 +--- indra/cmake/Hunspell.cmake | 16 ++++++---------- indra/cmake/JPEG.cmake | 14 ++++++-------- indra/cmake/JsonCpp.cmake | 14 ++++++-------- indra/cmake/LLAddBuildTest.cmake | 4 ++-- indra/cmake/LLKDU.cmake | 12 +++++------- indra/cmake/LLPhysicsExtensions.cmake | 4 +--- indra/cmake/LLPrimitive.cmake | 30 ++++++++++++++---------------- indra/cmake/LLWindow.cmake | 12 +++++------- indra/cmake/LibVLCPlugin.cmake | 12 +++++------- indra/cmake/Linking.cmake | 5 +---- indra/cmake/NDOF.cmake | 12 +++++------- indra/cmake/NGHTTP2.cmake | 14 ++++++-------- indra/cmake/NVAPI.cmake | 8 ++------ indra/cmake/OPENAL.cmake | 14 ++++++-------- indra/cmake/OpenJPEG.cmake | 10 ++++------ indra/cmake/OpenSSL.cmake | 14 ++++++-------- indra/cmake/PNG.cmake | 12 +++++------- indra/cmake/Prebuilt.cmake | 6 +----- indra/cmake/URIPARSER.cmake | 14 ++++++-------- indra/cmake/Variables.cmake | 5 +---- indra/cmake/XmlRpcEpi.cmake | 10 ++++------ indra/cmake/ZLIBNG.cmake | 12 +++++------- indra/cmake/bugsplat.cmake | 10 ++++------ 35 files changed, 158 insertions(+), 237 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 54b74b14fb..ec0e195b56 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -12,9 +12,7 @@ # Also realize that CMAKE_CXX_FLAGS may already be partially populated on # entry to this file. #***************************************************************************** - -if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") +include_guard() include(Variables) @@ -200,4 +198,3 @@ set(${ARCH}_linux_INCLUDES pango-1.0 ) -endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 63ea195fad..269b0f3000 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -1,11 +1,9 @@ include(Linking) include(Prebuilt) -if( TARGET apr::apr ) - return() -endif() +include_guard() -create_target( apr::apr) +create_target( ll::apr) use_prebuilt_binary(apr_suite) if (WINDOWS) @@ -14,7 +12,7 @@ if (WINDOWS) else (LLCOMMON_LINK_SHARED) set(APR_selector "") endif (LLCOMMON_LINK_SHARED) - set_target_libraries( apr::apr + set_target_libraries( ll::apr ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib @@ -28,13 +26,13 @@ elseif (DARWIN) set(APRUTIL_selector "a") endif (LLCOMMON_LINK_SHARED) - set_target_libraries( apr::apr + set_target_libraries( ll::apr libapr-1.${APR_selector} libaprutil-1.${APRUTIL_selector} iconv ) else (WINDOWS) - set_target_libraries( apr::apr + set_target_libraries( ll::apr apr-1 aprutil-1 iconv @@ -42,4 +40,4 @@ else (WINDOWS) rt ) endif (WINDOWS) -set_target_include_dirs( apr::apr ${LIBS_PREBUILT_DIR}/include/apr-1 ) +set_target_include_dirs( ll::apr ${LIBS_PREBUILT_DIR}/include/apr-1 ) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index bf95a8eef1..e533d1ac00 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -1,17 +1,15 @@ # -*- cmake -*- include(Prebuilt) -if(TARGET vorbis::vorbis) - return() -endif() -create_target(vorbis::vorbis) +include_guard() +create_target(ll::vorbis) use_prebuilt_binary(ogg_vorbis) -set_target_include_dirs( vorbis::vorbis ${LIBS_PREBUILT_DIR}/include ) +set_target_include_dirs( ll::vorbis ${LIBS_PREBUILT_DIR}/include ) if (WINDOWS) - set_target_libraries(vorbis::vorbis ogg_static vorbis_static vorbisenc_static vorbisfile_static ) + set_target_libraries(ll::vorbis ogg_static vorbis_static vorbisenc_static vorbisfile_static ) else (WINDOWS) - set_target_libraries(vorbis::vorbis ogg vorbis vorbisenc vorbisfile ) + set_target_libraries(ll::vorbis ogg vorbis vorbisenc vorbisfile ) endif (WINDOWS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 2102ee3887..ac6151ffe3 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -1,23 +1,17 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET boost::boost ) - return() -endif() -create_target( boost::boost ) - -set(Boost_FIND_QUIETLY ON) -set(Boost_FIND_REQUIRED ON) +include_guard() +create_target( ll::boost ) use_prebuilt_binary(boost) -set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) # As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed # with the address size. set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) - set_target_libraries( boost::boost + set_target_libraries( ll::boost libboost_context-mt${addrsfx} libboost_fiber-mt${addrsfx} libboost_filesystem-mt${addrsfx} @@ -26,7 +20,7 @@ if (WINDOWS) libboost_system-mt${addrsfx} libboost_thread-mt${addrsfx}) elseif (LINUX) - set_target_libraries( boost::boost + set_target_libraries( ll::boost boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} @@ -36,7 +30,7 @@ elseif (LINUX) boost_system-mt${addrsfx} boost_thread-mt${addrsfx}) elseif (DARWIN) - set_target_libraries( boost::boost + set_target_libraries( ll::boost boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index bcce4cfa05..6dba5e26ac 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -2,9 +2,7 @@ include(Linking) include(Prebuilt) -if(TARGET cef::cef) - return() -endif() +include_guard() create_target( cef::cef ) use_prebuilt_binary(dullahan) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index 455d420e48..2a5ea67ff3 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -1,15 +1,13 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET libcurl::libcurl ) - return() -endif() -create_target(libcurl::libcurl) +include_guard() +create_target(ll::libcurl) use_prebuilt_binary(curl) if (WINDOWS) - set_target_libraries(libcurl::libcurl libcurl.lib) + set_target_libraries(ll::libcurl libcurl.lib) else (WINDOWS) - set_target_libraries(libcurl::libcurl libcurl.a) + set_target_libraries(ll::libcurl libcurl.a) endif (WINDOWS) -set_target_include_dirs( libcurl::libcurl ${LIBS_PREBUILT_DIR}/include) +set_target_include_dirs( ll::libcurl ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index fb0467987b..85bb146a4a 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -1,21 +1,19 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET expat::expat ) - return() -endif() -create_target( expat::expat INTERFACE IMPORTED ) +include_guard() +create_target( ll::expat INTERFACE IMPORTED ) use_prebuilt_binary(expat) if (WINDOWS) - set_target_libraries( expat::expat libexpatMT ) + set_target_libraries( ll::expat libexpatMT ) set(EXPAT_COPY libexpatMT.dll) else (WINDOWS) - set_target_libraries( expat::expat expat ) + set_target_libraries( ll::expat expat ) if (DARWIN) set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) else () set(EXPAT_COPY libexpat.so.1 libexpat.so) endif () endif (WINDOWS) -set_target_include_dirs( expat::expat ${LIBS_PREBUILT_DIR}/include ) +set_target_include_dirs( ll::expat ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 41a75741c9..653d96f86a 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -1,5 +1,7 @@ # -*- cmake -*- +include_guard() + # FMODSTUDIO can be set when launching the make using the argument -DFMODSTUDIO:BOOL=ON # When building using proprietary binaries though (i.e. having access to LL private servers), # we always build with FMODSTUDIO. @@ -8,10 +10,7 @@ if (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) if (FMODSTUDIO) - if( TARGET fmodstudio::fmodstudio ) - return() - endif() - create_target( fmodstudio::fmodstudio ) + create_target( ll::fmodstudio ) if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If the path have been specified in the arguments, use that @@ -25,15 +24,15 @@ if (FMODSTUDIO) include(Prebuilt) use_prebuilt_binary(fmodstudio) if (WINDOWS) - set_target_libraries( fmodstudio::fmodstudio fmod_vc) + set_target_libraries( ll::fmodstudio fmod_vc) elseif (DARWIN) #despite files being called libfmod.dylib, we are searching for fmod - set_target_libraries( fmodstudio::fmodstudio fmod) + set_target_libraries( ll::fmodstudio fmod) elseif (LINUX) - set_target_libraries( fmodstudio::fmodstudio fmod) + set_target_libraries( ll::fmodstudio fmod) endif (WINDOWS) - set_target_include_dirs(fmodstudio::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) + set_target_include_dirs(ll::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) endif (FMODSTUDIO) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 429bb5060b..243f22586b 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,12 +1,10 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET freetype::freetype ) - return() -endif() -create_target( freetype::freetype) +include_guard() +create_target( ll::freetype) use_prebuilt_binary(freetype) -set_target_include_dirs( freetype::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) -set_target_libraries( freetype::freetype freetype ) +set_target_include_dirs( ll::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) +set_target_libraries( ll::freetype freetype ) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 1a33644e9e..2d7f85030f 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -1,14 +1,12 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET glod::glod ) - return() -endif() -create_target( glod::glod ) +include_guard() +create_target( ll::glod ) use_prebuilt_binary(glod) set(GLODLIB ON CACHE BOOL "Using GLOD library") -set_target_include_dirs( glod::glod ${LIBS_PREBUILT_DIR}/include) -set_target_libraries( glod::glod GLOD ) +set_target_include_dirs( ll::glod ${LIBS_PREBUILT_DIR}/include) +set_target_libraries( ll::glod GLOD ) diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 821346ced6..1f161ec4ff 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -2,27 +2,26 @@ include(Prebuilt) include(Linking) +include_guard() + use_prebuilt_binary(googlemock) -if( TARGET googlemock::googlemock ) - return() -endif() -create_target( googlemock::googlemock ) -set_target_include_dirs( googlemock::googlemock +create_target( ll::googlemock ) +set_target_include_dirs( ll::googlemock ${LIBS_PREBUILT_DIR}/include ) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set_target_libraries( googlemock::googlemock gmock gtest) + set_target_libraries( ll::googlemock gmock gtest) elseif(WINDOWS) - set_target_libraries( googlemock::googlemock gmock) - set_target_include_dirs( googlemock::googlemock + set_target_libraries( ll::googlemock gmock) + set_target_include_dirs( ll::googlemock ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock) elseif(DARWIN) - set_target_libraries( googlemock::googlemock gmock gtest) + set_target_libraries( ll::googlemock gmock gtest) endif(LINUX) diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake index 811a126b8f..652760e626 100644 --- a/indra/cmake/Havok.cmake +++ b/indra/cmake/Havok.cmake @@ -1,7 +1,6 @@ # -*- cmake -*- include(Prebuilt) -if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") +include_guard() use_prebuilt_binary(havok-source) @@ -124,4 +123,3 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) endif (LINUX) endforeach(HAVOK_LIB) -endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 81702cbd77..258a27b5de 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -1,20 +1,16 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET hunspell::hunspell ) - return() -endif() -create_target( hunspell::hunspell ) +include_guard() +create_target( ll::hunspell ) use_prebuilt_binary(libhunspell) if (WINDOWS) - set_target_libraries( hunspell::hunspell libhunspell) + set_target_libraries( ll::hunspell libhunspell) elseif(DARWIN) - set_target_libraries( hunspell::hunspell hunspell-1.3) + set_target_libraries( ll::hunspell hunspell-1.3) elseif(LINUX) - set_target_libraries( hunspell::hunspell hunspell-1.3) -else() - message(FATAL_ERROR "Invalid platform") + set_target_libraries( ll::hunspell hunspell-1.3) endif() -set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) +set_target_include_dirs( ll::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index d3bec7901f..e6ff4b7b72 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -3,17 +3,15 @@ include(Prebuilt) include(Linking) -if( TARGET jpeglib::jpeglib ) - return() -endif() -create_target(jpeglib::jpeglib) +include_guard() +create_target(ll::jpeglib) use_prebuilt_binary(jpeglib) if (LINUX) - set_target_libraries( jpeglib::jpeglib jpeg) + set_target_libraries( ll::jpeglib jpeg) elseif (DARWIN) - set_target_libraries( jpeglib::jpeglib jpeg) + set_target_libraries( ll::jpeglib jpeg) elseif (WINDOWS) - set_target_libraries( jpeglib::jpeglib jpeglib) + set_target_libraries( ll::jpeglib jpeglib) endif (LINUX) -set_target_include_dirs( jpeglib::jpeglib ${LIBS_PREBUILT_DIR}/include) +set_target_include_dirs( ll::jpeglib ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 139735ed05..a155c6ea78 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -1,17 +1,15 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET jsoncpp::jsoncpp ) - return() -endif() -create_target( jsoncpp::jsoncpp) +include_guard() +create_target( ll::jsoncpp) use_prebuilt_binary(jsoncpp) if (WINDOWS) - set_target_libraries( jsoncpp::jsoncpp json_libmd.lib ) + set_target_libraries( ll::jsoncpp json_libmd.lib ) elseif (DARWIN) - set_target_libraries( jsoncpp::jsoncpp libjson_darwin_libmt.a ) + set_target_libraries( ll::jsoncpp libjson_darwin_libmt.a ) elseif (LINUX) - set_target_libraries( jsoncpp::jsoncpp libjson_linux-gcc-4.1.3_libmt.a ) + set_target_libraries( ll::jsoncpp libjson_linux-gcc-4.1.3_libmt.a ) endif (WINDOWS) -set_target_include_dirs( jsoncpp::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) +set_target_include_dirs( ll::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 2fa9a7cd96..a3c873b389 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -45,7 +45,7 @@ INCLUDE(GoogleMock) ) SET(alltest_LIBRARIES llcommon - googlemock::googlemock + ll::googlemock ${PTHREAD_LIBRARY} ${WINDOWS_LIBRARIES} ) @@ -208,7 +208,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST SET(libraries ${LEGACY_STDIO_LIBS} ${library_dependencies} - googlemock::googlemock + ll::googlemock ${PTHREAD_LIBRARY} ) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index a0463be635..a57c3d8715 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -7,21 +7,19 @@ if (INSTALL_PROPRIETARY) set(USE_KDU ON CACHE BOOL "Use Kakadu library.") endif (INSTALL_PROPRIETARY) -if( TARGET kdu::kdu ) - return() -endif() -create_target( kdu::kdu ) +include_guard() +create_target( ll::kdu ) if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - set_target_libraries( kdu::kdu kdu.lib) + set_target_libraries( ll::kdu kdu.lib) else (WINDOWS) - set_target_libraries( kdu::kdu libkdu.a) + set_target_libraries( ll::kdu libkdu.a) endif (WINDOWS) - set_target_include_dirs( kdu::kdu + set_target_include_dirs( ll::kdu ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index c46a04129a..b51c4c622a 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -10,9 +10,7 @@ if (INSTALL_PROPRIETARY) set(HAVOK ON CACHE BOOL "Use Havok physics library") endif (INSTALL_PROPRIETARY) -if(TARGET llphysicsextensions ) - return() -endif() +include_guard() create_target(llphysicsextensions) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 799afc77d1..0f0e2d3bbf 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -4,41 +4,39 @@ include(Prebuilt) include(Boost) -if( TARGET colladadom::colladadom ) - return() -endif() +include_guard() use_prebuilt_binary(colladadom) use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(pcre) use_prebuilt_binary(libxml2) -create_target( pcre::pcre ) -set_target_libraries( pcre::pcre pcrecpp pcre ) +create_target( ll::pcre ) +set_target_libraries( ll::pcre pcrecpp pcre ) -create_target( minizip-ng::minizip-ng ) +create_target( ll::minizip-ng ) if (WINDOWS) - set_target_libraries( minizip-ng::minizip-ng libminizip ) + set_target_libraries( ll::minizip-ng libminizip ) else() - set_target_libraries( minizip-ng::minizip-ng minizip ) + set_target_libraries( ll::minizip-ng minizip ) endif() -create_target( libxml::libxml ) +create_target( ll::libxml ) if (WINDOWS) - set_target_libraries( libxml::libxml libxml2_a) + set_target_libraries( ll::libxml libxml2_a) else() - set_target_libraries( libxml::libxml xml2) + set_target_libraries( ll::libxml xml2) endif() -create_target( colladadom::colladadom ) -set_target_include_dirs( colladadom::colladadom +create_target( ll::colladadom ) +set_target_include_dirs( ll::colladadom ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) if (WINDOWS) - set_target_libraries(colladadom::colladadom libcollada14dom23-s libxml::libxml minizip-ng::minizip-ng ) + set_target_libraries(ll::colladadom libcollada14dom23-s ll::libxml ll::minizip-ng ) elseif (DARWIN) - set_target_libraries(colladadom::colladadom collada14dom libxml::libxml minizip-ng::minizip-ng) + set_target_libraries(ll::colladadom collada14dom ll::libxml ll::minizip-ng) elseif (LINUX) - set_target_libraries(colladadom::colladadom collada14dom libxml::libxml minizip-ng::minizip-ng) + set_target_libraries(ll::colladadom collada14dom ll::libxml ll::minizip-ng) endif() \ No newline at end of file diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 42d2a0f2c4..2bbaff942d 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -4,16 +4,14 @@ include(Variables) include(GLEXT) include(Prebuilt) -if( TARGET sdl::sdl) - return() -endif() -create_target(sdl::sdl) +include_guard() +create_target(ll::sdl) if (LINUX) use_prebuilt_binary(SDL) - set_target_include_dirs( sdl::sdl ${LIBS_PREBUILT_DIR}/i686-linux) - set_target_libraries( sdl::sdl SDL directfb fusion direct X11) - target_compile_definitions( sdl::sdl INTERFACE LL_SDL=1) + set_target_include_dirs( ll::sdl ${LIBS_PREBUILT_DIR}/i686-linux) + set_target_libraries( ll::sdl SDL directfb fusion direct X11) + target_compile_definitions( ll::sdl INTERFACE LL_SDL=1) endif (LINUX) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 12ba1720c7..1648bfd942 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -2,10 +2,8 @@ include(Linking) include(Prebuilt) -if( TARGET libvlc::libvlc ) - return() -endif() -create_target( libvlc::libvlc ) +include_guard() +create_target( ll::libvlc ) use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL @@ -13,18 +11,18 @@ set(LIBVLCPLUGIN ON CACHE BOOL set(VLC_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/vlc) if (WINDOWS) - set_target_libraries( libvlc::libvlc + set_target_libraries( ll::libvlc libvlc.lib libvlccore.lib ) elseif (DARWIN) - set_target_libraries( libvlc::libvlc + set_target_libraries( ll::libvlc libvlc.dylib libvlccore.dylib ) elseif (LINUX) # Specify a full path to make sure we get a static link - set_target_libraries( liblvc::libvlc + set_target_libraries( ll::libvlc ${LIBS_PREBUILT_DIR}/lib/libvlc.a ${LIBS_PREBUILT_DIR}/lib/libvlccore.a ) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index d3e82f8c3a..4a57a6a3ef 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -1,8 +1,6 @@ # -*- cmake -*- -if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") - +include_guard() include(Variables) set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib) @@ -86,4 +84,3 @@ endif (WINDOWS) mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES) -endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index e5ec962f4c..75936425ff 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -3,10 +3,8 @@ include(Prebuilt) set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.") -if ( TARGET ndof::ndof ) - return() -endif() -create_target( ndof::ndof ) +include_guard() +create_target( ll::ndof ) if (NDOF) if (WINDOWS OR DARWIN) @@ -16,11 +14,11 @@ if (NDOF) endif (WINDOWS OR DARWIN) if (WINDOWS) - set_target_libraries( ndof::ndof libndofdev) + set_target_libraries( ll::ndof libndofdev) elseif (DARWIN OR LINUX) - set_target_libraries( ndof::ndof ndofdev) + set_target_libraries( ll::ndof ndofdev) endif (WINDOWS) - target_compile_definitions( ndof::ndof INTERFACE LIB_NDOF=1) + target_compile_definitions( ll::ndof INTERFACE LIB_NDOF=1) endif (NDOF) if (NOT NDOF_FOUND) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index b1a0d33102..e92f0da2ef 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -1,16 +1,14 @@ include(Prebuilt) -if( TARGET nghttp2::nghttp2 ) - return() -endif() -create_target( nghttp2::nghttp2 ) +include_guard() +create_target( ll::nghttp2 ) use_prebuilt_binary(nghttp2) if (WINDOWS) - set_target_libraries( nghttp2::nghttp2 ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) + set_target_libraries( ll::nghttp2 ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) elseif (DARWIN) - set_target_libraries( nghttp2::nghttp2 libnghttp2.dylib) + set_target_libraries( ll::nghttp2 libnghttp2.dylib) else (WINDOWS) - set_target_libraries( nghttp2::nghttp2 libnghttp2.a ) + set_target_libraries( ll::nghttp2 libnghttp2.a ) endif (WINDOWS) -set_target_include_dirs( nghttp2::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) +set_target_include_dirs( ll::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index 1eea96784f..63e5dd12de 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -5,13 +5,9 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) - create_target( nvapi::nvapi ) - set_target_libraries( nvapi::nvapi nvapi) + create_target( ll::nvapi ) + set_target_libraries( ll::nvapi nvapi) use_prebuilt_binary(nvapi) - else (WINDOWS) - set(NVAPI_LIBRARY "") endif (WINDOWS) -else (NVAPI) - set(NVAPI_LIBRARY "") endif (NVAPI) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index ec60876419..9904f6d1c0 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -2,6 +2,8 @@ include(Linking) include(Prebuilt) +include_guard() + if (LINUX) set(OPENAL ON CACHE BOOL "Enable OpenAL") else (LINUX) @@ -9,22 +11,18 @@ else (LINUX) endif (LINUX) if (OPENAL) - if( TARGET openal::openal ) - return() - endif() - - create_target( openal::openal ) - set_target_include_dirs( openal::openal "${LIBS_PREBUILT_DIR}/include/AL") + create_target( ll::openal ) + set_target_include_dirs( ll::openal "${LIBS_PREBUILT_DIR}/include/AL") use_prebuilt_binary(openal) if(WINDOWS) - set_target_libraries( openal::openal + set_target_libraries( ll::openal OpenAL32 alut ) elseif(LINUX) - set_target_libraries( openal::openal + set_target_libraries( ll::openal openal alut ) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index e8aa231314..7d4d0f467a 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -1,12 +1,10 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET openjpeg::openjpeg ) - return() -endif() -create_target( openjpeg::openjpeg ) +include_guard() +create_target( ll::openjpeg ) use_prebuilt_binary(openjpeg) -set_target_libraries(openjpeg::openjpeg openjpeg ) -set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) +set_target_libraries(ll::openjpeg openjpeg ) +set_target_include_dirs( ll::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 0aa95922ed..d586396105 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -1,18 +1,16 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET openssl::openssl ) - return() -endif() -create_target(openssl::openssl) +include_guard() +create_target(ll::openssl) use_prebuilt_binary(openssl) if (WINDOWS) - set_target_libraries(openssl::openssl libssl libcrypto) + set_target_libraries(ll::openssl libssl libcrypto) elseif (LINUX) - set_target_libraries(openssl::openssl ssl crypto dl) + set_target_libraries(ll::openssl ssl crypto dl) else() - set_target_libraries(openssl::openssl ssl crypto) + set_target_libraries(ll::openssl ssl crypto) endif (WINDOWS) -set_target_include_dirs(openssl::openssl ${LIBS_PREBUILT_DIR}/include) +set_target_include_dirs(ll::openssl ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 819904b6bd..2838a6b667 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -1,15 +1,13 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET libpng::libpng ) - return() -endif() -create_target(libpng::libpng) +include_guard() +create_target(ll::libpng) use_prebuilt_binary(libpng) if (WINDOWS) - set_target_libraries(libpng::libpng libpng16) + set_target_libraries(ll::libpng libpng16) else() - set_target_libraries(libpng::libpng png16 ) + set_target_libraries(ll::libpng png16 ) endif() -set_target_include_dirs( libpng::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) +set_target_include_dirs( ll::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 9125f2f80f..9e8adf5af1 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -1,7 +1,5 @@ # -*- cmake -*- - -if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") +include_guard() include(FindAutobuild) if(INSTALL_PROPRIETARY) @@ -71,5 +69,3 @@ function( set_target_include_dirs target) set_property( TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ARGN} ) endfunction() - -endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index 3afd8cd6c9..35f37b4472 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -1,18 +1,16 @@ # -*- cmake -*- -if( TARGET uriparser::uriparser ) - return() -endif() -create_target( uriparser::uriparser ) +include_guard() +create_target( ll::uriparser ) include(Prebuilt) use_prebuilt_binary(uriparser) if (WINDOWS) - set_target_libraries( uriparser::uriparser uriparser) + set_target_libraries( ll::uriparser uriparser) elseif (LINUX) - set_target_libraries( uriparser::uriparser uriparser) + set_target_libraries( ll::uriparser uriparser) elseif (DARWIN) - set_target_libraries( uriparser::uriparser liburiparser.dylib) + set_target_libraries( ll::uriparser liburiparser.dylib) endif (WINDOWS) -set_target_include_dirs( uriparser::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) +set_target_include_dirs( ll::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 56916504b5..0cc4b85583 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -15,12 +15,10 @@ if ("$ENV{LL_BUILD}" STREQUAL "") message(FATAL_ERROR "Environment variable LL_BUILD must be set") endif () +include_guard() # Relative and absolute paths to subtrees. -if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") - if(NOT DEFINED COMMON_CMAKE_DIR) set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake") endif(NOT DEFINED COMMON_CMAKE_DIR) @@ -219,4 +217,3 @@ set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header dire source_group("CMake Rules" FILES CMakeLists.txt) -endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 28a9a10e40..b2d1d96562 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -1,11 +1,9 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET xmlrpc-epi::xmlrpc-epi ) - return() -endif() -create_target( xmlrpc-epi::xmlrpc-epi ) +include_guard() +create_target( ll::xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) -set_target_libraries(xmlrpc-epi::xmlrpc-epi xmlrpc-epi ) -set_target_include_dirs( xmlrpc-epi::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) +set_target_libraries(ll::xmlrpc-epi xmlrpc-epi ) +set_target_include_dirs( ll::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index d5e882cb68..6e206f1e48 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -2,15 +2,13 @@ include(Prebuilt) -if( TARGET zlib-ng::zlib-ng ) - return() -endif() -create_target(zlib-ng::zlib-ng) +include_guard() +create_target(ll::zlib-ng) use_prebuilt_binary(zlib-ng) if (WINDOWS) - set_target_libraries( zlib-ng::zlib-ng zlib ) + set_target_libraries( ll::zlib-ng zlib ) else() - set_target_libraries( zlib-ng::zlib-ng z ) + set_target_libraries( ll::zlib-ng z ) endif (WINDOWS) -set_target_include_dirs( zlib-ng::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) +set_target_include_dirs( ll::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 75d5239b47..ce5660aa05 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -9,10 +9,8 @@ else (INSTALL_PROPRIETARY) set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") endif (INSTALL_PROPRIETARY) -if( TARGET bugsplat::bugsplat) - return() -endif() -create_target(bugsplat::bugsplat) +include_guard() +create_target(ll::bugsplat) if (USE_BUGSPLAT) include(Prebuilt) @@ -33,7 +31,7 @@ if (USE_BUGSPLAT) set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") - set_target_include_dirs( bugsplat::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) - set_property( TARGET bugsplat::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) + set_target_include_dirs( ll::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) + set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) endif (USE_BUGSPLAT) -- cgit v1.2.3 From 6417836e69aa9250b19955937fe9cd0965c4c8ba Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:27:02 +0200 Subject: FindSCP.cmake is used when INSTALL_PROPRIETARY is set. Not sure what the latter does, but I suppose some internal logic on the LL build farm. --- indra/cmake/FindSCP.cmake | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 indra/cmake/FindSCP.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/FindSCP.cmake b/indra/cmake/FindSCP.cmake new file mode 100644 index 0000000000..ea02102908 --- /dev/null +++ b/indra/cmake/FindSCP.cmake @@ -0,0 +1,40 @@ +# -*- cmake -*- +# +# Find the OpenSSH scp ("secure copy") or Putty pscp command. +# +# Input variables: +# SCP_FIND_REQUIRED - set this if configuration should fail without scp +# +# Output variables: +# +# SCP_FOUND - set if scp was found +# SCP_EXECUTABLE - path to scp or pscp executable +# SCP_BATCH_FLAG - how to put scp/pscp into batch mode + +SET(SCP_EXECUTABLE) +IF (WINDOWS) + FIND_PROGRAM(SCP_EXECUTABLE NAMES pscp pscp.exe) +ELSE (WINDOWS) + FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe) +ENDIF (WINDOWS) + +IF (SCP_EXECUTABLE) + SET(SCP_FOUND ON) +ELSE (SCP_EXECUTABLE) + SET(SCP_FOUND OFF) +ENDIF (SCP_EXECUTABLE) + +IF (SCP_FOUND) + GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE) + IF (_scp_name STREQUAL scp) + SET(SCP_BATCH_FLAG -B) + ELSE (_scp_name STREQUAL scp) + SET(SCP_BATCH_FLAG -batch) + ENDIF (_scp_name STREQUAL scp) +ELSE (SCP_FOUND) + IF (SCP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find scp or pscp executable") + ENDIF (SCP_FIND_REQUIRED) +ENDIF (SCP_FOUND) + +MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG) -- cgit v1.2.3 From 5aea7576b0c3494c7f1051f63c7414ae18060ced Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 14:20:31 +0200 Subject: Simple reformat with CLion --- indra/cmake/CMakeLists.txt | 131 ++++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 66 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 48b08b31d6..c8e71b604f 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -5,82 +5,81 @@ include(00-Common) project(cmake) set(cmake_SOURCE_FILES - CMakeLists.txt - - 00-Common.cmake - APR.cmake - Audio.cmake - Boost.cmake - bugsplat.cmake - BuildVersion.cmake - CEFPlugin.cmake - CEFPlugin.cmake - CMakeCopyIfDifferent.cmake - ConfigurePkgConfig.cmake - CURL.cmake - Copy3rdPartyLibs.cmake - DBusGlib.cmake - DeploySharedLibs.cmake - DragDrop.cmake - EXPAT.cmake + CMakeLists.txt + 00-Common.cmake + APR.cmake + Audio.cmake + Boost.cmake + bugsplat.cmake + BuildVersion.cmake + CEFPlugin.cmake + CEFPlugin.cmake + CMakeCopyIfDifferent.cmake + ConfigurePkgConfig.cmake + CURL.cmake + Copy3rdPartyLibs.cmake + DBusGlib.cmake + DeploySharedLibs.cmake + DragDrop.cmake + EXPAT.cmake FindAutobuild.cmake FMODSTUDIO.cmake - FreeType.cmake - GLEXT.cmake - GLH.cmake - GLOD.cmake - GoogleMock.cmake - Havok.cmake - Hunspell.cmake + FreeType.cmake + GLEXT.cmake + GLH.cmake + GLOD.cmake + GoogleMock.cmake + Havok.cmake + Hunspell.cmake JsonCpp.cmake - LLAddBuildTest.cmake - LLAppearance.cmake - LLAudio.cmake - LLCommon.cmake - LLImage.cmake - LLKDU.cmake - LLPhysicsExtensions.cmake - LLPrimitive.cmake - LLSharedLibs.cmake - LLTestCommand.cmake - LLWindow.cmake - Linking.cmake - NDOF.cmake - OPENAL.cmake - OpenGL.cmake - OpenJPEG.cmake - OpenSSL.cmake - PNG.cmake - PluginAPI.cmake - Prebuilt.cmake - PulseAudio.cmake - Python.cmake - TemplateCheck.cmake - Tut.cmake - UI.cmake - UnixInstall.cmake - URIPARSER.cmake - Variables.cmake - ViewerMiscLibs.cmake - VisualLeakDetector.cmake - LibVLCPlugin.cmake - XmlRpcEpi.cmake - ZLIBNG.cmake - ) + LLAddBuildTest.cmake + LLAppearance.cmake + LLAudio.cmake + LLCommon.cmake + LLImage.cmake + LLKDU.cmake + LLPhysicsExtensions.cmake + LLPrimitive.cmake + LLSharedLibs.cmake + LLTestCommand.cmake + LLWindow.cmake + Linking.cmake + NDOF.cmake + OPENAL.cmake + OpenGL.cmake + OpenJPEG.cmake + OpenSSL.cmake + PNG.cmake + PluginAPI.cmake + Prebuilt.cmake + PulseAudio.cmake + Python.cmake + TemplateCheck.cmake + Tut.cmake + UI.cmake + UnixInstall.cmake + URIPARSER.cmake + Variables.cmake + ViewerMiscLibs.cmake + VisualLeakDetector.cmake + LibVLCPlugin.cmake + XmlRpcEpi.cmake + ZLIBNG.cmake + ) source_group("Shared Rules" FILES ${cmake_SOURCE_FILES}) set(master_SOURCE_FILES - ../CMakeLists.txt - ) + ../CMakeLists.txt + ) source_group("Master Rules" FILES ${master_SOURCE_FILES}) set_source_files_properties(${cmake_SOURCE_FILES} ${master_SOURCE_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) + PROPERTIES HEADER_FILE_ONLY TRUE) add_library(cmake - cmake_dummy.cpp - ${cmake_SOURCE_FILES} - ${master_SOURCE_FILES} - ) + cmake_dummy.cpp + ${cmake_SOURCE_FILES} + ${master_SOURCE_FILES} + ) -- cgit v1.2.3 From c8eb53859fb9b9f59d5ce8ef67f4011e95e34a9a Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 14:21:26 +0200 Subject: Remove unused code --- indra/cmake/ExamplePlugin.cmake | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake index c7ffaf024e..6234035474 100644 --- a/indra/cmake/ExamplePlugin.cmake +++ b/indra/cmake/ExamplePlugin.cmake @@ -4,8 +4,3 @@ include(Prebuilt) set(EXAMPLEPLUGIN ON CACHE BOOL "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") - -if (WINDOWS) -elseif (DARWIN) -elseif (LINUX) -endif (WINDOWS) -- cgit v1.2.3 From bb85651d987a6cb969de7dd7c2b130411de6203c Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:29:02 +0200 Subject: Create a new target ll::oslibrary to link against libs specific to the OS compiled on. This gets rid of the a few OS specific set and uses variables (which some even seemed mostly duplicate like WINDOWS_LIBRARIES ans UI_LIBRARIES) and it also solves the problem of having them to tack on every target, as of no they come as a transitive dependency from llcommon --- indra/cmake/LLAddBuildTest.cmake | 2 -- indra/cmake/Linking.cmake | 70 +++++++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 28 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index a3c873b389..9412475640 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -46,8 +46,6 @@ INCLUDE(GoogleMock) SET(alltest_LIBRARIES llcommon ll::googlemock - ${PTHREAD_LIBRARY} - ${WINDOWS_LIBRARIES} ) IF(NOT "${project}" STREQUAL "llmath") # add llmath as a dep unless the tested module *is* llmath! diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 4a57a6a3ef..ccbb27ca42 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -55,32 +55,50 @@ endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS}) +create_target(ll::oslibraries) + if (LINUX) - set(DL_LIBRARY dl) - set(PTHREAD_LIBRARY pthread) -else (LINUX) - set(DL_LIBRARY "") - set(PTHREAD_LIBRARY "") -endif (LINUX) + set_target_libraries( ll::oslibraries + dl + pthread + rt) +elseif (WINDOWS) + set_target_libraries( ll::oslibraries + advapi32 + shell32 + ws2_32 + mswsock + psapi + winmm + netapi32 + wldap32 + gdi32 + user32 + ole32 + dbghelp + legacy_stdio_definitions + ) +else() + include(CMakeFindFrameworks) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + find_library(CARBON_LIBRARY Carbon) + find_library(COCOA_LIBRARY Cocoa) + find_library(IOKIT_LIBRARY IOKit) + + find_library(AGL_LIBRARY AGL) + find_library(APPKIT_LIBRARY AppKit) + find_library(COREAUDIO_LIBRARY CoreAudio) + + set_target_libraries( ll::oslibraries + ${COCOA_LIBRARY} + ${IOKIT_LIBRARY} + ${COREFOUNDATION_LIBRARY} + ${CARBON_LIBRARY} + ${AGL_LIBRARY} + ${APPKITT_LIBRARY} + ${COREAUDIO_LIBRARY} + ) +endif() + -if (WINDOWS) - set(WINDOWS_LIBRARIES - advapi32 - shell32 - ws2_32 - mswsock - psapi - winmm - netapi32 - wldap32 - gdi32 - user32 - ole32 - dbghelp - ) -else (WINDOWS) - set(WINDOWS_LIBRARIES "") -endif (WINDOWS) - -mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES) -- cgit v1.2.3 From b9f94c08977ff76f41a32a2bb9f25883e578eea3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:33:32 +0200 Subject: Now there is a oslibrary target get rid of some more obsolete vars: LEGACY_STDIO_LIBS (was only used for Windows) PTHREAD_LIBRARY (only Linux) LLDATABASE_LIBRARIES (that one was supposed for Linux, but never needed anyway) --- indra/cmake/LLAddBuildTest.cmake | 2 -- indra/cmake/Linking.cmake | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 9412475640..1f63fed613 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -204,10 +204,8 @@ FUNCTION(LL_ADD_INTEGRATION_TEST ) SET(libraries - ${LEGACY_STDIO_LIBS} ${library_dependencies} ll::googlemock - ${PTHREAD_LIBRARY} ) # Add test executable build target diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index ccbb27ca42..4d99026dfc 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -88,7 +88,7 @@ else() find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) find_library(COREAUDIO_LIBRARY CoreAudio) - + set_target_libraries( ll::oslibraries ${COCOA_LIBRARY} ${IOKIT_LIBRARY} -- cgit v1.2.3 From e45a6a0f689d12659ccb1d323e0fa6d791c2a74e Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:35:41 +0200 Subject: Remove obsolete message --- indra/cmake/NDOF.cmake | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 75936425ff..fd7a650612 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -21,7 +21,4 @@ if (NDOF) target_compile_definitions( ll::ndof INTERFACE LIB_NDOF=1) endif (NDOF) -if (NOT NDOF_FOUND) - message(STATUS "Building without N-DoF joystick support") -endif () -- cgit v1.2.3 From c0c5ac0e3984ffe1911455cd22554fdd0cb05f68 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:12:24 +0200 Subject: Only try copy voice files from slvoice_src_dir if that variable is set (seems to be the case for Windows) --- indra/cmake/Copy3rdPartyLibs.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index d5b8e6c712..7d187b5eef 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -260,13 +260,16 @@ endif(WINDOWS) # Curiously, slvoice_files are only copied to SHARED_LIB_STAGING_DIR_RELEASE. # It's unclear whether this is oversight or intentional, but anyway leave the # single copy_if_different command rather than using to_staging_dirs. -copy_if_different( - ${slvoice_src_dir} - "${SHARED_LIB_STAGING_DIR_RELEASE}" - out_targets - ${slvoice_files} + +if( slvoice_src_dir ) + copy_if_different( + ${slvoice_src_dir} + "${SHARED_LIB_STAGING_DIR_RELEASE}" + out_targets + ${slvoice_files} ) -list(APPEND third_party_targets ${out_targets}) + list(APPEND third_party_targets ${out_targets}) +endif() to_staging_dirs( ${vivox_lib_dir} -- cgit v1.2.3 From 4c1ce6bd72803536445525130d4dd627910961a3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:13:28 +0200 Subject: Fix a typo. --- 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 4d99026dfc..253c24f927 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -95,7 +95,7 @@ else() ${COREFOUNDATION_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} - ${APPKITT_LIBRARY} + ${APPKIT_LIBRARY} ${COREAUDIO_LIBRARY} ) endif() -- cgit v1.2.3 From 7d6bb21c9cfc6d46cae4f8c4fcffabd23325629e Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:13:52 +0200 Subject: Remove unset GOOGLEMOCK_INCLUDE_DIRS variable. --- indra/cmake/LLAddBuildTest.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 1f63fed613..9bdcb7d6a2 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -41,7 +41,6 @@ INCLUDE(GoogleMock) SET(alltest_INCLUDE_DIRS ${LIBS_OPEN_DIR}/test - ${GOOGLEMOCK_INCLUDE_DIRS} ) SET(alltest_LIBRARIES llcommon -- cgit v1.2.3 From 3eec716b240167cda6a5c652584152af8756b56d Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:17:32 +0200 Subject: Do not use ${ARCH}_linux_INCLUDES atm --- indra/cmake/00-Common.cmake | 8 -------- indra/cmake/UI.cmake | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index ec0e195b56..5320fc193c 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -190,11 +190,3 @@ if (LINUX OR DARWIN) endif (LINUX OR DARWIN) -set(${ARCH}_linux_INCLUDES - atk-1.0 - glib-2.0 - gstreamer-0.10 - gtk-2.0 - pango-1.0 - ) - diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index c12dca2ab9..ee95547136 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -28,10 +28,27 @@ endif (LINUX) include_directories ( ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include -) -foreach(include ${${LL_ARCH}_INCLUDES}) - include_directories(${LIBS_PREBUILT_DIR}/include/${include}) -endforeach(include) + ) + + +# The following made no real sense +# - ${ARCH}_linux_INCLUDES was set in 00-Common.cmake, +# - Here ist is used, but as ${${LL_ARCH}_INCLUDES} +# It would make more sense to use one form ($LL_ARCH) +# Leave this out for the moment, but come back when looking at the Linux build + +#set(${ARCH}_linux_INCLUDES +# atk-1.0 +# glib-2.0 +# gstreamer-0.10 +# gtk-2.0 +# pango-1.0 +# ) +#foreach(include ${${LL_ARCH}_INCLUDES}) +# set_target_include_dirs( ll::uilibraries +# ${LIBS_PREBUILT_DIR}/include/${include} +# ) +#endforeach(include) if (LINUX) add_definitions(-DLL_GTK=1 -DLL_X11=1) -- cgit v1.2.3 From 924fa0fa78b41c7e8486c1ed29764afb1e32fd7e Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:28:26 +0200 Subject: create target ll::uilibraries to have one common target that defines what each operation system needs as dependencies on OS gui libraries. --- indra/cmake/UI.cmake | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index ee95547136..03eb1b3fc4 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -6,8 +6,10 @@ if (LINUX) use_prebuilt_binary(gtk-atk-pango-glib) endif (LINUX) +create_target( ll::uilibraries ) + if (LINUX) - set(UI_LIBRARIES + set_target_libraries( ll::uilibraries atk-1.0 gdk-x11-2.0 gdk_pixbuf-2.0 @@ -21,12 +23,27 @@ if (LINUX) pangoft2-1.0 pangox-1.0 pangoxft-1.0 - ${FREETYPE_LIBRARIES} + Xinerama + ll::freetype ) endif (LINUX) +if( WINDOWS ) + set_target_libraries( ll::uilibraries + opengl32 + comdlg32 + dxguid + kernel32 + odbc32 + odbccp32 + oleaut32 + shell32 + Vfw32 + wer + winspool + ) +endif() -include_directories ( - ${LIBS_PREBUILT_DIR}/include +set_target_include_dirs( ll::uilibraries ${LIBS_PREBUILT_DIR}/include ) @@ -51,5 +68,5 @@ include_directories ( #endforeach(include) if (LINUX) - add_definitions(-DLL_GTK=1 -DLL_X11=1) + set_target_properties(ll::uilibraries PROPERTIES COMPILE_DEFINITIONS LL_GTK=1 LL_X11=1 ) endif (LINUX) -- cgit v1.2.3 From cc48def709c2a6eca90c690bd63491011ad68d36 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 18:03:04 +0200 Subject: Initialize variables so that calling cmake with "--warn-unused-vars --warn-uninitialized" does not make it go all crazy. --- indra/cmake/FMODSTUDIO.cmake | 2 ++ indra/cmake/Prebuilt.cmake | 44 +++++++++++++++++++++----------------------- indra/cmake/bugsplat.cmake | 2 ++ 3 files changed, 25 insertions(+), 23 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 653d96f86a..334d46caf9 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -34,5 +34,7 @@ if (FMODSTUDIO) set_target_include_dirs(ll::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) +else() + set( FMODSTUDIO "OFF") endif (FMODSTUDIO) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 9e8adf5af1..603368304c 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -23,40 +23,38 @@ endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING # of previous attempts is serialized in the file # ${PREBUILD_TRACKING_DIR}/${_binary}_installed) macro (use_prebuilt_binary _binary) - if (NOT DEFINED USESYSTEMLIBS_${_binary}) - set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS}) - endif (NOT DEFINED USESYSTEMLIBS_${_binary}) + if( NOT DEFINED ${_binary}_installed ) + set( ${_binary}_installed "") + endif() - if (NOT USESYSTEMLIBS_${_binary}) if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed") - file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed") - if(DEBUG_PREBUILT) - message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"") - endif(DEBUG_PREBUILT) + file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed") + if(DEBUG_PREBUILT) + message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"") + endif(DEBUG_PREBUILT) endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed") if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) - if(DEBUG_PREBUILT) - message(STATUS "cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install + if(DEBUG_PREBUILT) + message(STATUS "cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} ") - endif(DEBUG_PREBUILT) - execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" - install - --install-dir=${AUTOBUILD_INSTALL_DIR} - ${_binary} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE ${_binary}_installed - ) - file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}") + endif(DEBUG_PREBUILT) + execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" + install + --install-dir=${AUTOBUILD_INSTALL_DIR} + ${_binary} + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + RESULT_VARIABLE ${_binary}_installed + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}") endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) if(NOT ${_binary}_installed EQUAL 0) - message(FATAL_ERROR - "Failed to download or unpack prebuilt '${_binary}'." - " Process returned ${${_binary}_installed}.") + message(FATAL_ERROR + "Failed to download or unpack prebuilt '${_binary}'." + " Process returned ${${_binary}_installed}.") endif (NOT ${_binary}_installed EQUAL 0) - endif (NOT USESYSTEMLIBS_${_binary}) endmacro (use_prebuilt_binary _binary) function( create_target name ) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index ce5660aa05..af2d7bd9f2 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -33,5 +33,7 @@ if (USE_BUGSPLAT) set_target_include_dirs( ll::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) +else() + set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") endif (USE_BUGSPLAT) -- cgit v1.2.3 From 1434b4ff96963854c96a7dc5f9d8475a97cc1184 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:35:27 +0200 Subject: Remove unused variable. --- indra/cmake/00-Common.cmake | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 5320fc193c..25ab731842 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -171,12 +171,7 @@ if (DARWIN) ##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") endif (DARWIN) - if (LINUX OR DARWIN) - if (CMAKE_CXX_COMPILER MATCHES ".*clang") - set(CMAKE_COMPILER_IS_CLANGXX 1) - endif (CMAKE_CXX_COMPILER MATCHES ".*clang") - set(GCC_WARNINGS -Wall -Wno-sign-compare -Wno-trigraphs) if (NOT GCC_DISABLE_FATAL_WARNINGS) -- cgit v1.2.3 From ddc2c0265dface6cc17eae1c81c9ba246dc57078 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:36:15 +0200 Subject: slvoice_src_dir seems generally not used/ever valid. Not 100% sure what's with that, maybe it gets set by LLs teamcity builds? --- indra/cmake/Copy3rdPartyLibs.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 7d187b5eef..79b8c5775a 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -33,7 +33,13 @@ if(WINDOWS) #******************************* # VIVOX - *NOTE: no debug version set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") - set(slvoice_src_dir "${ARCH_PREBUILT_BIN_RELEASE}") + + # ND, it seems there is no such thing defined. At least when building a viewer + # Does this maybe matter on some LL buildserver? Otherwise this and the snippet using slvoice_src_dir + # can all go + if( ARCH_PREBUILT_BIN_RELEASE ) + set(slvoice_src_dir "${ARCH_PREBUILT_BIN_RELEASE}") + endif() set(slvoice_files SLVoice.exe ) if (ADDRESS_SIZE EQUAL 64) list(APPEND vivox_libs -- cgit v1.2.3 From 4d4caaaf1f5d0e486bdaa6fb57c00e04c201c6db Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:49:08 +0200 Subject: Removed unused HEADLESS case. --- indra/cmake/LLAppearance.cmake | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAppearance.cmake b/indra/cmake/LLAppearance.cmake index 99399d349a..bf34b13714 100644 --- a/indra/cmake/LLAppearance.cmake +++ b/indra/cmake/LLAppearance.cmake @@ -4,11 +4,6 @@ include(Variables) include(Boost) include(LLCoreHttp) -if (BUILD_HEADLESS) - set(LLAPPEARANCE_HEADLESS_LIBRARIES - llappearanceheadless - ) -endif (BUILD_HEADLESS) -- cgit v1.2.3 From 64fbf878a419346a3191246c97ab61dece7b7787 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:49:55 +0200 Subject: Cleanup --- indra/cmake/GLH.cmake | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index d7e89afaec..b420ad413f 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -1,7 +1,4 @@ # -*- cmake -*- include(Prebuilt) -set(GLH_FIND_REQUIRED TRUE) -set(GLH_FIND_QUIETLY TRUE) - use_prebuilt_binary(glh_linear) -- cgit v1.2.3 From 5c05466bc4eaf3bd8eaa5153629ea19d17a0b3c2 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:50:26 +0200 Subject: Remove unused HEADLESS case --- indra/cmake/OpenGL.cmake | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/OpenGL.cmake b/indra/cmake/OpenGL.cmake index 2259c99293..bf7cd8366a 100644 --- a/indra/cmake/OpenGL.cmake +++ b/indra/cmake/OpenGL.cmake @@ -2,11 +2,5 @@ include(Variables) include(Prebuilt) - -if (BUILD_HEADLESS) - SET(OPENGL_glu_LIBRARY GLU) - SET(OPENGL_HEADLESS_LIBRARIES OSMesa16 dl GLU) -endif (BUILD_HEADLESS) - include(FindOpenGL) -- cgit v1.2.3 From 4934b65298b0f2bcf8898c87ec6f46f8d1412277 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:51:02 +0200 Subject: Cleanup --- indra/cmake/GLEXT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 6562082d7e..f6c39fe137 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -4,5 +4,5 @@ include(Prebuilt) if (WINDOWS OR LINUX) use_prebuilt_binary(glext) endif (WINDOWS OR LINUX) + use_prebuilt_binary(glh_linear) -set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) -- cgit v1.2.3 From 7bd0b8306b85d6657b79b658dc2e35c11e082142 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:51:24 +0200 Subject: Make Pulseaudio.cmake just error out. a) it is broken (there is no 3p for example), the define it sets it used. The vrabiables it did set are unused. There is a case to probe for pulseaudio and this is the Linux volume catcher. But for that it is only necessary to detect the system include to get a few defines and functions --- indra/cmake/PulseAudio.cmake | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/PulseAudio.cmake b/indra/cmake/PulseAudio.cmake index 1b7adc1a62..303db97db6 100644 --- a/indra/cmake/PulseAudio.cmake +++ b/indra/cmake/PulseAudio.cmake @@ -1,21 +1,4 @@ # -*- cmake -*- include(Prebuilt) -set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.") - -if (PULSEAUDIO) - use_prebuilt_binary(pulseaudio) - set(PULSEAUDIO_FOUND ON FORCE BOOL) - set(PULSEAUDIO_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include - ) - # We don't need to explicitly link against pulseaudio itself, because - # the viewer probes for the system's copy at runtime. - set(PULSEAUDIO_LIBRARIES - # none needed! - ) -endif (PULSEAUDIO) - -if (PULSEAUDIO_FOUND) - add_definitions(-DLL_PULSEAUDIO_ENABLED=1) -endif (PULSEAUDIO_FOUND) +message( FATAL_ERROR "Pulseaudio cmake file is broken" ) -- cgit v1.2.3 From d006f01c649d557b6e61a5d1d15b24acb839cb8c Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:53:25 +0200 Subject: Cleanup, remove unused variable --- indra/cmake/LibVLCPlugin.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 1648bfd942..fd2ee13569 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -8,7 +8,6 @@ create_target( ll::libvlc ) use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -set(VLC_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/vlc) if (WINDOWS) set_target_libraries( ll::libvlc -- cgit v1.2.3 From 9b34575ba829fd082a301f6b210b472cfb948c2a Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:53:51 +0200 Subject: Include Linking to pull in the definition of ARCH_PREBUILT_DIRS_RELEASE --- indra/cmake/NGHTTP2.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index e92f0da2ef..3007d6f914 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -1,3 +1,4 @@ +include(Linking) include(Prebuilt) include_guard() -- cgit v1.2.3 From 0eb2d8056a9d7c858545987cec74a4d604dcd5b5 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:55:58 +0200 Subject: Pull in LL_GLOD=1 via target, not by hand crafted magic. --- indra/cmake/GLOD.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 2d7f85030f..ab7eb38862 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -6,7 +6,6 @@ create_target( ll::glod ) use_prebuilt_binary(glod) -set(GLODLIB ON CACHE BOOL "Using GLOD library") - set_target_include_dirs( ll::glod ${LIBS_PREBUILT_DIR}/include) set_target_libraries( ll::glod GLOD ) +target_compile_definitions( ll::glod INTERFACE LL_GLOD=1) \ No newline at end of file -- cgit v1.2.3 From 2c3507a9d2a32749df695ee04f7612c3049c86c8 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:58:17 +0200 Subject: Cleanup plugin, create proper target for link libraries. Remove unused variables. --- indra/cmake/PluginAPI.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake index d1649e8248..8c29f4a3c8 100644 --- a/indra/cmake/PluginAPI.cmake +++ b/indra/cmake/PluginAPI.cmake @@ -1,7 +1,9 @@ # -*- cmake -*- +create_target( ll::pluginlibraries) + if (WINDOWS) - set(PLUGIN_API_WINDOWS_LIBRARIES + set_target_libraries( ll::pluginlibraries wsock32 ws2_32 psapi @@ -9,8 +11,6 @@ if (WINDOWS) advapi32 user32 ) -else (WINDOWS) - set(PLUGIN_API_WINDOWS_LIBRARIES "") endif (WINDOWS) -- cgit v1.2.3 From 3ac18ad9932b4e2fda8e850bd18a524fb1593520 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 22:08:40 +0200 Subject: Streamline bugsplat target: - Fix usage of bugsplat::bugsplat by using ll::bugsplat - Use bugsplat define by importing target not by using hand crafted magic --- indra/cmake/bugsplat.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index af2d7bd9f2..9057ae2272 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -16,20 +16,22 @@ if (USE_BUGSPLAT) include(Prebuilt) use_prebuilt_binary(bugsplat) if (WINDOWS) - set_target_libraries( bugsplat::bugsplat + set_target_libraries( ll::bugsplat ${ARCH_PREBUILT_DIRS_RELEASE}/bugsplat.lib ) elseif (DARWIN) find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") - set_target_libraries( bugsplat::bugsplat + set_target_libraries( ll::bugsplat ${BUGSPLAT_LIBRARIES} ) else (WINDOWS) message(FATAL_ERROR "BugSplat is not supported; add -DUSE_BUGSPLAT=OFF") endif (WINDOWS) - set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") + if( NOT BUGSPLAT_DB ) + message( FATAL_ERROR "You need to set BUGSPLAT_DB when setting USE_BUGSPLAT" ) + endif() set_target_include_dirs( ll::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) -- cgit v1.2.3 From a950940adb1508908313253a9e5118801b2f6d89 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 22:57:09 +0200 Subject: Streamline fmodstudio/openal targets: - Targets now define the appropriate c++ defines, no more hand magic needed for llstartup.cpp - Switch cmakeflage to USE_xxx rather than xxx as it was before. I personally find the USE_X notion more intuitive and it follows how KDU is used. - To be backward compatible OPENAL/FMODSTUDIO flag will be mapped to USE_OPENAL/USE_FMODSTUDIO --- indra/cmake/Copy3rdPartyLibs.cmake | 18 ++++++++++-------- indra/cmake/FMODSTUDIO.cmake | 16 ++++++++++++---- indra/cmake/OPENAL.cmake | 17 +++++++++-------- 3 files changed, 31 insertions(+), 20 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 79b8c5775a..e16e1e5572 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -6,6 +6,8 @@ include(CMakeCopyIfDifferent) include(Linking) +include(OpenAL) +include(FMODSTUDIO) # When we copy our dependent libraries, we almost always want to copy them to # both the Release and the RelWithDebInfo staging directories. This has @@ -91,14 +93,14 @@ if(WINDOWS) endif(ADDRESS_SIZE EQUAL 32) endif (USE_BUGSPLAT) - if (FMODSTUDIO) + if (TARGET ll::fmodstudio) set(debug_files ${debug_files} fmodL.dll) set(release_files ${release_files} fmod.dll) - endif (FMODSTUDIO) + endif () - if (OPENAL) + if (TARGET ll::openal) list(APPEND release_files openal32.dll alut.dll) - endif (OPENAL) + endif () #******************************* # Copy MS C runtime dlls, required for packaging. @@ -183,10 +185,10 @@ elseif(DARWIN) liburiparser.1.0.27.dylib ) - if (FMODSTUDIO) + if (TARGET ll::fmodstudio) set(debug_files ${debug_files} libfmodL.dylib) set(release_files ${release_files} libfmod.dylib) - endif (FMODSTUDIO) + endif () elseif(LINUX) # linux is weird, multiple side by side configurations aren't supported @@ -233,10 +235,10 @@ elseif(LINUX) libfontconfig.so.1 ) - if (FMODSTUDIO) + if (TARGET ll::fmodstudio) set(debug_files ${debug_files} "libfmodL.so") set(release_files ${release_files} "libfmod.so") - endif (FMODSTUDIO) + endif () else(WINDOWS) message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 334d46caf9..b84a177748 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -6,11 +6,19 @@ include_guard() # When building using proprietary binaries though (i.e. having access to LL private servers), # we always build with FMODSTUDIO. if (INSTALL_PROPRIETARY) - set(FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.") + set(USE_FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.") endif (INSTALL_PROPRIETARY) -if (FMODSTUDIO) +# ND: To streamline arguments passed, switch from FMODSTUDIO to USE_FMODSTUDIO +# To not break all old build scripts convert old arguments but warn about it +if(FMODSTUDIO) + message( WARNING "Use of the FMODSTUDIO argument is deprecated, please switch to USE_FMODSTUDIO") + set(USE_FMODSTUDIO ${FMODSTUDIO}) +endif() + +if (USE_FMODSTUDIO) create_target( ll::fmodstudio ) + target_compile_definitions( ll::fmodstudio INTERFACE LL_FMODSTUDIO=1) if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If the path have been specified in the arguments, use that @@ -35,6 +43,6 @@ if (FMODSTUDIO) set_target_include_dirs(ll::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) else() - set( FMODSTUDIO "OFF") -endif (FMODSTUDIO) + set( USE_FMODSTUDIO "OFF") +endif () diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 9904f6d1c0..b50610c554 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -4,16 +4,17 @@ include(Prebuilt) include_guard() -if (LINUX) - set(OPENAL ON CACHE BOOL "Enable OpenAL") -else (LINUX) - set(OPENAL OFF CACHE BOOL "Enable OpenAL") -endif (LINUX) +# ND: To streamline arguments passed, switch from OPENAL to USE_OPENAL +# To not break all old build scripts convert old arguments but warn about it +if(OPENAL) + message( WARNING "Use of the OPENAL argument is deprecated, please switch to USE_OPENAL") + set(USE_OPENAL ${OPENAL}) +endif() -if (OPENAL) +if (USE_OPENAL) create_target( ll::openal ) set_target_include_dirs( ll::openal "${LIBS_PREBUILT_DIR}/include/AL") - + target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1) use_prebuilt_binary(openal) if(WINDOWS) @@ -29,4 +30,4 @@ if (OPENAL) else() message(FATAL_ERROR "OpenAL is not available for this platform") endif() -endif (OPENAL) +endif () -- cgit v1.2.3 From 5994ca8531e51534c83f737a0962471e55f14167 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 22:58:06 +0200 Subject: Remove another place where there was some hand crafted logic to deal with bugsplat defines --- indra/cmake/LLAddBuildTest.cmake | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 9bdcb7d6a2..a97d2584ae 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -84,11 +84,6 @@ INCLUDE(GoogleMock) MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}") ENDIF(LL_TEST_VERBOSE) - if (USE_BUGSPLAT) - SET_PROPERTY(SOURCE ${${name}_test_SOURCE_FILES} - APPEND PROPERTY COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}") - endif (USE_BUGSPLAT) - # Headers GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES) SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES}) @@ -218,11 +213,6 @@ FUNCTION(LL_ADD_INTEGRATION_TEST COMPILE_DEFINITIONS "LL_TEST=${testname};LL_TEST_${testname}" ) - if (USE_BUGSPLAT) - SET_PROPERTY(SOURCE ${source_files} - APPEND PROPERTY COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}") - endif (USE_BUGSPLAT) - # The following was copied to llcorehttp/CMakeLists.txt's texture_load target. # Any changes made here should be replicated there. if (WINDOWS) -- cgit v1.2.3 From 6d0bba9c03da0d8aca5e88fcb9289cb2f89f3467 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 17:32:14 +0200 Subject: Switch over to standard target_link_libraries (cmake requirements are high enough now). --- indra/cmake/APR.cmake | 6 +++--- indra/cmake/Audio.cmake | 4 ++-- indra/cmake/Boost.cmake | 6 +++--- indra/cmake/CEFPlugin.cmake | 4 ++-- indra/cmake/CURL.cmake | 4 ++-- indra/cmake/EXPAT.cmake | 4 ++-- indra/cmake/FMODSTUDIO.cmake | 8 ++++---- indra/cmake/FreeType.cmake | 2 +- indra/cmake/GLOD.cmake | 2 +- indra/cmake/GoogleMock.cmake | 7 +++---- indra/cmake/Hunspell.cmake | 6 +++--- indra/cmake/JPEG.cmake | 6 +++--- indra/cmake/JsonCpp.cmake | 6 +++--- indra/cmake/LLKDU.cmake | 4 ++-- indra/cmake/LLPhysicsExtensions.cmake | 6 +++--- indra/cmake/LLPrimitive.cmake | 16 ++++++++-------- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/LibVLCPlugin.cmake | 6 +++--- indra/cmake/Linking.cmake | 6 +++--- indra/cmake/NDOF.cmake | 4 ++-- indra/cmake/NGHTTP2.cmake | 6 +++--- indra/cmake/NVAPI.cmake | 2 +- indra/cmake/OPENAL.cmake | 4 ++-- indra/cmake/OpenJPEG.cmake | 2 +- indra/cmake/OpenSSL.cmake | 6 +++--- indra/cmake/PNG.cmake | 4 ++-- indra/cmake/PluginAPI.cmake | 2 +- indra/cmake/Prebuilt.cmake | 4 +--- indra/cmake/UI.cmake | 4 ++-- indra/cmake/URIPARSER.cmake | 6 +++--- indra/cmake/XmlRpcEpi.cmake | 2 +- indra/cmake/ZLIBNG.cmake | 4 ++-- indra/cmake/bugsplat.cmake | 4 ++-- 33 files changed, 78 insertions(+), 81 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 269b0f3000..a389c09a37 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -12,7 +12,7 @@ if (WINDOWS) else (LLCOMMON_LINK_SHARED) set(APR_selector "") endif (LLCOMMON_LINK_SHARED) - set_target_libraries( ll::apr + target_link_libraries( ll::apr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib @@ -26,13 +26,13 @@ elseif (DARWIN) set(APRUTIL_selector "a") endif (LLCOMMON_LINK_SHARED) - set_target_libraries( ll::apr + target_link_libraries( ll::apr INTERFACE libapr-1.${APR_selector} libaprutil-1.${APRUTIL_selector} iconv ) else (WINDOWS) - set_target_libraries( ll::apr + target_link_libraries( ll::apr INTERFACE apr-1 aprutil-1 iconv diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index e533d1ac00..0441f370db 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -8,8 +8,8 @@ use_prebuilt_binary(ogg_vorbis) set_target_include_dirs( ll::vorbis ${LIBS_PREBUILT_DIR}/include ) if (WINDOWS) - set_target_libraries(ll::vorbis ogg_static vorbis_static vorbisenc_static vorbisfile_static ) + target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static ) else (WINDOWS) - set_target_libraries(ll::vorbis ogg vorbis vorbisenc vorbisfile ) + target_link_libraries(ll::vorbis INTERFACE ogg vorbis vorbisenc vorbisfile ) endif (WINDOWS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index ac6151ffe3..e713d50fc1 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -11,7 +11,7 @@ use_prebuilt_binary(boost) set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) - set_target_libraries( ll::boost + target_link_libraries( ll::boost INTERFACE libboost_context-mt${addrsfx} libboost_fiber-mt${addrsfx} libboost_filesystem-mt${addrsfx} @@ -20,7 +20,7 @@ if (WINDOWS) libboost_system-mt${addrsfx} libboost_thread-mt${addrsfx}) elseif (LINUX) - set_target_libraries( ll::boost + target_link_libraries( ll::boost INTERFACE boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} @@ -30,7 +30,7 @@ elseif (LINUX) boost_system-mt${addrsfx} boost_thread-mt${addrsfx}) elseif (DARWIN) - set_target_libraries( ll::boost + target_link_libraries( ll::boost INTERFACE boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 6dba5e26ac..41d1b521f7 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -9,7 +9,7 @@ use_prebuilt_binary(dullahan) set_target_include_dirs( cef::cef ${LIBS_PREBUILT_DIR}/include/cef) if (WINDOWS) - set_target_libraries( cef::cef + target_link_libraries( cef::cef INTERFACE libcef.lib libcef_dll_wrapper.lib dullahan.lib @@ -25,7 +25,7 @@ elseif (DARWIN) message(FATAL_ERROR "CEF not found") endif() - set_target_libraries( cef::cef + target_link_libraries( cef::cef INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a ${APPKIT_LIBRARY} diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index 2a5ea67ff3..ee00113f75 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -6,8 +6,8 @@ create_target(ll::libcurl) use_prebuilt_binary(curl) if (WINDOWS) - set_target_libraries(ll::libcurl libcurl.lib) + target_link_libraries(ll::libcurl INTERFACE libcurl.lib) else (WINDOWS) - set_target_libraries(ll::libcurl libcurl.a) + target_link_libraries(ll::libcurl INTERFACE libcurl.a) endif (WINDOWS) set_target_include_dirs( ll::libcurl ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 85bb146a4a..44e83c2e47 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -6,10 +6,10 @@ create_target( ll::expat INTERFACE IMPORTED ) use_prebuilt_binary(expat) if (WINDOWS) - set_target_libraries( ll::expat libexpatMT ) + target_link_libraries( ll::expat INTERFACE libexpatMT ) set(EXPAT_COPY libexpatMT.dll) else (WINDOWS) - set_target_libraries( ll::expat expat ) + target_link_libraries( ll::expat INTERFACE expat ) if (DARWIN) set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) else () diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index b84a177748..aec86125e8 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -23,7 +23,7 @@ if (USE_FMODSTUDIO) if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If the path have been specified in the arguments, use that - set_target_libraries(fmodstudio::fmodstudio ${FMODSTUDIO_LIBRARY}) + target_link_libraries(fmodstudio::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY}) set_target_include_dirs(fmodstudio::fmodstudio ${FMODSTUDIO_INCLUDE_DIR}) else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If not, we're going to try to get the package listed in autobuild.xml @@ -32,12 +32,12 @@ if (USE_FMODSTUDIO) include(Prebuilt) use_prebuilt_binary(fmodstudio) if (WINDOWS) - set_target_libraries( ll::fmodstudio fmod_vc) + target_link_libraries( ll::fmodstudio INTERFACE fmod_vc) elseif (DARWIN) #despite files being called libfmod.dylib, we are searching for fmod - set_target_libraries( ll::fmodstudio fmod) + target_link_libraries( ll::fmodstudio INTERFACE fmod) elseif (LINUX) - set_target_libraries( ll::fmodstudio fmod) + target_link_libraries( ll::fmodstudio INTERFACE fmod) endif (WINDOWS) set_target_include_dirs(ll::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 243f22586b..d0e17050bd 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -6,5 +6,5 @@ create_target( ll::freetype) use_prebuilt_binary(freetype) set_target_include_dirs( ll::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) -set_target_libraries( ll::freetype freetype ) +target_link_libraries( ll::freetype INTERFACE freetype ) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index ab7eb38862..f1532510c5 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -7,5 +7,5 @@ create_target( ll::glod ) use_prebuilt_binary(glod) set_target_include_dirs( ll::glod ${LIBS_PREBUILT_DIR}/include) -set_target_libraries( ll::glod GLOD ) +target_link_libraries( ll::glod INTERFACE GLOD ) target_compile_definitions( ll::glod INTERFACE LL_GLOD=1) \ No newline at end of file diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 1f161ec4ff..23558364bb 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -13,15 +13,14 @@ set_target_include_dirs( ll::googlemock if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set_target_libraries( ll::googlemock gmock gtest) + target_link_libraries( ll::googlemock INTERFACE gmock gtest) elseif(WINDOWS) - set_target_libraries( ll::googlemock gmock) + target_link_libraries( ll::googlemock INTERFACE gmock) set_target_include_dirs( ll::googlemock ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock) - elseif(DARWIN) - set_target_libraries( ll::googlemock gmock gtest) + target_link_libraries( ll::googlemock INTERFACE gmock gtest) endif(LINUX) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 258a27b5de..e4352c6967 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -6,11 +6,11 @@ create_target( ll::hunspell ) use_prebuilt_binary(libhunspell) if (WINDOWS) - set_target_libraries( ll::hunspell libhunspell) + target_link_libraries( ll::hunspell INTERFACE libhunspell) elseif(DARWIN) - set_target_libraries( ll::hunspell hunspell-1.3) + target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) elseif(LINUX) - set_target_libraries( ll::hunspell hunspell-1.3) + target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) endif() set_target_include_dirs( ll::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index e6ff4b7b72..d51733b413 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -8,10 +8,10 @@ create_target(ll::jpeglib) use_prebuilt_binary(jpeglib) if (LINUX) - set_target_libraries( ll::jpeglib jpeg) + target_link_libraries( ll::jpeglib INTERFACE jpeg) elseif (DARWIN) - set_target_libraries( ll::jpeglib jpeg) + target_link_libraries( ll::jpeglib INTERFACE jpeg) elseif (WINDOWS) - set_target_libraries( ll::jpeglib jpeglib) + target_link_libraries( ll::jpeglib INTERFACE jpeglib) endif (LINUX) set_target_include_dirs( ll::jpeglib ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index a155c6ea78..7d8c5cac62 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -6,10 +6,10 @@ create_target( ll::jsoncpp) use_prebuilt_binary(jsoncpp) if (WINDOWS) - set_target_libraries( ll::jsoncpp json_libmd.lib ) + target_link_libraries( ll::jsoncpp INTERFACE json_libmd.lib ) elseif (DARWIN) - set_target_libraries( ll::jsoncpp libjson_darwin_libmt.a ) + target_link_libraries( ll::jsoncpp INTERFACE libjson_darwin_libmt.a ) elseif (LINUX) - set_target_libraries( ll::jsoncpp libjson_linux-gcc-4.1.3_libmt.a ) + target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-4.1.3_libmt.a ) endif (WINDOWS) set_target_include_dirs( ll::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index a57c3d8715..08a8229a33 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -14,9 +14,9 @@ if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - set_target_libraries( ll::kdu kdu.lib) + target_link_libraries( ll::kdu INTERFACE kdu.lib) else (WINDOWS) - set_target_libraries( ll::kdu libkdu.a) + target_link_libraries( ll::kdu INTERFACE libkdu.a) endif (WINDOWS) set_target_include_dirs( ll::kdu diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index b51c4c622a..0f21ebb235 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -22,14 +22,14 @@ if (HAVOK) include(Havok) use_prebuilt_binary(llphysicsextensions_source) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src) - set_target_libraries( llphysicsextensions llphysicsextensions) + target_link_libraries( llphysicsextensions INTERFACE llphysicsextensions) elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) - set_target_libraries( llphysicsextensions llphysicsextensions_tpv) + target_link_libraries( llphysicsextensions INTERFACE llphysicsextensions_tpv) else (HAVOK) use_prebuilt_binary(llphysicsextensions_stub) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) - set_target_libraries( llphysicsextensions llphysicsextensionsstub) + target_link_libraries( llphysicsextensions INTERFACE llphysicsextensionsstub) endif (HAVOK) set_target_include_dirs(llphysicsextensions ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 0f0e2d3bbf..adb252b8ee 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -12,20 +12,20 @@ use_prebuilt_binary(pcre) use_prebuilt_binary(libxml2) create_target( ll::pcre ) -set_target_libraries( ll::pcre pcrecpp pcre ) +target_link_libraries( ll::pcre INTERFACE pcrecpp pcre ) create_target( ll::minizip-ng ) if (WINDOWS) - set_target_libraries( ll::minizip-ng libminizip ) + target_link_libraries( ll::minizip-ng INTERFACE libminizip ) else() - set_target_libraries( ll::minizip-ng minizip ) + target_link_libraries( ll::minizip-ng INTERFACE minizip ) endif() create_target( ll::libxml ) if (WINDOWS) - set_target_libraries( ll::libxml libxml2_a) + target_link_libraries( ll::libxml INTERFACE libxml2_a) else() - set_target_libraries( ll::libxml xml2) + target_link_libraries( ll::libxml INTERFACE xml2) endif() create_target( ll::colladadom ) @@ -34,9 +34,9 @@ set_target_include_dirs( ll::colladadom ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) if (WINDOWS) - set_target_libraries(ll::colladadom libcollada14dom23-s ll::libxml ll::minizip-ng ) + target_link_libraries(ll::colladadom INTERFACE libcollada14dom23-s ll::libxml ll::minizip-ng ) elseif (DARWIN) - set_target_libraries(ll::colladadom collada14dom ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) elseif (LINUX) - set_target_libraries(ll::colladadom collada14dom ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) endif() \ No newline at end of file diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 2bbaff942d..6ac2b58017 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -10,7 +10,7 @@ create_target(ll::sdl) if (LINUX) use_prebuilt_binary(SDL) set_target_include_dirs( ll::sdl ${LIBS_PREBUILT_DIR}/i686-linux) - set_target_libraries( ll::sdl SDL directfb fusion direct X11) + target_link_libraries( ll::sdl INTERFACE SDL directfb fusion direct X11) target_compile_definitions( ll::sdl INTERFACE LL_SDL=1) endif (LINUX) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index fd2ee13569..b614b7304f 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -10,18 +10,18 @@ set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") if (WINDOWS) - set_target_libraries( ll::libvlc + target_link_libraries( ll::libvlc INTERFACE libvlc.lib libvlccore.lib ) elseif (DARWIN) - set_target_libraries( ll::libvlc + target_link_libraries( ll::libvlc INTERFACE libvlc.dylib libvlccore.dylib ) elseif (LINUX) # Specify a full path to make sure we get a static link - set_target_libraries( ll::libvlc + target_link_libraries( ll::libvlc INTERFACE ${LIBS_PREBUILT_DIR}/lib/libvlc.a ${LIBS_PREBUILT_DIR}/lib/libvlccore.a ) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 253c24f927..7b89e8707f 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -58,12 +58,12 @@ link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS}) create_target(ll::oslibraries) if (LINUX) - set_target_libraries( ll::oslibraries + target_link_libraries( ll::oslibraries INTERFACE dl pthread rt) elseif (WINDOWS) - set_target_libraries( ll::oslibraries + target_link_libraries( ll::oslibraries INTERFACE advapi32 shell32 ws2_32 @@ -89,7 +89,7 @@ else() find_library(APPKIT_LIBRARY AppKit) find_library(COREAUDIO_LIBRARY CoreAudio) - set_target_libraries( ll::oslibraries + target_link_libraries( ll::oslibraries INTERFACE ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREFOUNDATION_LIBRARY} diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index fd7a650612..6daf0e0741 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -14,9 +14,9 @@ if (NDOF) endif (WINDOWS OR DARWIN) if (WINDOWS) - set_target_libraries( ll::ndof libndofdev) + target_link_libraries( ll::ndof INTERFACE libndofdev) elseif (DARWIN OR LINUX) - set_target_libraries( ll::ndof ndofdev) + target_link_libraries( ll::ndof INTERFACE ndofdev) endif (WINDOWS) target_compile_definitions( ll::ndof INTERFACE LIB_NDOF=1) endif (NDOF) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 3007d6f914..fdff9a72fa 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -6,10 +6,10 @@ create_target( ll::nghttp2 ) use_prebuilt_binary(nghttp2) if (WINDOWS) - set_target_libraries( ll::nghttp2 ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) + target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) elseif (DARWIN) - set_target_libraries( ll::nghttp2 libnghttp2.dylib) + target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.dylib) else (WINDOWS) - set_target_libraries( ll::nghttp2 libnghttp2.a ) + target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.a ) endif (WINDOWS) set_target_include_dirs( ll::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index 63e5dd12de..b06cc78087 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -6,7 +6,7 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) create_target( ll::nvapi ) - set_target_libraries( ll::nvapi nvapi) + target_link_libraries( ll::nvapi INTERFACE nvapi) use_prebuilt_binary(nvapi) endif (WINDOWS) endif (NVAPI) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index b50610c554..8bbb657aea 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -18,12 +18,12 @@ if (USE_OPENAL) use_prebuilt_binary(openal) if(WINDOWS) - set_target_libraries( ll::openal + target_link_libraries( ll::openal INTERFACE OpenAL32 alut ) elseif(LINUX) - set_target_libraries( ll::openal + target_link_libraries( ll::openal INTERFACE openal alut ) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 7d4d0f467a..139f6bc7d7 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -6,5 +6,5 @@ create_target( ll::openjpeg ) use_prebuilt_binary(openjpeg) -set_target_libraries(ll::openjpeg openjpeg ) +target_link_libraries(ll::openjpeg INTERFACE openjpeg ) set_target_include_dirs( ll::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index d586396105..c7be08624d 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -6,11 +6,11 @@ create_target(ll::openssl) use_prebuilt_binary(openssl) if (WINDOWS) - set_target_libraries(ll::openssl libssl libcrypto) + target_link_libraries(ll::openssl INTERFACE libssl libcrypto) elseif (LINUX) - set_target_libraries(ll::openssl ssl crypto dl) + target_link_libraries(ll::openssl INTERFACE ssl crypto dl) else() - set_target_libraries(ll::openssl ssl crypto) + target_link_libraries(ll::openssl INTERFACE ssl crypto) endif (WINDOWS) set_target_include_dirs(ll::openssl ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 2838a6b667..ef4f492ec2 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -6,8 +6,8 @@ create_target(ll::libpng) use_prebuilt_binary(libpng) if (WINDOWS) - set_target_libraries(ll::libpng libpng16) + target_link_libraries(ll::libpng INTERFACE libpng16) else() - set_target_libraries(ll::libpng png16 ) + target_link_libraries(ll::libpng INTERFACE png16 ) endif() set_target_include_dirs( ll::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake index 8c29f4a3c8..076598f6cc 100644 --- a/indra/cmake/PluginAPI.cmake +++ b/indra/cmake/PluginAPI.cmake @@ -3,7 +3,7 @@ create_target( ll::pluginlibraries) if (WINDOWS) - set_target_libraries( ll::pluginlibraries + target_link_libraries( ll::pluginlibraries INTERFACE wsock32 ws2_32 psapi diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 603368304c..95117c539d 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -60,9 +60,7 @@ endmacro (use_prebuilt_binary _binary) function( create_target name ) add_library( ${name} INTERFACE IMPORTED ) endfunction() -function( set_target_libraries target ) - set_property( TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES ${ARGN} ) -endfunction() + function( set_target_include_dirs target) set_property( TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ARGN} ) endfunction() diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 03eb1b3fc4..57b33ce34b 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -9,7 +9,7 @@ endif (LINUX) create_target( ll::uilibraries ) if (LINUX) - set_target_libraries( ll::uilibraries + target_link_libraries( ll::uilibraries INTERFACE atk-1.0 gdk-x11-2.0 gdk_pixbuf-2.0 @@ -28,7 +28,7 @@ if (LINUX) ) endif (LINUX) if( WINDOWS ) - set_target_libraries( ll::uilibraries + target_link_libraries( ll::uilibraries INTERFACE opengl32 comdlg32 dxguid diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index 35f37b4472..72e4594cdd 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -7,10 +7,10 @@ include(Prebuilt) use_prebuilt_binary(uriparser) if (WINDOWS) - set_target_libraries( ll::uriparser uriparser) + target_link_libraries( ll::uriparser INTERFACE uriparser) elseif (LINUX) - set_target_libraries( ll::uriparser uriparser) + target_link_libraries( ll::uriparser INTERFACE uriparser) elseif (DARWIN) - set_target_libraries( ll::uriparser liburiparser.dylib) + target_link_libraries( ll::uriparser INTERFACE liburiparser.dylib) endif (WINDOWS) set_target_include_dirs( ll::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index b2d1d96562..417423f49c 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -5,5 +5,5 @@ include_guard() create_target( ll::xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) -set_target_libraries(ll::xmlrpc-epi xmlrpc-epi ) +target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) set_target_include_dirs( ll::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 6e206f1e48..a95005e368 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -7,8 +7,8 @@ create_target(ll::zlib-ng) use_prebuilt_binary(zlib-ng) if (WINDOWS) - set_target_libraries( ll::zlib-ng zlib ) + target_link_libraries( ll::zlib-ng INTERFACE zlib ) else() - set_target_libraries( ll::zlib-ng z ) + target_link_libraries( ll::zlib-ng INTERFACE z ) endif (WINDOWS) set_target_include_dirs( ll::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 9057ae2272..6f22815855 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -16,13 +16,13 @@ if (USE_BUGSPLAT) include(Prebuilt) use_prebuilt_binary(bugsplat) if (WINDOWS) - set_target_libraries( ll::bugsplat + target_link_libraries( ll::bugsplat INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/bugsplat.lib ) elseif (DARWIN) find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") - set_target_libraries( ll::bugsplat + target_link_libraries( ll::bugsplat INTERFACE ${BUGSPLAT_LIBRARIES} ) else (WINDOWS) -- cgit v1.2.3 From e0cf0cdfd49e5a946dcd202a083fb23f01e4f1fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:04:57 +0200 Subject: Switch to target_include_directories All 3Ps include dirs are treated as SYSTEM, this will stop compilers stop emitting warnings from those files and greatly helps having high warning levels and not being swamped by warnings that come from external libraries. --- indra/cmake/APR.cmake | 2 +- indra/cmake/Audio.cmake | 2 +- indra/cmake/CEFPlugin.cmake | 8 ++++---- indra/cmake/CURL.cmake | 2 +- indra/cmake/EXPAT.cmake | 2 +- indra/cmake/FMODSTUDIO.cmake | 6 +++--- indra/cmake/FreeType.cmake | 2 +- indra/cmake/GLOD.cmake | 2 +- indra/cmake/GoogleMock.cmake | 4 ++-- indra/cmake/Hunspell.cmake | 2 +- indra/cmake/JPEG.cmake | 2 +- indra/cmake/JsonCpp.cmake | 2 +- indra/cmake/LLKDU.cmake | 2 +- indra/cmake/LLPhysicsExtensions.cmake | 2 +- indra/cmake/LLPrimitive.cmake | 2 +- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/NGHTTP2.cmake | 2 +- indra/cmake/OPENAL.cmake | 2 +- indra/cmake/OpenJPEG.cmake | 2 +- indra/cmake/OpenSSL.cmake | 2 +- indra/cmake/PNG.cmake | 2 +- indra/cmake/Prebuilt.cmake | 4 ---- indra/cmake/UI.cmake | 4 ++-- indra/cmake/URIPARSER.cmake | 2 +- indra/cmake/XmlRpcEpi.cmake | 2 +- indra/cmake/ZLIBNG.cmake | 2 +- indra/cmake/bugsplat.cmake | 2 +- 27 files changed, 33 insertions(+), 37 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index a389c09a37..a9500d2068 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -40,4 +40,4 @@ else (WINDOWS) rt ) endif (WINDOWS) -set_target_include_dirs( ll::apr ${LIBS_PREBUILT_DIR}/include/apr-1 ) +target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 ) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 0441f370db..59a589cd0e 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -5,7 +5,7 @@ include_guard() create_target(ll::vorbis) use_prebuilt_binary(ogg_vorbis) -set_target_include_dirs( ll::vorbis ${LIBS_PREBUILT_DIR}/include ) +target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) if (WINDOWS) target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static ) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 41d1b521f7..2b5db1773b 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -3,13 +3,13 @@ include(Linking) include(Prebuilt) include_guard() -create_target( cef::cef ) +create_target( ll::cef ) use_prebuilt_binary(dullahan) -set_target_include_dirs( cef::cef ${LIBS_PREBUILT_DIR}/include/cef) +target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/cef) if (WINDOWS) - target_link_libraries( cef::cef INTERFACE + target_link_libraries( ll::cef INTERFACE libcef.lib libcef_dll_wrapper.lib dullahan.lib @@ -25,7 +25,7 @@ elseif (DARWIN) message(FATAL_ERROR "CEF not found") endif() - target_link_libraries( cef::cef INTERFACE + target_link_libraries( ll::cef INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a ${APPKIT_LIBRARY} diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index ee00113f75..ce7711e479 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -10,4 +10,4 @@ if (WINDOWS) else (WINDOWS) target_link_libraries(ll::libcurl INTERFACE libcurl.a) endif (WINDOWS) -set_target_include_dirs( ll::libcurl ${LIBS_PREBUILT_DIR}/include) +target_include_directories( ll::libcurl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 44e83c2e47..4947c40e02 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -16,4 +16,4 @@ else (WINDOWS) set(EXPAT_COPY libexpat.so.1 libexpat.so) endif () endif (WINDOWS) -set_target_include_dirs( ll::expat ${LIBS_PREBUILT_DIR}/include ) +target_include_directories( ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index aec86125e8..a3fd9c718a 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -23,8 +23,8 @@ if (USE_FMODSTUDIO) if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If the path have been specified in the arguments, use that - target_link_libraries(fmodstudio::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY}) - set_target_include_dirs(fmodstudio::fmodstudio ${FMODSTUDIO_INCLUDE_DIR}) + target_link_libraries(ll::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY}) + target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${FMODSTUDIO_INCLUDE_DIR}) else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) # If not, we're going to try to get the package listed in autobuild.xml # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) @@ -40,7 +40,7 @@ if (USE_FMODSTUDIO) target_link_libraries( ll::fmodstudio INTERFACE fmod) endif (WINDOWS) - set_target_include_dirs(ll::fmodstudio ${LIBS_PREBUILT_DIR}/include/fmodstudio) + target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio) endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) else() set( USE_FMODSTUDIO "OFF") diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index d0e17050bd..c8454eb3b9 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -5,6 +5,6 @@ include_guard() create_target( ll::freetype) use_prebuilt_binary(freetype) -set_target_include_dirs( ll::freetype ${LIBS_PREBUILT_DIR}/include/freetype2/) +target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) target_link_libraries( ll::freetype INTERFACE freetype ) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index f1532510c5..9070be302a 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -6,6 +6,6 @@ create_target( ll::glod ) use_prebuilt_binary(glod) -set_target_include_dirs( ll::glod ${LIBS_PREBUILT_DIR}/include) +target_include_directories( ll::glod SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) target_link_libraries( ll::glod INTERFACE GLOD ) target_compile_definitions( ll::glod INTERFACE LL_GLOD=1) \ No newline at end of file diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 23558364bb..01ef4de093 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -7,7 +7,7 @@ include_guard() use_prebuilt_binary(googlemock) create_target( ll::googlemock ) -set_target_include_dirs( ll::googlemock +target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) @@ -16,7 +16,7 @@ if (LINUX) target_link_libraries( ll::googlemock INTERFACE gmock gtest) elseif(WINDOWS) target_link_libraries( ll::googlemock INTERFACE gmock) - set_target_include_dirs( ll::googlemock + target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock) elseif(DARWIN) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index e4352c6967..0994d2b5f4 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -12,5 +12,5 @@ elseif(DARWIN) elseif(LINUX) target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) endif() -set_target_include_dirs( ll::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) +target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index d51733b413..af984b6ac3 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -14,4 +14,4 @@ elseif (DARWIN) elseif (WINDOWS) target_link_libraries( ll::jpeglib INTERFACE jpeglib) endif (LINUX) -set_target_include_dirs( ll::jpeglib ${LIBS_PREBUILT_DIR}/include) +target_include_directories( ll::jpeglib SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 7d8c5cac62..1c354350c3 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -12,4 +12,4 @@ elseif (DARWIN) elseif (LINUX) target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-4.1.3_libmt.a ) endif (WINDOWS) -set_target_include_dirs( ll::jsoncpp ${LIBS_PREBUILT_DIR}/include/json) +target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/json) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 08a8229a33..bf358cc0eb 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -19,7 +19,7 @@ if (USE_KDU) target_link_libraries( ll::kdu INTERFACE libkdu.a) endif (WINDOWS) - set_target_include_dirs( ll::kdu + target_include_directories( ll::kdu SYSTEM INTERFACE ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 0f21ebb235..014ec6a98b 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -32,4 +32,4 @@ else (HAVOK) target_link_libraries( llphysicsextensions INTERFACE llphysicsextensionsstub) endif (HAVOK) -set_target_include_dirs(llphysicsextensions ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) +target_include_directories( llphysicsextensions INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index adb252b8ee..0026f183e6 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -29,7 +29,7 @@ else() endif() create_target( ll::colladadom ) -set_target_include_dirs( ll::colladadom +target_include_directories( ll::colladadom SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 6ac2b58017..fdeb4aa434 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,7 +9,7 @@ create_target(ll::sdl) if (LINUX) use_prebuilt_binary(SDL) - set_target_include_dirs( ll::sdl ${LIBS_PREBUILT_DIR}/i686-linux) + target_include_directories( ll::sdl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/i686-linux) target_link_libraries( ll::sdl INTERFACE SDL directfb fusion direct X11) target_compile_definitions( ll::sdl INTERFACE LL_SDL=1) endif (LINUX) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index fdff9a72fa..7e59a7d9a7 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -12,4 +12,4 @@ elseif (DARWIN) else (WINDOWS) target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.a ) endif (WINDOWS) -set_target_include_dirs( ll::nghttp2 ${LIBS_PREBUILT_DIR}/include/nghttp2) +target_include_directories( ll::nghttp2 SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 8bbb657aea..faa247769b 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -13,7 +13,7 @@ endif() if (USE_OPENAL) create_target( ll::openal ) - set_target_include_dirs( ll::openal "${LIBS_PREBUILT_DIR}/include/AL") + 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) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 139f6bc7d7..07dee5c23d 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -7,4 +7,4 @@ create_target( ll::openjpeg ) use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjpeg ) -set_target_include_dirs( ll::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) +target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index c7be08624d..6c9abc9e7f 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -12,5 +12,5 @@ elseif (LINUX) else() target_link_libraries(ll::openssl INTERFACE ssl crypto) endif (WINDOWS) -set_target_include_dirs(ll::openssl ${LIBS_PREBUILT_DIR}/include) +target_include_directories( ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index ef4f492ec2..5a8d3e197d 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -10,4 +10,4 @@ if (WINDOWS) else() target_link_libraries(ll::libpng INTERFACE png16 ) endif() -set_target_include_dirs( ll::libpng ${LIBS_PREBUILT_DIR}/include/libpng16) +target_include_directories( ll::libpng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 95117c539d..593eb3958c 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -61,7 +61,3 @@ function( create_target name ) add_library( ${name} INTERFACE IMPORTED ) endfunction() -function( set_target_include_dirs target) - set_property( TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ARGN} ) -endfunction() - diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 57b33ce34b..c23fb6e8a7 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -43,7 +43,7 @@ if( WINDOWS ) ) endif() -set_target_include_dirs( ll::uilibraries +target_include_directories( ll::uilibraries SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) @@ -62,7 +62,7 @@ set_target_include_dirs( ll::uilibraries # pango-1.0 # ) #foreach(include ${${LL_ARCH}_INCLUDES}) -# set_target_include_dirs( ll::uilibraries +# target_include_directories( ll::uilibraries SYSTEM INTERFACE # ${LIBS_PREBUILT_DIR}/include/${include} # ) #endforeach(include) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index 72e4594cdd..8639eab891 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -13,4 +13,4 @@ elseif (LINUX) elseif (DARWIN) target_link_libraries( ll::uriparser INTERFACE liburiparser.dylib) endif (WINDOWS) -set_target_include_dirs( ll::uriparser ${LIBS_PREBUILT_DIR}/include/uriparser) +target_include_directories( ll::uriparser SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/uriparser) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 417423f49c..aad9d1e476 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -6,4 +6,4 @@ create_target( ll::xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) -set_target_include_dirs( ll::xmlrpc-epi ${LIBS_PREBUILT_DIR}/include) +target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index a95005e368..a7779af3cd 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -11,4 +11,4 @@ if (WINDOWS) else() target_link_libraries( ll::zlib-ng INTERFACE z ) endif (WINDOWS) -set_target_include_dirs( ll::zlib-ng ${LIBS_PREBUILT_DIR}/include/zlib-ng) +target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/zlib-ng) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 6f22815855..21a6e074fc 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -33,7 +33,7 @@ if (USE_BUGSPLAT) message( FATAL_ERROR "You need to set BUGSPLAT_DB when setting USE_BUGSPLAT" ) endif() - set_target_include_dirs( ll::bugsplat ${LIBS_PREBUILT_DIR}/include/bugsplat) + target_include_directories( ll::bugsplat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/bugsplat) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) else() set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") -- cgit v1.2.3 From 363f2df4fa22b3eb95ff4603d73b7a042f3fefd1 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:28:55 +0200 Subject: Remove function create_target and instead directly use add_library --- indra/cmake/APR.cmake | 2 +- indra/cmake/Audio.cmake | 2 +- indra/cmake/Boost.cmake | 2 +- indra/cmake/CEFPlugin.cmake | 2 +- indra/cmake/CURL.cmake | 2 +- indra/cmake/EXPAT.cmake | 2 +- indra/cmake/FMODSTUDIO.cmake | 2 +- indra/cmake/FreeType.cmake | 2 +- indra/cmake/GLOD.cmake | 2 +- indra/cmake/GoogleMock.cmake | 2 +- indra/cmake/Hunspell.cmake | 2 +- indra/cmake/JPEG.cmake | 2 +- indra/cmake/JsonCpp.cmake | 2 +- indra/cmake/LLKDU.cmake | 2 +- indra/cmake/LLPhysicsExtensions.cmake | 2 +- indra/cmake/LLPrimitive.cmake | 8 ++++---- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/LibVLCPlugin.cmake | 2 +- indra/cmake/Linking.cmake | 2 +- indra/cmake/NDOF.cmake | 2 +- indra/cmake/NGHTTP2.cmake | 2 +- indra/cmake/NVAPI.cmake | 2 +- indra/cmake/OPENAL.cmake | 2 +- indra/cmake/OpenJPEG.cmake | 2 +- indra/cmake/OpenSSL.cmake | 2 +- indra/cmake/PNG.cmake | 2 +- indra/cmake/PluginAPI.cmake | 2 +- indra/cmake/Prebuilt.cmake | 4 ---- indra/cmake/UI.cmake | 4 ++-- indra/cmake/URIPARSER.cmake | 2 +- indra/cmake/XmlRpcEpi.cmake | 2 +- indra/cmake/ZLIBNG.cmake | 2 +- indra/cmake/bugsplat.cmake | 2 +- 33 files changed, 36 insertions(+), 40 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index a9500d2068..1c635d4531 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -3,7 +3,7 @@ include(Prebuilt) include_guard() -create_target( ll::apr) +add_library( ll::apr INTERFACE IMPORTED ) use_prebuilt_binary(apr_suite) if (WINDOWS) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 59a589cd0e..ddba066727 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target(ll::vorbis) +add_library( ll::vorbis INTERFACE IMPORTED ) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index e713d50fc1..f4f824769e 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::boost ) +add_library( ll::boost INTERFACE IMPORTED ) use_prebuilt_binary(boost) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 2b5db1773b..9b77becf29 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -3,7 +3,7 @@ include(Linking) include(Prebuilt) include_guard() -create_target( ll::cef ) +add_library( ll::cef INTERFACE IMPORTED ) use_prebuilt_binary(dullahan) target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/cef) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index ce7711e479..e8b04177c1 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target(ll::libcurl) +add_library( ll::libcurl INTERFACE IMPORTED ) use_prebuilt_binary(curl) if (WINDOWS) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 4947c40e02..8a48908401 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::expat INTERFACE IMPORTED ) +add_library( ll::expat INTERFACE IMPORTED ) use_prebuilt_binary(expat) if (WINDOWS) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index a3fd9c718a..c5b21ac4e5 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -17,7 +17,7 @@ if(FMODSTUDIO) endif() if (USE_FMODSTUDIO) - create_target( ll::fmodstudio ) + add_library( ll::fmodstudio INTERFACE IMPORTED ) target_compile_definitions( ll::fmodstudio INTERFACE LL_FMODSTUDIO=1) if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index c8454eb3b9..1974e2879e 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::freetype) +add_library( ll::freetype INTERFACE IMPORTED ) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 9070be302a..db00a309f0 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::glod ) +add_library( ll::glod INTERFACE IMPORTED ) use_prebuilt_binary(glod) diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 01ef4de093..2036e43dd0 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -6,7 +6,7 @@ include_guard() use_prebuilt_binary(googlemock) -create_target( ll::googlemock ) +add_library( ll::googlemock INTERFACE IMPORTED ) target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 0994d2b5f4..7786418226 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::hunspell ) +add_library( ll::hunspell INTERFACE IMPORTED ) use_prebuilt_binary(libhunspell) if (WINDOWS) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index af984b6ac3..a6ef5d4ad9 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include(Linking) include_guard() -create_target(ll::jpeglib) +add_library( ll::jpeglib INTERFACE IMPORTED ) use_prebuilt_binary(jpeglib) if (LINUX) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 1c354350c3..0b6a82e576 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::jsoncpp) +add_library( ll::jsoncpp INTERFACE IMPORTED ) use_prebuilt_binary(jsoncpp) if (WINDOWS) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index bf358cc0eb..fda25610da 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -8,7 +8,7 @@ if (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) include_guard() -create_target( ll::kdu ) +add_library( ll::kdu INTERFACE IMPORTED ) if (USE_KDU) include(Prebuilt) diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 014ec6a98b..9c628b84b1 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -11,7 +11,7 @@ if (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) include_guard() -create_target(llphysicsextensions) +add_library( llphysicsextensions INTERFACE IMPORTED ) # Note that the use_prebuilt_binary macros below do not in fact include binaries; diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 0026f183e6..e643243fca 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -11,24 +11,24 @@ use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(pcre) use_prebuilt_binary(libxml2) -create_target( ll::pcre ) +add_library( ll::pcre INTERFACE IMPORTED ) target_link_libraries( ll::pcre INTERFACE pcrecpp pcre ) -create_target( ll::minizip-ng ) +add_library( ll::minizip-ng INTERFACE IMPORTED ) if (WINDOWS) target_link_libraries( ll::minizip-ng INTERFACE libminizip ) else() target_link_libraries( ll::minizip-ng INTERFACE minizip ) endif() -create_target( ll::libxml ) +add_library( ll::libxml INTERFACE IMPORTED ) if (WINDOWS) target_link_libraries( ll::libxml INTERFACE libxml2_a) else() target_link_libraries( ll::libxml INTERFACE xml2) endif() -create_target( ll::colladadom ) +add_library( ll::colladadom INTERFACE IMPORTED ) target_include_directories( ll::colladadom SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada/1.4 diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index fdeb4aa434..8cf450ff21 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -5,7 +5,7 @@ include(GLEXT) include(Prebuilt) include_guard() -create_target(ll::sdl) +add_library( ll::sdl INTERFACE IMPORTED ) if (LINUX) use_prebuilt_binary(SDL) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index b614b7304f..599ce02844 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -3,7 +3,7 @@ include(Linking) include(Prebuilt) include_guard() -create_target( ll::libvlc ) +add_library( ll::libvlc INTERFACE IMPORTED ) use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 7b89e8707f..5a16776e57 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -55,7 +55,7 @@ endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS}) -create_target(ll::oslibraries) +add_library( ll::oslibraries INTERFACE IMPORTED ) if (LINUX) target_link_libraries( ll::oslibraries INTERFACE diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 6daf0e0741..b88fbccf2a 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -4,7 +4,7 @@ include(Prebuilt) set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.") include_guard() -create_target( ll::ndof ) +add_library( ll::ndof INTERFACE IMPORTED ) if (NDOF) if (WINDOWS OR DARWIN) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 7e59a7d9a7..2ac204bfcb 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -2,7 +2,7 @@ include(Linking) include(Prebuilt) include_guard() -create_target( ll::nghttp2 ) +add_library( ll::nghttp2 INTERFACE IMPORTED ) use_prebuilt_binary(nghttp2) if (WINDOWS) diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index b06cc78087..ff5a5428e0 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -5,7 +5,7 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) - create_target( ll::nvapi ) + add_library( ll::nvapi INTERFACE IMPORTED ) target_link_libraries( ll::nvapi INTERFACE nvapi) use_prebuilt_binary(nvapi) endif (WINDOWS) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index faa247769b..84dad367b7 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -12,7 +12,7 @@ if(OPENAL) endif() if (USE_OPENAL) - create_target( ll::openal ) + add_library( ll::openal INTERFACE IMPORTED ) 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) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 07dee5c23d..184fbb3c5f 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::openjpeg ) +add_library( ll::openjpeg INTERFACE IMPORTED ) use_prebuilt_binary(openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 6c9abc9e7f..dfc6520362 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target(ll::openssl) +add_library( ll::openssl INTERFACE IMPORTED ) use_prebuilt_binary(openssl) if (WINDOWS) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 5a8d3e197d..672f963ea1 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target(ll::libpng) +add_library( ll::libpng INTERFACE IMPORTED ) use_prebuilt_binary(libpng) if (WINDOWS) diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake index 076598f6cc..114415e514 100644 --- a/indra/cmake/PluginAPI.cmake +++ b/indra/cmake/PluginAPI.cmake @@ -1,6 +1,6 @@ # -*- cmake -*- -create_target( ll::pluginlibraries) +add_library( ll::pluginlibraries INTERFACE IMPORTED ) if (WINDOWS) target_link_libraries( ll::pluginlibraries INTERFACE diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 593eb3958c..f0192ec45b 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -57,7 +57,3 @@ macro (use_prebuilt_binary _binary) endif (NOT ${_binary}_installed EQUAL 0) endmacro (use_prebuilt_binary _binary) -function( create_target name ) - add_library( ${name} INTERFACE IMPORTED ) -endfunction() - diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index c23fb6e8a7..6a2e6f22df 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -6,7 +6,7 @@ if (LINUX) use_prebuilt_binary(gtk-atk-pango-glib) endif (LINUX) -create_target( ll::uilibraries ) +add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX) target_link_libraries( ll::uilibraries INTERFACE @@ -68,5 +68,5 @@ target_include_directories( ll::uilibraries SYSTEM INTERFACE #endforeach(include) if (LINUX) - set_target_properties(ll::uilibraries PROPERTIES COMPILE_DEFINITIONS LL_GTK=1 LL_X11=1 ) + target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) endif (LINUX) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index 8639eab891..cc181f74f8 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -1,7 +1,7 @@ # -*- cmake -*- include_guard() -create_target( ll::uriparser ) +add_library( ll::uriparser INTERFACE IMPORTED ) include(Prebuilt) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index aad9d1e476..83f06788f2 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::xmlrpc-epi ) +add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) use_prebuilt_binary(xmlrpc-epi) target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index a7779af3cd..221452d9d0 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -3,7 +3,7 @@ include(Prebuilt) include_guard() -create_target(ll::zlib-ng) +add_library( ll::zlib-ng INTERFACE IMPORTED ) use_prebuilt_binary(zlib-ng) if (WINDOWS) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 21a6e074fc..f645d9d449 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -10,7 +10,7 @@ else (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) include_guard() -create_target(ll::bugsplat) +add_library( ll::bugsplat INTERFACE IMPORTED ) if (USE_BUGSPLAT) include(Prebuilt) -- cgit v1.2.3 From 1966d837e196f1ef043ee46666a9f661d6f54db1 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 02:50:43 +0200 Subject: jsoncpp includepath should not include json/. jsoncpp includes a header "features.h" which has the same name as a glibc header, allowing this header to be found without any prefix will lead to head conflicts when there is a '#include "features.h"' As a result all json headers need to be included via #include "json/reader.h"/"json/writer.h" --- indra/cmake/JsonCpp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 0b6a82e576..e7f7c13134 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -12,4 +12,4 @@ elseif (DARWIN) elseif (LINUX) target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-4.1.3_libmt.a ) endif (WINDOWS) -target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/json) +target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) -- cgit v1.2.3 From e743efcc4896c99161cc47adc96379de3ac2d6f3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:05:06 +0200 Subject: - Change OpenAL to OPENAL to match the correct filename, Windows and OSX use case insesitive fielsystem, this is why it was not issues there - Remove input files that are obsolete. --- indra/cmake/Copy3rdPartyLibs.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index e16e1e5572..1a0f6868fb 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -6,7 +6,7 @@ include(CMakeCopyIfDifferent) include(Linking) -include(OpenAL) +include(OPENAL) include(FMODSTUDIO) # When we copy our dependent libraries, we almost always want to copy them to @@ -219,7 +219,6 @@ elseif(LINUX) libapr-1.so.0 libaprutil-1.so.0 libatk-1.0.so - libdb-5.1.so ${EXPAT_COPY} libfreetype.so.6.6.2 libfreetype.so.6 @@ -227,8 +226,6 @@ elseif(LINUX) libgmodule-2.0.so libgobject-2.0.so libhunspell-1.3.so.0.0.0 - libopenal.so - libopenjpeg.so libuuid.so.16 libuuid.so.16.0.22 libfontconfig.so.1.8.0 -- cgit v1.2.3 From 4416db9a261443f48034a1c0a2457510cffd05b0 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:08:46 +0200 Subject: Remvoe -D that had been passed in front of each entry of add_compile_definitions, this lead to '-D-D' --- indra/cmake/00-Common.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 25ab731842..7be5e7b0a0 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -114,11 +114,11 @@ if (LINUX) set(CMAKE_SKIP_RPATH TRUE) add_compile_definitions( - -D_REENTRANT - -D_FORTIFY_SOURCE=2 - -DEXTERNAL_TOS - -DAPPID=secondlife - -DLL_IGNORE_SIGCHLD + _REENTRANT + _FORTIFY_SOURCE=2 + EXTERNAL_TOS + APPID=secondlife + LL_IGNORE_SIGCHLD ) add_compile_options( -fexceptions -- cgit v1.2.3 From d65a5832bfb1b35e22ee9ae14a4f00034c7cf2dd Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:10:02 +0200 Subject: ll::sdl had a wrong include directory. --- indra/cmake/LLWindow.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 8cf450ff21..777acb19a7 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,7 +9,7 @@ add_library( ll::sdl INTERFACE IMPORTED ) if (LINUX) use_prebuilt_binary(SDL) - target_include_directories( ll::sdl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/i686-linux) + target_include_directories( ll::sdl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) target_link_libraries( ll::sdl INTERFACE SDL directfb fusion direct X11) target_compile_definitions( ll::sdl INTERFACE LL_SDL=1) endif (LINUX) -- cgit v1.2.3 From a9f4e88a30ada36b098f0d43e7a652ab4df7a0d9 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:10:54 +0200 Subject: Introduce ll::fontconfig target (missing the correct link library, but at least this gets us compiling) --- indra/cmake/ViewerMiscLibs.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 1dff854855..7b5c990094 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -4,6 +4,7 @@ include(Prebuilt) if (LINUX) use_prebuilt_binary(libuuid) use_prebuilt_binary(fontconfig) + add_library( ll::fontconfig INTERFACE IMPORTED ) endif (LINUX) use_prebuilt_binary(libhunspell) use_prebuilt_binary(slvoice) -- cgit v1.2.3 From e1802784773bc6e6031490063f858bde74131389 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:13:39 +0200 Subject: zlib-ng for Linux is still broken. This needs revisiting, but at least gets up compiling for now. --- indra/cmake/ZLIBNG.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 221452d9d0..a1a1860bc6 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -11,4 +11,7 @@ if (WINDOWS) else() target_link_libraries( ll::zlib-ng INTERFACE z ) endif (WINDOWS) -target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/zlib-ng) + +if( NOT LINUX ) + target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/zlib-ng) +endif() -- cgit v1.2.3 From da24787167764f689ce1ea5904bf3047c2264f72 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:43:42 +0200 Subject: Enable LL_OS_DRAGDROP_ENABLED for Linux --- indra/cmake/DragDrop.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/DragDrop.cmake b/indra/cmake/DragDrop.cmake index cbbf5747a7..26e7828830 100644 --- a/indra/cmake/DragDrop.cmake +++ b/indra/cmake/DragDrop.cmake @@ -10,7 +10,7 @@ if (OS_DRAG_DROP) add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) endif (DARWIN) if (LINUX) - add_definitions(-DLL_OS_DRAGDROP_ENABLED=0) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) endif (LINUX) endif (OS_DRAG_DROP) -- cgit v1.2.3 From 2b151e0aefd54671e1be504269f10318d303dccb Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 18:11:43 +0200 Subject: Round one to support conan for 3P packages, this allows to build the viewer on Linux again. --- indra/cmake/APR.cmake | 2 ++ indra/cmake/Audio.cmake | 1 + indra/cmake/Boost.cmake | 6 ++++++ indra/cmake/CURL.cmake | 1 + indra/cmake/Copy3rdPartyLibs.cmake | 36 +++++++++++++++++++++--------------- indra/cmake/DBusGlib.cmake | 25 ++++++++----------------- indra/cmake/EXPAT.cmake | 1 + indra/cmake/FreeType.cmake | 1 + indra/cmake/GLEXT.cmake | 5 ++++- indra/cmake/GLH.cmake | 3 +++ indra/cmake/GLOD.cmake | 1 + indra/cmake/GStreamer010Plugin.cmake | 34 +++++++--------------------------- indra/cmake/GoogleMock.cmake | 6 +++++- indra/cmake/Hunspell.cmake | 2 +- indra/cmake/JPEG.cmake | 11 ++++++----- indra/cmake/JsonCpp.cmake | 2 ++ indra/cmake/LLPrimitive.cmake | 20 +++++++++++++++----- indra/cmake/LLWindow.cmake | 13 +++++++++---- indra/cmake/NGHTTP2.cmake | 1 + indra/cmake/OpenJPEG.cmake | 1 + indra/cmake/OpenSSL.cmake | 1 + indra/cmake/PNG.cmake | 1 + indra/cmake/Prebuilt.cmake | 13 +++++++++++++ indra/cmake/UI.cmake | 15 ++++++++------- indra/cmake/URIPARSER.cmake | 5 ++++- indra/cmake/ViewerMiscLibs.cmake | 15 ++++++++++++--- indra/cmake/XmlRpcEpi.cmake | 2 ++ indra/cmake/ZLIBNG.cmake | 5 +++++ 28 files changed, 142 insertions(+), 87 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 1c635d4531..898979c47e 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -5,7 +5,9 @@ include_guard() add_library( ll::apr INTERFACE IMPORTED ) +use_conan_binary( apr apr-util ) use_prebuilt_binary(apr_suite) + if (WINDOWS) if (LLCOMMON_LINK_SHARED) set(APR_selector "lib") diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index ddba066727..4b06de0a08 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::vorbis INTERFACE IMPORTED ) +use_conan_binary(vorbis) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index f4f824769e..601a23a86d 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -2,7 +2,13 @@ include(Prebuilt) include_guard() + add_library( ll::boost INTERFACE IMPORTED ) +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() +endif() use_prebuilt_binary(boost) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index e8b04177c1..7c93819e75 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::libcurl INTERFACE IMPORTED ) +use_conan_binary(libcurl) use_prebuilt_binary(curl) if (WINDOWS) target_link_libraries(ll::libcurl INTERFACE libcurl.lib) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 1a0f6868fb..f6e224665b 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -216,22 +216,28 @@ elseif(LINUX) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") # *FIX - figure out what to do with duplicate libalut.so here -brad set(release_files - libapr-1.so.0 - libaprutil-1.so.0 - libatk-1.0.so - ${EXPAT_COPY} - libfreetype.so.6.6.2 - libfreetype.so.6 - libGLOD.so - libgmodule-2.0.so - libgobject-2.0.so - libhunspell-1.3.so.0.0.0 - libuuid.so.16 - libuuid.so.16.0.22 - libfontconfig.so.1.8.0 - libfontconfig.so.1 - ) + ${EXPAT_COPY} + ) + if( NOT USE_CONAN ) + list( APPEND release_files + libapr-1.so.0 + libaprutil-1.so.0 + libatk-1.0.so + libfreetype.so.6.6.2 + libfreetype.so.6 + libGLOD.so + libhunspell-1.3.so.0.0.0 + libuuid.so.16 + libuuid.so.16.0.22 + libfontconfig.so.1.8.0 + libfontconfig.so.1 + libgmodule-2.0.so + libgobject-2.0.so + ) + endif() + + if (TARGET ll::fmodstudio) set(debug_files ${debug_files} "libfmodL.so") set(release_files ${release_files} "libfmod.so") diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 7c95bf8c20..ce5d10be5c 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -1,22 +1,13 @@ # -*- cmake -*- include(Prebuilt) -use_prebuilt_binary(dbus_glib) -set(DBUSGLIB_FOUND ON FORCE BOOL) -set(DBUSGLIB_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include/dbus - ) -# We don't need to explicitly link against dbus-glib itself, because -# the viewer probes for the system's copy at runtime. -set(DBUSGLIB_LIBRARIES - gobject-2.0 - glib-2.0 - ) +add_library( ll::dbus INTERFACE IMPORTED) + +# Only define this when using conan, lls prebuild is brokenb +if( USE_CONAN ) + target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED ) +endif() +use_conan_binary(dbus) -if (DBUSGLIB_FOUND) - set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") -endif (DBUSGLIB_FOUND) +use_prebuilt_binary(dbus_glib) -if (DBUSGLIB) - add_definitions(-DLL_DBUS_ENABLED=1) -endif (DBUSGLIB) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 8a48908401..e5c9dd5582 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::expat INTERFACE IMPORTED ) +use_conan_binary(expat) use_prebuilt_binary(expat) if (WINDOWS) target_link_libraries( ll::expat INTERFACE libexpatMT ) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 1974e2879e..92130402f9 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) +use_conan_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) target_link_libraries( ll::freetype INTERFACE freetype ) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index f6c39fe137..70477cf0af 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -1,8 +1,11 @@ # -*- cmake -*- include(Prebuilt) +include(GLH) +add_library( ll::glext INTERFACE IMPORTED ) if (WINDOWS OR LINUX) + use_conan_binary(glext) use_prebuilt_binary(glext) endif (WINDOWS OR LINUX) -use_prebuilt_binary(glh_linear) + diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index b420ad413f..18521b5069 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -1,4 +1,7 @@ # -*- cmake -*- include(Prebuilt) +add_library( ll::glh_linear INTERFACE IMPORTED ) + +use_conan_binary( glh_linear ) use_prebuilt_binary(glh_linear) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index db00a309f0..61c0c166d4 100644 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::glod INTERFACE IMPORTED ) +use_conan_binary(glod) use_prebuilt_binary(glod) target_include_directories( ll::glod SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake index 848d4f7fc6..0b6a7a21c3 100644 --- a/indra/cmake/GStreamer010Plugin.cmake +++ b/indra/cmake/GStreamer010Plugin.cmake @@ -1,32 +1,12 @@ # -*- cmake -*- include(Prebuilt) -if (LINUX) - use_prebuilt_binary(gstreamer) - # possible libxml2 should have its own .cmake file instead - use_prebuilt_binary(libxml2) - set(GSTREAMER010_FOUND ON FORCE BOOL) - set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL) - set(GSTREAMER010_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include/gstreamer-0.10 - ${LIBS_PREBUILT_DIR}/include/glib-2.0 - ${LIBS_PREBUILT_DIR}/include/libxml2 - ) - # We don't need to explicitly link against gstreamer itself, because - # LLMediaImplGStreamer probes for the system's copy at runtime. - set(GSTREAMER010_LIBRARIES - gobject-2.0 - gmodule-2.0 - dl - gthread-2.0 - glib-2.0 - ) -endif () +if (NOT LINUX) + return() +endif() -if (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND) - set(GSTREAMER010 ON CACHE BOOL "Build with GStreamer-0.10 streaming media support.") -endif (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND) +add_library( ll::gstreamer INTERFACE IMPORTED ) +target_compile_definitions( ll::gstreamer INTERFACE LL_GSTREAMER010_ENABLED=1) +use_conan_binary(gstreamer) -if (GSTREAMER010) - add_definitions(-DLL_GSTREAMER010_ENABLED=1) -endif (GSTREAMER010) +use_prebuilt_binary(gstreamer) diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 2036e43dd0..753b972e95 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -4,9 +4,13 @@ include(Linking) include_guard() -use_prebuilt_binary(googlemock) +if(USE_CONAN) + return() +endif() add_library( ll::googlemock INTERFACE IMPORTED ) +use_prebuilt_binary(googlemock) + target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 7786418226..c372d83f8d 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -3,7 +3,7 @@ include(Prebuilt) include_guard() add_library( ll::hunspell INTERFACE IMPORTED ) - +use_conan_binary(hunspell) use_prebuilt_binary(libhunspell) if (WINDOWS) target_link_libraries( ll::hunspell INTERFACE libhunspell) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index a6ef5d4ad9..900fc77c40 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -4,14 +4,15 @@ include(Prebuilt) include(Linking) include_guard() -add_library( ll::jpeglib INTERFACE IMPORTED ) +add_library( ll::libjpeg INTERFACE IMPORTED ) +use_conan_binary(libjpeg) use_prebuilt_binary(jpeglib) if (LINUX) - target_link_libraries( ll::jpeglib INTERFACE jpeg) + target_link_libraries( ll::libjpeg INTERFACE jpeg) elseif (DARWIN) - target_link_libraries( ll::jpeglib INTERFACE jpeg) + target_link_libraries( ll::libjpeg INTERFACE jpeg) elseif (WINDOWS) - target_link_libraries( ll::jpeglib INTERFACE jpeglib) + target_link_libraries( ll::libjpeg INTERFACE jpeglib) endif (LINUX) -target_include_directories( ll::jpeglib SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) +target_include_directories( ll::libjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index e7f7c13134..f62b2bdd7a 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -4,6 +4,8 @@ include(Prebuilt) include_guard() add_library( ll::jsoncpp INTERFACE IMPORTED ) +use_conan_binary(jsoncpp) + use_prebuilt_binary(jsoncpp) if (WINDOWS) target_link_libraries( ll::jsoncpp INTERFACE json_libmd.lib ) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index e643243fca..3e5ff4963b 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -6,29 +6,39 @@ include(Boost) include_guard() +add_library( ll::pcre INTERFACE IMPORTED ) +add_library( ll::minizip-ng INTERFACE IMPORTED ) +add_library( ll::libxml INTERFACE IMPORTED ) +add_library( ll::colladadom INTERFACE IMPORTED ) + +# ND, needs fixup in collada conan pkg +if( USE_CONAN ) + target_include_directories( ll::colladadom SYSTEM INTERFACE + "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/" + "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" ) +endif() + +use_conan_binary( colladadom ) + use_prebuilt_binary(colladadom) use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(pcre) use_prebuilt_binary(libxml2) -add_library( ll::pcre INTERFACE IMPORTED ) target_link_libraries( ll::pcre INTERFACE pcrecpp pcre ) -add_library( ll::minizip-ng INTERFACE IMPORTED ) if (WINDOWS) target_link_libraries( ll::minizip-ng INTERFACE libminizip ) else() target_link_libraries( ll::minizip-ng INTERFACE minizip ) endif() -add_library( ll::libxml INTERFACE IMPORTED ) if (WINDOWS) target_link_libraries( ll::libxml INTERFACE libxml2_a) else() target_link_libraries( ll::libxml INTERFACE xml2) endif() -add_library( ll::colladadom INTERFACE IMPORTED ) target_include_directories( ll::colladadom SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada/1.4 @@ -39,4 +49,4 @@ elseif (DARWIN) target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) elseif (LINUX) target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) -endif() \ No newline at end of file +endif() diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 777acb19a7..0136d56723 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -5,13 +5,18 @@ include(GLEXT) include(Prebuilt) include_guard() -add_library( ll::sdl INTERFACE IMPORTED ) +add_library( ll::SDL INTERFACE IMPORTED ) + if (LINUX) + #Must come first as use_conan_binary can exit this file early + target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) + + use_conan_binary(SDL) use_prebuilt_binary(SDL) - target_include_directories( ll::sdl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - target_link_libraries( ll::sdl INTERFACE SDL directfb fusion direct X11) - target_compile_definitions( ll::sdl INTERFACE LL_SDL=1) + + target_include_directories( ll::SDL SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) + target_link_libraries( ll::SDL INTERFACE SDL directfb fusion direct X11) endif (LINUX) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 2ac204bfcb..27f273674b 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::nghttp2 INTERFACE IMPORTED ) +use_conan_binary(nghttp2) use_prebuilt_binary(nghttp2) if (WINDOWS) target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 184fbb3c5f..b016c22a4e 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) +use_conan_binary(openjpeg) use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjpeg ) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index dfc6520362..0d3f3ad9b4 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) +use_conan_binary(openssl) use_prebuilt_binary(openssl) if (WINDOWS) target_link_libraries(ll::openssl INTERFACE libssl libcrypto) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 672f963ea1..8e870f631f 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::libpng INTERFACE IMPORTED ) +use_conan_binary(libpng) use_prebuilt_binary(libpng) if (WINDOWS) target_link_libraries(ll::libpng INTERFACE libpng16) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index f0192ec45b..542b4462e4 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -57,3 +57,16 @@ macro (use_prebuilt_binary _binary) endif (NOT ${_binary}_installed EQUAL 0) endmacro (use_prebuilt_binary _binary) +#Sadly we need a macro here, otherwise the return() will not properly work +macro ( use_conan_binary package ) + if( USE_CONAN ) + target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${package} ) + foreach( extra_pkg "${ARGN}" ) + if( extra_pkg ) + target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${extra_pkg} ) + endif() + endforeach() + return() + endif() +endmacro() + diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 6a2e6f22df..066975a3d0 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -2,13 +2,17 @@ include(Prebuilt) include(FreeType) -if (LINUX) - use_prebuilt_binary(gtk-atk-pango-glib) -endif (LINUX) - add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX) + 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() + endif() + use_prebuilt_binary(gtk-atk-pango-glib) + target_link_libraries( ll::uilibraries INTERFACE atk-1.0 gdk-x11-2.0 @@ -67,6 +71,3 @@ target_include_directories( ll::uilibraries SYSTEM INTERFACE # ) #endforeach(include) -if (LINUX) - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) -endif (LINUX) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index cc181f74f8..b1c76c006a 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -1,10 +1,13 @@ # -*- cmake -*- include_guard() -add_library( ll::uriparser INTERFACE IMPORTED ) include(Prebuilt) +add_library( ll::uriparser INTERFACE IMPORTED ) + +use_conan_binary( uriparser ) + use_prebuilt_binary(uriparser) if (WINDOWS) target_link_libraries( ll::uriparser INTERFACE uriparser) diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 7b5c990094..00f8b77106 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -2,10 +2,19 @@ include(Prebuilt) if (LINUX) - use_prebuilt_binary(libuuid) - use_prebuilt_binary(fontconfig) + #use_prebuilt_binary(libuuid) add_library( ll::fontconfig INTERFACE IMPORTED ) + + if( NOT USE_CONAN ) + use_prebuilt_binary(fontconfig) + else() + target_link_libraries( ll::fontconfig INTERFACE CONAN_PKG::fontconfig ) + endif() endif (LINUX) -use_prebuilt_binary(libhunspell) + +if( NOT USE_CONAN ) + use_prebuilt_binary(libhunspell) +endif() + use_prebuilt_binary(slvoice) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 83f06788f2..7cb0efdab7 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,6 +4,8 @@ include(Prebuilt) include_guard() add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) +use_conan_binary( xmlrpc-epi ) + use_prebuilt_binary(xmlrpc-epi) target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index a1a1860bc6..5d99cd9709 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -5,6 +5,11 @@ include(Prebuilt) include_guard() add_library( ll::zlib-ng INTERFACE IMPORTED ) +if(USE_CONAN ) + target_link_libraries( ll::zlib-ng INTERFACE CONAN_PKG::zlib ) + return() +endif() + use_prebuilt_binary(zlib-ng) if (WINDOWS) target_link_libraries( ll::zlib-ng INTERFACE zlib ) -- cgit v1.2.3 From d6b34d41afc1f77a28e60ae1f9e22b61323052fa Mon Sep 17 00:00:00 2001 From: Nicky Date: Tue, 19 Apr 2022 20:28:34 +0200 Subject: Finishing touches, making sure even with conan all needed 3ps are installed and usable. This brings the source to be able to run tests in conan mode. --- indra/cmake/GoogleMock.cmake | 12 +++++++----- indra/cmake/Hunspell.cmake | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 753b972e95..e4520fe96e 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -4,16 +4,18 @@ include(Linking) include_guard() +add_library( ll::googlemock INTERFACE IMPORTED ) if(USE_CONAN) - return() + target_link_libraries( ll::googlemock INTERFACE CONAN_PKG::gtest ) + + #Not very nice, but for the moment we need this for tut.hpp + target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) + return() endif() -add_library( ll::googlemock INTERFACE IMPORTED ) use_prebuilt_binary(googlemock) -target_include_directories( ll::googlemock SYSTEM INTERFACE - ${LIBS_PREBUILT_DIR}/include - ) +target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index c372d83f8d..6e92611cc9 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -2,6 +2,8 @@ include(Prebuilt) include_guard() +use_prebuilt_binary(dictionaries) + add_library( ll::hunspell INTERFACE IMPORTED ) use_conan_binary(hunspell) use_prebuilt_binary(libhunspell) @@ -13,4 +15,3 @@ elseif(LINUX) target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) endif() target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell) -use_prebuilt_binary(dictionaries) -- cgit v1.2.3 From 4c34a0275192cea26d1d63f59639275d1cbeda20 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 23 Apr 2022 18:36:49 +0200 Subject: Setting openal option in cache had gone poof. --- indra/cmake/OPENAL.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 84dad367b7..0b6a7c2853 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -4,6 +4,11 @@ include(Prebuilt) include_guard() +# ND: Turn this off by default, the openal code in the viewer isn't very well maintained, seems +# to have memory leaks, has no option to play music streams +# It probably makes sense to to completely remove it + +set(USE_OPENAL OFF CACHE BOOL "Enable OpenAL") # ND: To streamline arguments passed, switch from OPENAL to USE_OPENAL # To not break all old build scripts convert old arguments but warn about it if(OPENAL) -- cgit v1.2.3 From 283c2a20cc4ef856076d287303c7143332b201fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 00:38:40 +0200 Subject: Remove setting of HEADER_FILE_ONLY on .h* files, cmake automatically sets the property on those. --- indra/cmake/CMakeLists.txt | 3 --- indra/cmake/LLAddBuildTest.cmake | 1 - 2 files changed, 4 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index c8e71b604f..0a084d8a1d 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -75,9 +75,6 @@ set(master_SOURCE_FILES source_group("Master Rules" FILES ${master_SOURCE_FILES}) -set_source_files_properties(${cmake_SOURCE_FILES} ${master_SOURCE_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - add_library(cmake cmake_dummy.cpp ${cmake_SOURCE_FILES} diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index a97d2584ae..d3047ddc82 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -87,7 +87,6 @@ INCLUDE(GoogleMock) # Headers GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES) SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES}) - set_source_files_properties(${${name}_test_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) LIST(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES}) IF(LL_TEST_VERBOSE) MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}") -- cgit v1.2.3 From 756a10eeace5891c17c6894b0df44f2b9b3ea078 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 13:37:44 +0200 Subject: Simplify cmake files by uaing generator expressions and be more configuration specific, rather than staging files to Release and RelWithdebInfo all the time --- indra/cmake/Copy3rdPartyLibs.cmake | 6 +----- indra/cmake/DBusGlib.cmake | 2 +- indra/cmake/Linking.cmake | 24 +----------------------- indra/cmake/Variables.cmake | 2 ++ 4 files changed, 5 insertions(+), 29 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index f6e224665b..829c7a180d 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -16,12 +16,8 @@ include(FMODSTUDIO) # Pass FROM_DIR, TARGETS and the files to copy. TO_DIR is implicit. # to_staging_dirs diverges from copy_if_different in that it appends to TARGETS. MACRO(to_staging_dirs from_dir targets) - foreach(staging_dir - "${SHARED_LIB_STAGING_DIR_RELEASE}" - "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}") - copy_if_different("${from_dir}" "${staging_dir}" out_targets ${ARGN}) + copy_if_different("${from_dir}" "${SHARED_LIB_STAGING_DIR}/$,$,>" out_targets ${ARGN}) list(APPEND "${targets}" "${out_targets}") - endforeach() ENDMACRO(to_staging_dirs from_dir to_dir targets) ################################################################### diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index ce5d10be5c..9151742fe0 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -3,7 +3,7 @@ include(Prebuilt) add_library( ll::dbus INTERFACE IMPORTED) -# Only define this when using conan, lls prebuild is brokenb +# Only define this when using conan, lls prebuild is broken if( USE_CONAN ) target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED ) endif() diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 5a16776e57..ecabd0c374 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -30,30 +30,8 @@ endif (WINDOWS) # windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is # that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and # CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators -if(WINDOWS OR DARWIN) - # the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us - # fortunately both windows and darwin are case insensitive filesystems so this works. - # Ninja on the other hand needs the the full path - if( ${CMAKE_GENERATOR} STREQUAL "Ninja") - string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) - set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}) - else() - set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/") - endif() -else(WINDOWS OR DARWIN) - # else block is for linux and any other makefile based generators - string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) - set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}) -endif(WINDOWS OR DARWIN) - -if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") - # When we're building something other than Release, append the - # packages/lib/release directory to deal with autobuild packages that don't - # provide (e.g.) lib/debug libraries. - list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE}) -endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") -link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS}) +link_directories(${AUTOBUILD_INSTALL_DIR}/lib/$>) add_library( ll::oslibraries INTERFACE IMPORTED ) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 0cc4b85583..e0e1161606 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -217,3 +217,5 @@ set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header dire source_group("CMake Rules" FILES CMakeLists.txt) +get_property(LL_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +MESSAGE( "Multi config generator: ${LL_GENERATOR_IS_MULTI_CONFIG}" ) -- cgit v1.2.3 From db423fa972e70b647b53eeb5f1797e93facda37f Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 13:53:22 +0200 Subject: ${AUTOBUILD_INSTALL_DIR}/lib/release is always needed as a fallback linking directory. --- indra/cmake/Linking.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index ecabd0c374..d0181c5122 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -32,6 +32,7 @@ endif (WINDOWS) # CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators link_directories(${AUTOBUILD_INSTALL_DIR}/lib/$>) +link_directories(${AUTOBUILD_INSTALL_DIR}/lib/release) add_library( ll::oslibraries INTERFACE IMPORTED ) -- cgit v1.2.3 From 767464a2627036e8a16ac323c886e0a1712e0a5f Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 02:19:51 +0200 Subject: Adapt gnerator expression usage to work on OSX. --- indra/cmake/Copy3rdPartyLibs.cmake | 16 +++++----------- indra/cmake/LLAddBuildTest.cmake | 4 ++-- indra/cmake/LLSharedLibs.cmake | 37 ------------------------------------- indra/cmake/Linking.cmake | 19 +++++++------------ 4 files changed, 14 insertions(+), 62 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 829c7a180d..8e4f7bcec9 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -15,19 +15,17 @@ include(FMODSTUDIO) # copy_if_different commands. Encapsulate that usage. # Pass FROM_DIR, TARGETS and the files to copy. TO_DIR is implicit. # to_staging_dirs diverges from copy_if_different in that it appends to TARGETS. -MACRO(to_staging_dirs from_dir targets) - copy_if_different("${from_dir}" "${SHARED_LIB_STAGING_DIR}/$,$,>" out_targets ${ARGN}) +macro(to_staging_dirs from_dir targets) + set( targetDir "${SHARED_LIB_STAGING_DIR}") + copy_if_different("${from_dir}" "${targetDir}" out_targets ${ARGN}) + list(APPEND "${targets}" "${out_targets}") -ENDMACRO(to_staging_dirs from_dir to_dir targets) +endmacro() ################################################################### # set up platform specific lists of files that need to be copied ################################################################### if(WINDOWS) - set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") - set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") - set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") - #******************************* # VIVOX - *NOTE: no debug version set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") @@ -150,10 +148,6 @@ if(WINDOWS) endforeach() elseif(DARWIN) - set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") - set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources") - set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources") - set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(slvoice_files SLVoice) set(vivox_libs diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index d3047ddc82..fa95e08dcd 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -276,12 +276,12 @@ MACRO(SET_TEST_PATH LISTVAR) # We typically build/package only Release variants of third-party # libraries, so append the Release staging dir in case the library being # sought doesn't have a debug variant. - set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release) + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} ${SHARED_LIB_STAGING_DIR}/Release) ELSEIF(DARWIN) # We typically build/package only Release variants of third-party # libraries, so append the Release staging dir in case the library being # sought doesn't have a debug variant. - set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) ELSE(WINDOWS) # Linux uses a single staging directory anyway. set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake index f69b45cd92..e3e2a3b0c6 100644 --- a/indra/cmake/LLSharedLibs.cmake +++ b/indra/cmake/LLSharedLibs.cmake @@ -37,40 +37,3 @@ macro(ll_deploy_sharedlibs_command target_exe) endif(NOT DARWIN) endmacro(ll_deploy_sharedlibs_command) - -# ll_stage_sharedlib -# Performs config and adds a copy command for a sharedlib target. -macro(ll_stage_sharedlib DSO_TARGET) - # target gets written to the DLL staging directory. - # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests. - set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR}) - if(NOT WINDOWS) - get_target_property(DSO_PATH ${DSO_TARGET} LOCATION) - get_filename_component(DSO_FILE ${DSO_PATH} NAME) - if(DARWIN) - set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources) - else(DARWIN) - set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) - endif(DARWIN) - - # *TODO - maybe make this a symbolic link? -brad - add_custom_command( - TARGET ${DSO_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - copy_if_different - ${DSO_PATH} - ${SHARED_LIB_STAGING_DIR_CONFIG}/${DSO_FILE} - COMMENT "Copying llcommon to the staging folder." - ) - endif(NOT WINDOWS) - - if (DARWIN) - set_target_properties(${DSO_TARGET} PROPERTIES - BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path/../Resources" - ) - endif(DARWIN) - -endmacro(ll_stage_sharedlib) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index d0181c5122..29aa6e89ea 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -7,21 +7,16 @@ set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib) set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins) set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release) set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug) -if (WINDOWS) - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) - set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) +if (WINDOWS OR DARWIN ) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) + if( DARWIN ) + set( SHARED_LIB_STAGING_DIR ${SHARED_LIB_STAGING_DIR}/Resources) + endif() + set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) elseif (LINUX) set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib) set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin) -elseif (DARWIN) - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs) - set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs") - if( ${CMAKE_GENERATOR} STREQUAL "Ninja") - set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/${CMAKE_BUILD_TYPE} ") - else() - set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs") - endif() -endif (WINDOWS) +endif () # Autobuild packages must provide 'release' versions of libraries, but may provide versions for # specific build types. AUTOBUILD_LIBS_INSTALL_DIRS lists first the build type directory and then -- cgit v1.2.3 From 09e38c5caac6c8467edbbb8527e04503f1afe5f3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:00:01 +0200 Subject: Remove logging. --- indra/cmake/Variables.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index e0e1161606..cb9d22abd2 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -218,4 +218,4 @@ set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header dire source_group("CMake Rules" FILES CMakeLists.txt) get_property(LL_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -MESSAGE( "Multi config generator: ${LL_GENERATOR_IS_MULTI_CONFIG}" ) + -- cgit v1.2.3 From d6c170a66de1fe6cf6287ca970b79d0ae6e98149 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:00:27 +0200 Subject: Cache ENV{LL_BUILD} to LL_BUILD_ENV: - ENV{LL_BUILD} takes precedence - if ENV{LL_BUILD} is not set but LL_BUILD-ENV is, set ENV{LL_BUILD} to the cached version - error if none of the two is set Caching the variable and reusing it lets cmake run when not called by autobuild itself. This happens when xcode or visual studio detect it needs to be re rerun and call it for the "cmake" target. Not having LL_BUILD then makes those targets fail. --- indra/cmake/Variables.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index cb9d22abd2..3098b9aa59 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -12,8 +12,13 @@ # Switches set here and in 00-Common.cmake must agree with # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables # Reading $LL_BUILD is an attempt to directly use those switches. -if ("$ENV{LL_BUILD}" STREQUAL "") +if ("$ENV{LL_BUILD}" STREQUAL "" AND "${LL_BUILD_ENV}" STREQUAL "" ) message(FATAL_ERROR "Environment variable LL_BUILD must be set") +elseif("$ENV{LL_BUILD}" STREQUAL "") + set( ENV{LL_BUILD} "${LL_BUILD_ENV}" ) + message( "Setting ENV{LL_BUILD} to cached variable ${LL_BUILD_ENV}" ) +else() + set( LL_BUILD_ENV "$ENV{LL_BUILD}" CACHE STRING "Save environment" FORCE ) endif () include_guard() -- cgit v1.2.3 From 07a7c4e1909749ca2f50d155c0de3fdfdbb34952 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:23:20 +0200 Subject: ADDRESS_SIZE auto detection was broken with python3, fix this. - Simplify detection by using regex - OSX is always 64 bit --- indra/cmake/Variables.cmake | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 3098b9aa59..4f40516917 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -79,27 +79,28 @@ elseif (ADDRESS_SIZE EQUAL 64) #message(STATUS "ADDRESS_SIZE is 64") set(ARCH x86_64) else (ADDRESS_SIZE EQUAL 32) - #message(STATUS "ADDRESS_SIZE is UNRECOGNIZED: '${ADDRESS_SIZE}'") - # Use Python's platform.machine() since uname -m isn't available everywhere. - # Even if you can assume cygwin uname -m, the answer depends on whether - # you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will - # report a 64-bit processor. - execute_process(COMMAND - "${PYTHON_EXECUTABLE}" "-c" - "import platform; print platform.machine()" - OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) - # We expect values of the form i386, i686, x86_64, AMD64. - # In CMake, expressing ARCH.endswith('64') is awkward: - string(LENGTH "${ARCH}" ARCH_LENGTH) - math(EXPR ARCH_LEN_2 "${ARCH_LENGTH} - 2") - string(SUBSTRING "${ARCH}" ${ARCH_LEN_2} 2 ARCH_LAST_2) - if (ARCH_LAST_2 STREQUAL 64) - #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}") + # Note we cannnot use if(DARWIN) here, this variable is set way lower + if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) set(ADDRESS_SIZE 64) - else () - #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}") - set(ADDRESS_SIZE 32) - endif () + set(ARCH x86_64) + else() + # Use Python's platform.machine() since uname -m isn't available everywhere. + # Even if you can assume cygwin uname -m, the answer depends on whether + # you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will + # report a 64-bit processor. + execute_process(COMMAND + "${PYTHON_EXECUTABLE}" "-c" + "import platform; print( platform.machine() )" + OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + string( REGEX MATCH ".*(64)$" RE_MATCH "${ARCH}" ) + if( RE_MATCH AND ${CMAKE_MATCH_1} STREQUAL "64" ) + set(ADDRESS_SIZE 64) + set(ARCH x86_64) + else() + set(ADDRESS_SIZE 32) + set(ARCH i686) + endif() + endif() endif (ADDRESS_SIZE EQUAL 32) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") -- cgit v1.2.3 From 42820f834fcd68c40dc71f1be2a2b7d50096f148 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:29:16 +0200 Subject: Remove unused LL_ARCH/LL_ARCH_DIR --- indra/cmake/UI.cmake | 20 -------------------- indra/cmake/Variables.cmake | 12 +----------- 2 files changed, 1 insertion(+), 31 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 066975a3d0..8529576fda 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -51,23 +51,3 @@ target_include_directories( ll::uilibraries SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) - -# The following made no real sense -# - ${ARCH}_linux_INCLUDES was set in 00-Common.cmake, -# - Here ist is used, but as ${${LL_ARCH}_INCLUDES} -# It would make more sense to use one form ($LL_ARCH) -# Leave this out for the moment, but come back when looking at the Linux build - -#set(${ARCH}_linux_INCLUDES -# atk-1.0 -# glib-2.0 -# gstreamer-0.10 -# gtk-2.0 -# pango-1.0 -# ) -#foreach(include ${${LL_ARCH}_INCLUDES}) -# target_include_directories( ll::uilibraries SYSTEM INTERFACE -# ${LIBS_PREBUILT_DIR}/include/${include} -# ) -#endforeach(include) - diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 4f40516917..653db2069a 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -73,13 +73,11 @@ endif (NOT CMAKE_BUILD_TYPE) # If someone has specified an address size, use that to determine the # architecture. Otherwise, let the architecture specify the address size. if (ADDRESS_SIZE EQUAL 32) - #message(STATUS "ADDRESS_SIZE is 32") set(ARCH i686) elseif (ADDRESS_SIZE EQUAL 64) - #message(STATUS "ADDRESS_SIZE is 64") set(ARCH x86_64) else (ADDRESS_SIZE EQUAL 32) - # Note we cannnot use if(DARWIN) here, this variable is set way lower + # Note we cannot use if(DARWIN) here, this variable is set way lower if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) set(ADDRESS_SIZE 64) set(ARCH x86_64) @@ -105,8 +103,6 @@ endif (ADDRESS_SIZE EQUAL 32) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(WINDOWS ON BOOL FORCE) - set(LL_ARCH ${ARCH}_win32) - set(LL_ARCH_DIR ${ARCH}-win32) endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -133,9 +129,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") include(ConfigurePkgConfig) - set(LL_ARCH ${ARCH}_linux) - set(LL_ARCH_DIR ${ARCH}-linux) - if (INSTALL_PROPRIETARY) # Only turn on headless if we can find osmesa libraries. include(FindPkgConfig) @@ -204,9 +197,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_OSX_ARCHITECTURES "${ARCH}") string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") string(REPLACE "AMD64" "x86_64" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") - - set(LL_ARCH ${ARCH}_darwin) - set(LL_ARCH_DIR universal-darwin) endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid -- cgit v1.2.3 From 59f6062685efd4c52f06c526e52a9fa00ddfabeb Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 5 Jun 2022 16:15:00 +0200 Subject: Bring back comments for EXTERNAL_TOS and LL_IGNORE_SIGCHLD --- indra/cmake/00-Common.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 8c6ec9a6cc..279e7ca1b9 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -113,6 +113,14 @@ endif (WINDOWS) if (LINUX) set(CMAKE_SKIP_RPATH TRUE) + # EXTERNAL_TOS + # force this platform to accept TOS via external browser + + # LL_IGNORE_SIGCHLD + # don't catch SIGCHLD in our base application class for the viewer - some of + # our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The + # viewer doesn't need to catch SIGCHLD anyway. + add_compile_definitions( _REENTRANT _FORTIFY_SOURCE=2 -- cgit v1.2.3 From c08a61453b21664da3687661512e2ea208f90d98 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 5 Jun 2022 16:15:55 +0200 Subject: Port new cmake files (Trace/Meshoptimizer) to modern cmake --- indra/cmake/CMakeLists.txt | 1 - indra/cmake/LLMeshOptimizer.cmake | 7 ------- indra/cmake/MESHOPTIMIZER.cmake | 13 +++++++++---- indra/cmake/Tracy.cmake | 25 +++++++------------------ indra/cmake/UI.cmake | 1 + 5 files changed, 17 insertions(+), 30 deletions(-) delete mode 100644 indra/cmake/LLMeshOptimizer.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index e592418a18..ec143d86c9 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -37,7 +37,6 @@ set(cmake_SOURCE_FILES LLCommon.cmake LLImage.cmake LLKDU.cmake - LLMeshOptimizer.cmake LLPhysicsExtensions.cmake LLPrimitive.cmake LLSharedLibs.cmake diff --git a/indra/cmake/LLMeshOptimizer.cmake b/indra/cmake/LLMeshOptimizer.cmake deleted file mode 100644 index b79944f618..0000000000 --- a/indra/cmake/LLMeshOptimizer.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLMESHOPTIMIZER_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llmeshoptimizer - ) - -set(LLMESHOPTIMIZER_LIBRARIES llmeshoptimizer) diff --git a/indra/cmake/MESHOPTIMIZER.cmake b/indra/cmake/MESHOPTIMIZER.cmake index 1c5b47b9bd..0d51f47866 100644 --- a/indra/cmake/MESHOPTIMIZER.cmake +++ b/indra/cmake/MESHOPTIMIZER.cmake @@ -3,14 +3,19 @@ include(Linking) include(Prebuilt) +include_guard() +add_library( ll::meshoptimizer INTERFACE IMPORTED ) + +use_conan_binary(meshoptimizer) use_prebuilt_binary(meshoptimizer) if (WINDOWS) - set(MESHOPTIMIZER_LIBRARIES meshoptimizer.lib) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) + set(MESHOPTIMIZER_LIBRARIES ) elseif (LINUX) - set(MESHOPTIMIZER_LIBRARIES meshoptimizer.o) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.o) elseif (DARWIN) - set(MESHOPTIMIZER_LIBRARIES libmeshoptimizer.a) + target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) endif (WINDOWS) -set(MESHOPTIMIZER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/meshoptimizer) +target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index cfff956bcf..c7563f1b7e 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -1,29 +1,18 @@ # -*- cmake -*- include(Prebuilt) +include_guard() +add_library( ll::tracy INTERFACE IMPORTED ) + set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.") if (USE_TRACY) - set(TRACY_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tracy) - -# See: indra/llcommon/llprofiler.h - add_definitions(-DLL_PROFILER_CONFIGURATION=3) + use_conan_binary(tracy) use_prebuilt_binary(tracy) - if (WINDOWS) - MESSAGE(STATUS "Including Tracy for Windows: '${TRACY_INCLUDE_DIR}'") - endif (WINDOWS) + target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy) - if (DARWIN) - MESSAGE(STATUS "Including Tracy for Darwin: '${TRACY_INCLUDE_DIR}'") - endif (DARWIN) - - if (LINUX) - MESSAGE(STATUS "Including Tracy for Linux: '${TRACY_INCLUDE_DIR}'") - endif (LINUX) -else (USE_TRACY) - # Tracy.cmake should not set LLCOMMON_INCLUDE_DIRS, let LLCommon.cmake do that - set(TRACY_INCLUDE_DIR "") - set(TRACY_LIBRARY "") +# See: indra/llcommon/llprofiler.h + target_compile_definitions(ll::tracy INTERFACE LL_PROFILER_CONFIGURATION=3 ) endif (USE_TRACY) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 8529576fda..c02ad3e161 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -44,6 +44,7 @@ if( WINDOWS ) Vfw32 wer winspool + imm32 ) endif() -- cgit v1.2.3 From 3f31d0b5a70af4ebf746d40d478b4e948e904a87 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Jul 2022 17:51:25 +0200 Subject: Be more explicit: Rename use_conan_binary to use_system_binary, this will allow us to reuse the macro for more than just conan. --- indra/cmake/APR.cmake | 2 +- indra/cmake/Audio.cmake | 2 +- indra/cmake/CURL.cmake | 2 +- indra/cmake/Copy3rdPartyLibs.cmake | 2 +- indra/cmake/DBusGlib.cmake | 6 +++--- indra/cmake/EXPAT.cmake | 2 +- indra/cmake/FreeType.cmake | 2 +- indra/cmake/GLEXT.cmake | 2 +- indra/cmake/GLH.cmake | 2 +- indra/cmake/GStreamer010Plugin.cmake | 2 +- indra/cmake/Hunspell.cmake | 2 +- indra/cmake/JPEG.cmake | 2 +- indra/cmake/JsonCpp.cmake | 2 +- indra/cmake/LLPrimitive.cmake | 2 +- indra/cmake/LLWindow.cmake | 4 ++-- indra/cmake/MESHOPTIMIZER.cmake | 2 +- indra/cmake/NGHTTP2.cmake | 2 +- indra/cmake/OpenJPEG.cmake | 2 +- indra/cmake/OpenSSL.cmake | 2 +- indra/cmake/PNG.cmake | 2 +- indra/cmake/Prebuilt.cmake | 2 +- indra/cmake/Tracy.cmake | 2 +- indra/cmake/URIPARSER.cmake | 2 +- indra/cmake/XmlRpcEpi.cmake | 2 +- 24 files changed, 27 insertions(+), 27 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 898979c47e..8a0939c92c 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -5,7 +5,7 @@ include_guard() add_library( ll::apr INTERFACE IMPORTED ) -use_conan_binary( apr apr-util ) +use_system_binary( apr apr-util ) use_prebuilt_binary(apr_suite) if (WINDOWS) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 4b06de0a08..38547bb017 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::vorbis INTERFACE IMPORTED ) -use_conan_binary(vorbis) +use_system_binary(vorbis) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index 7c93819e75..b9f685f37b 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::libcurl INTERFACE IMPORTED ) -use_conan_binary(libcurl) +use_system_binary(libcurl) use_prebuilt_binary(curl) if (WINDOWS) target_link_libraries(ll::libcurl INTERFACE libcurl.lib) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c894b40a53..e43d4757bb 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -210,7 +210,7 @@ elseif(LINUX) ${EXPAT_COPY} ) - if( NOT USE_CONAN ) + if( USE_AUTOBUILD_3P ) list( APPEND release_files libapr-1.so.0 libaprutil-1.so.0 diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 9151742fe0..f75018ad0e 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -3,11 +3,11 @@ include(Prebuilt) add_library( ll::dbus INTERFACE IMPORTED) -# Only define this when using conan, lls prebuild is broken -if( USE_CONAN ) +# Only define this when not using the prebuild 3ps, lls prebuild is broken +if( NOT USE_AUTOBUILD_3P ) target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED ) endif() -use_conan_binary(dbus) +use_system_binary(dbus) use_prebuilt_binary(dbus_glib) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index e5c9dd5582..327fe8aa72 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::expat INTERFACE IMPORTED ) -use_conan_binary(expat) +use_system_binary(expat) use_prebuilt_binary(expat) if (WINDOWS) target_link_libraries( ll::expat INTERFACE libexpatMT ) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 92130402f9..77140af641 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) -use_conan_binary(freetype) +use_system_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) target_link_libraries( ll::freetype INTERFACE freetype ) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 70477cf0af..434b6f0ee8 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -4,7 +4,7 @@ include(GLH) add_library( ll::glext INTERFACE IMPORTED ) if (WINDOWS OR LINUX) - use_conan_binary(glext) + use_system_binary(glext) use_prebuilt_binary(glext) endif (WINDOWS OR LINUX) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index 18521b5069..0cefc3543a 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -3,5 +3,5 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) -use_conan_binary( glh_linear ) +use_system_binary( glh_linear ) use_prebuilt_binary(glh_linear) diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake index 0b6a7a21c3..61f6f74033 100644 --- a/indra/cmake/GStreamer010Plugin.cmake +++ b/indra/cmake/GStreamer010Plugin.cmake @@ -6,7 +6,7 @@ endif() add_library( ll::gstreamer INTERFACE IMPORTED ) target_compile_definitions( ll::gstreamer INTERFACE LL_GSTREAMER010_ENABLED=1) -use_conan_binary(gstreamer) +use_system_binary(gstreamer) use_prebuilt_binary(gstreamer) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 6e92611cc9..bb037c0237 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -5,7 +5,7 @@ include_guard() use_prebuilt_binary(dictionaries) add_library( ll::hunspell INTERFACE IMPORTED ) -use_conan_binary(hunspell) +use_system_binary(hunspell) use_prebuilt_binary(libhunspell) if (WINDOWS) target_link_libraries( ll::hunspell INTERFACE libhunspell) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index 900fc77c40..252d7852d4 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -6,7 +6,7 @@ include(Linking) include_guard() add_library( ll::libjpeg INTERFACE IMPORTED ) -use_conan_binary(libjpeg) +use_system_binary(libjpeg) use_prebuilt_binary(jpeglib) if (LINUX) target_link_libraries( ll::libjpeg INTERFACE jpeg) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index f62b2bdd7a..17f8e47a97 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::jsoncpp INTERFACE IMPORTED ) -use_conan_binary(jsoncpp) +use_system_binary(jsoncpp) use_prebuilt_binary(jsoncpp) if (WINDOWS) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 3e5ff4963b..04afe5e405 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -18,7 +18,7 @@ if( USE_CONAN ) "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" ) endif() -use_conan_binary( colladadom ) +use_system_binary( colladadom ) use_prebuilt_binary(colladadom) use_prebuilt_binary(minizip-ng) # needed for colladadom diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 0136d56723..b36e970560 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,10 +9,10 @@ add_library( ll::SDL INTERFACE IMPORTED ) if (LINUX) - #Must come first as use_conan_binary can exit this file early + #Must come first as use_system_binary can exit this file early target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) - use_conan_binary(SDL) + use_system_binary(SDL) use_prebuilt_binary(SDL) target_include_directories( ll::SDL SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/MESHOPTIMIZER.cmake b/indra/cmake/MESHOPTIMIZER.cmake index 0d51f47866..d1d4df067f 100644 --- a/indra/cmake/MESHOPTIMIZER.cmake +++ b/indra/cmake/MESHOPTIMIZER.cmake @@ -6,7 +6,7 @@ include(Prebuilt) include_guard() add_library( ll::meshoptimizer INTERFACE IMPORTED ) -use_conan_binary(meshoptimizer) +use_system_binary(meshoptimizer) use_prebuilt_binary(meshoptimizer) if (WINDOWS) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 27f273674b..6396a5bd01 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::nghttp2 INTERFACE IMPORTED ) -use_conan_binary(nghttp2) +use_system_binary(nghttp2) use_prebuilt_binary(nghttp2) if (WINDOWS) target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index b016c22a4e..f0311439bf 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) -use_conan_binary(openjpeg) +use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjpeg ) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 0d3f3ad9b4..3387c74f45 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) -use_conan_binary(openssl) +use_system_binary(openssl) use_prebuilt_binary(openssl) if (WINDOWS) target_link_libraries(ll::openssl INTERFACE libssl libcrypto) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 8e870f631f..044262bc8d 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::libpng INTERFACE IMPORTED ) -use_conan_binary(libpng) +use_system_binary(libpng) use_prebuilt_binary(libpng) if (WINDOWS) target_link_libraries(ll::libpng INTERFACE libpng16) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 542b4462e4..f0239711aa 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -58,7 +58,7 @@ macro (use_prebuilt_binary _binary) endmacro (use_prebuilt_binary _binary) #Sadly we need a macro here, otherwise the return() will not properly work -macro ( use_conan_binary package ) +macro ( use_system_binary package ) if( USE_CONAN ) target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${package} ) foreach( extra_pkg "${ARGN}" ) diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index c7563f1b7e..b3de06a876 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -7,7 +7,7 @@ add_library( ll::tracy INTERFACE IMPORTED ) set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.") if (USE_TRACY) - use_conan_binary(tracy) + use_system_binary(tracy) use_prebuilt_binary(tracy) target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index b1c76c006a..6c33ff70e1 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -6,7 +6,7 @@ include(Prebuilt) add_library( ll::uriparser INTERFACE IMPORTED ) -use_conan_binary( uriparser ) +use_system_binary( uriparser ) use_prebuilt_binary(uriparser) if (WINDOWS) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 7cb0efdab7..6409f9d6e2 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) -use_conan_binary( xmlrpc-epi ) +use_system_binary( xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) -- cgit v1.2.3 From 15d37713b9113a6f70dde48c764df02c76e18cbc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 22 Aug 2022 21:00:42 -0400 Subject: DRTVWR-558: Fix builds on macOS 12.5 Monterey. Always search for python3[.exe] instead of plain 'python'. macOS Monterey no longer bundles Python 2 at all. Explicitly make PYTHON_EXECUTABLE a cached value so if the user edits it in CMakeCache.txt, it won't be overwritten by indra/cmake/Python.cmake. Do NOT set DYLD_LIBRARY_PATH for test executables! That has Bad Effects, as discussed in https://stackoverflow.com/q/73418423/5533635. Instead, create symlinks from build-mumble/sharedlibs/Resources -> Release/Resources and from build-mumble/test/Resources -> ../sharedlibs/Release/Resources. For test executables in sharedlibs/RelWithDebInfo and test/RelWithDebInfo, this supports our dylibs' baked-in load path @executable_path/../Resources. That load path assumes running in a standard app bundle (which the viewer in fact does), but we've been avoiding creating an app bundle for every test program. These symlinks allow us to continue doing that while avoiding DYLD_LIBRARY_PATH. Add indra/llcommon/apply.h. The LL::apply() function and its wrapper macro VAPPLY were very useful in diagnosing the problem. Tweak llleap_test.cpp. This source was modified extensively for diagnostic purposes; these are the small improvements that remain. --- indra/cmake/Copy3rdPartyLibs.cmake | 5 +++++ indra/cmake/Python.cmake | 17 +++++++++-------- indra/cmake/run_build_test.py | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index ff705101de..c2e1bb4b85 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -151,6 +151,11 @@ elseif(DARWIN) set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources") set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources") + # Support our "@executable_path/../Resources" load path for executables + # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE + # directories. + file(CREATE_LINK "Release/Resources" "${SHARED_LIB_STAGING_DIR}/Resources" + SYMBOLIC) set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(slvoice_files SLVoice) diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index ed595f6966..5be3cbdf11 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -5,8 +5,8 @@ set(PYTHONINTERP_FOUND) if (WINDOWS) # On Windows, explicitly avoid Cygwin Python. - find_program(PYTHON_EXECUTABLE - NAMES python.exe + find_program(python + NAMES python3.exe python.exe NO_DEFAULT_PATH # added so that cmake does not find cygwin python PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath] @@ -18,19 +18,20 @@ if (WINDOWS) [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] ) include(FindPythonInterp) else() - find_program(PYTHON_EXECUTABLE python3) + find_program(python python3) - if (PYTHON_EXECUTABLE) + if (python) set(PYTHONINTERP_FOUND ON) - endif (PYTHON_EXECUTABLE) + endif (python) endif (WINDOWS) -if (NOT PYTHON_EXECUTABLE) +if (NOT python) message(FATAL_ERROR "No Python interpreter found") -endif (NOT PYTHON_EXECUTABLE) +endif (NOT python) +set(PYTHON_EXECUTABLE "${python}" CACHE FILEPATH "Python interpreter for builds") mark_as_advanced(PYTHON_EXECUTABLE) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index 1e92868ae7..1f040bded5 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -73,7 +73,7 @@ def main(command, arguments=[], libpath=[], vars={}): if sys.platform == "win32": lpvars = ["PATH"] elif sys.platform == "darwin": - lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"] + lpvars = ["LD_LIBRARY_PATH"] # , "DYLD_LIBRARY_PATH"] elif sys.platform.startswith("linux"): lpvars = ["LD_LIBRARY_PATH"] else: -- cgit v1.2.3 From 94c571887b853781efdb19f951c85ab7350f71a2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 23 Aug 2022 17:21:31 -0400 Subject: DRTVWR-558: Streamline and generalize Windows Python search. --- indra/cmake/Python.cmake | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 5be3cbdf11..dbf5033ce5 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -5,20 +5,36 @@ set(PYTHONINTERP_FOUND) if (WINDOWS) # On Windows, explicitly avoid Cygwin Python. + # if the user has their own version of Python installed, prefer that + foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + # prefer more recent Python versions to older ones, if multiple versions + # are installed + foreach(pyver 3.11 3.10 3.9 3.8 3.7) + list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]") + endforeach() + endforeach() + + # TODO: This logic has the disadvantage that if you have multiple versions + # of Python installed, the selected path won't necessarily be the newest - + # e.g. this GLOB will prefer Python310 to Python311. But since pymaybe is + # checked AFTER the registry entries, this will only surface as a problem if + # no installed Python appears in the registry. + file(GLOB pymaybe + "$ENV{PROGRAMFILES}/Python*" +## "$ENV{PROGRAMFILES(X86)}/Python*" + # The Windows environment variable is in fact as shown above, but CMake + # disallows querying an environment variable containing parentheses - + # thanks, Windows. Fudge by just appending " (x86)" to $PROGRAMFILES and + # hoping for the best. + "$ENV{PROGRAMFILES} (x86)/Python*" + "c:/Python*") + find_program(python NAMES python3.exe python.exe NO_DEFAULT_PATH # added so that cmake does not find cygwin python PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] + ${regpaths} + ${pymaybe} ) include(FindPythonInterp) else() -- cgit v1.2.3 From 592abc460c96b63b1b1e0d15914f7b64a0c88038 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 26 Aug 2022 22:49:16 -0400 Subject: DRTVWR-568: More cleanup of deleted obsolete std library features. --- indra/cmake/00-Common.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 572422d080..16367f1d91 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -46,6 +46,13 @@ endif() set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING "Supported build types." FORCE) +# The viewer code base can now be successfully compiled with -std=c++14. But +# turning that on in the generic viewer-build-variables/variables file would +# potentially require tweaking each of our ~50 third-party library builds. +# Until we decide to set -std=c++14 in viewer-build-variables/variables, set +# it locally here: we want to at least prevent inadvertently reintroducing +# viewer code that would fail with C++14. +set(CMAKE_CXX_STANDARD 17) # Platform-specific compilation flags. @@ -173,13 +180,7 @@ if (DARWIN) # see Variables.cmake. string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - # The viewer code base can now be successfully compiled with -std=c++14. But - # turning that on in the generic viewer-build-variables/variables file would - # potentially require tweaking each of our ~50 third-party library builds. - # Until we decide to set -std=c++14 in viewer-build-variables/variables, set - # it locally here: we want to at least prevent inadvertently reintroducing - # viewer code that would fail with C++14. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -std=c++14") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # NOTE: it's critical that the optimization flag is put in front. # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. -- cgit v1.2.3 From ef58b9751a514e5e63cd77f9f78e6513bc6403cd Mon Sep 17 00:00:00 2001 From: Callum Linden Date: Tue, 30 Aug 2022 15:20:04 -0700 Subject: DRTVWR-568: Pull in new 3p-colladadom build, tweak to VSVER number hardcoded into autobuild.xml for VS 2022 and update cmake script to copy the MSVC runtime (proper fix coming --- indra/cmake/Copy3rdPartyLibs.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c2e1bb4b85..fbec709f0c 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -105,6 +105,8 @@ if(WINDOWS) set(MSVC_VER 140) elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019 set(MSVC_VER 140) + elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1940) # Visual Studio 2022 + set(MSVC_VER 140) else (MSVC80) MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") endif (MSVC80) -- cgit v1.2.3 From 675cfedb8af74c14ce30759f1d6193f954b88f7b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 1 Sep 2022 12:27:08 -0400 Subject: DRTVWR-568: Ensure parent directory exists before CREATE_LINK. --- indra/cmake/Copy3rdPartyLibs.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c2e1bb4b85..edf02bec2b 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -154,6 +154,7 @@ elseif(DARWIN) # Support our "@executable_path/../Resources" load path for executables # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE # directories. + file(MAKE_DIRECTORY "${SHARED_LIB_STAGING_DIR}") file(CREATE_LINK "Release/Resources" "${SHARED_LIB_STAGING_DIR}/Resources" SYMBOLIC) -- cgit v1.2.3 From 554717044f52fa39e9d42f2c5ea032efb479b280 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Fri, 16 Sep 2022 23:24:39 +0200 Subject: Rename MESHOPTIMIZER.cmake to Meshoptimizer.cmake as those caps honestly bug me. --- indra/cmake/CMakeLists.txt | 2 +- indra/cmake/MESHOPTIMIZER.cmake | 21 --------------------- indra/cmake/Meshoptimizer.cmake | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 indra/cmake/MESHOPTIMIZER.cmake create mode 100644 indra/cmake/Meshoptimizer.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index ec143d86c9..f0b35c08f3 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -43,7 +43,7 @@ set(cmake_SOURCE_FILES LLTestCommand.cmake LLWindow.cmake Linking.cmake - MESHOPTIMIZER.cmake + Meshoptimizer.cmake NDOF.cmake OPENAL.cmake OpenGL.cmake diff --git a/indra/cmake/MESHOPTIMIZER.cmake b/indra/cmake/MESHOPTIMIZER.cmake deleted file mode 100644 index d1d4df067f..0000000000 --- a/indra/cmake/MESHOPTIMIZER.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# -*- cmake -*- - -include(Linking) -include(Prebuilt) - -include_guard() -add_library( ll::meshoptimizer INTERFACE IMPORTED ) - -use_system_binary(meshoptimizer) -use_prebuilt_binary(meshoptimizer) - -if (WINDOWS) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) - set(MESHOPTIMIZER_LIBRARIES ) -elseif (LINUX) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.o) -elseif (DARWIN) - target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) -endif (WINDOWS) - -target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake new file mode 100644 index 0000000000..fd144d2b97 --- /dev/null +++ b/indra/cmake/Meshoptimizer.cmake @@ -0,0 +1,20 @@ +# -*- cmake -*- + +include(Linking) +include(Prebuilt) + +include_guard() +add_library( ll::meshoptimizer INTERFACE IMPORTED ) + +use_system_binary(meshoptimizer) +use_prebuilt_binary(meshoptimizer) + +if (WINDOWS) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) +elseif (LINUX) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.o) +elseif (DARWIN) + target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) +endif (WINDOWS) + +target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) -- cgit v1.2.3 From 68c680599b3ee038a33bcad36ac52912725cf3cd Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 11:21:06 +0200 Subject: Try to make sure this also works with the havok version of llphysicsextension. --- indra/cmake/LLPhysicsExtensions.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 9c628b84b1..36821447c9 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -11,7 +11,7 @@ if (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) include_guard() -add_library( llphysicsextensions INTERFACE IMPORTED ) +add_library( llphysicsextensions_impl INTERFACE IMPORTED ) # Note that the use_prebuilt_binary macros below do not in fact include binaries; @@ -22,14 +22,14 @@ if (HAVOK) include(Havok) use_prebuilt_binary(llphysicsextensions_source) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src) - target_link_libraries( llphysicsextensions INTERFACE llphysicsextensions) + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) - target_link_libraries( llphysicsextensions INTERFACE llphysicsextensions_tpv) + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) else (HAVOK) use_prebuilt_binary(llphysicsextensions_stub) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) - target_link_libraries( llphysicsextensions INTERFACE llphysicsextensionsstub) + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) endif (HAVOK) -target_include_directories( llphysicsextensions INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) +target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) -- cgit v1.2.3 From 7a71cea15bcef59c7085657fba9ae6bdb058cc5b Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 17 Sep 2022 12:02:25 +0200 Subject: Workaround to keep old cmake versions limping around. --- indra/cmake/Linking.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 29aa6e89ea..5edb713cfa 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -8,7 +8,15 @@ set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins) set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release) set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug) if (WINDOWS OR DARWIN ) - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) + # Kludge for older cmake versions, 3.20+ is needed to use a genex in add_custom_command( OUTPUT ... ) + # Using this will work okay-ish, as Debug is not supported anyway. But for property multi config and also + # ninja support the genex version is preferred. + if(${CMAKE_VERSION} VERSION_LESS "3.20.0") + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/Release) + else() + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) + endif() + if( DARWIN ) set( SHARED_LIB_STAGING_DIR ${SHARED_LIB_STAGING_DIR}/Resources) endif() -- cgit v1.2.3 From 8c1427c39f90a322d4069162636e4ee433b664fb Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 12:57:49 +0200 Subject: Only set include property on ll::bugpsplat target when on Windows. The include was preveiously declared for all platforms, but the Mac package does not even ship this include directory. With the new way cmake works this will lead to an error (which is good, so we don't end with bogus include dirs). --- indra/cmake/bugsplat.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index f645d9d449..509981d72c 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -19,6 +19,7 @@ if (USE_BUGSPLAT) target_link_libraries( ll::bugsplat INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/bugsplat.lib ) + target_include_directories( ll::bugsplat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/bugsplat) elseif (DARWIN) find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") @@ -33,7 +34,6 @@ if (USE_BUGSPLAT) message( FATAL_ERROR "You need to set BUGSPLAT_DB when setting USE_BUGSPLAT" ) endif() - target_include_directories( ll::bugsplat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/bugsplat) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) else() set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") -- cgit v1.2.3 From 8e0b039e554e320cedfdef3057a3073a493db2e7 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 17:14:16 +0200 Subject: Cleanup sweep --- indra/cmake/LLAddBuildTest.cmake | 283 ++++++++++++++++++++------------------- indra/cmake/LLMath.cmake | 5 - 2 files changed, 143 insertions(+), 145 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index fa95e08dcd..408280f0cc 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -19,89 +19,88 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # # More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code # - # WARNING: do NOT modify this code without working with poppy - + # WARNING: do NOT modify this code without working with poppy - (2022-09-17: ND, I did not talk to poppy, are we all doomed now?) # there is another branch that will conflict heavily with any changes here. -INCLUDE(GoogleMock) - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}") - ENDIF(LL_TEST_VERBOSE) + # This here looks weird, but is needed. It will inject GoogleMock into projects that forgot to include `this` (LLAddBuildTest.cmake) + # But through some other means have access to this macro + include(GoogleMock) + + if(LL_TEST_VERBOSE) + message("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}") + endif() # Start with the header and project-wide setup before making targets #project(UNITTEST_PROJECT_${project}) # Setup includes, paths, etc - SET(alltest_SOURCE_FILES - ${CMAKE_SOURCE_DIR}/test/test.cpp - ${CMAKE_SOURCE_DIR}/test/lltut.cpp - ) - SET(alltest_DEP_TARGETS - # needed by the test harness itself - llcommon - ) - - SET(alltest_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/test + set(alltest_SOURCE_FILES + ${CMAKE_SOURCE_DIR}/test/test.cpp + ${CMAKE_SOURCE_DIR}/test/lltut.cpp ) - SET(alltest_LIBRARIES + set(alltest_DEP_TARGETS + # needed by the test harness itself + llcommon + ) + + set(alltest_LIBRARIES llcommon ll::googlemock ) - IF(NOT "${project}" STREQUAL "llmath") + if(NOT "${project}" STREQUAL "llmath") # add llmath as a dep unless the tested module *is* llmath! - LIST(APPEND alltest_DEP_TARGETS - llmath - ) - LIST(APPEND alltest_LIBRARIES - llmath - ) - ENDIF(NOT "${project}" STREQUAL "llmath") + list(APPEND alltest_DEP_TARGETS llmath) + list(APPEND alltest_LIBRARIES llmath ) + endif() # Headers, for convenience in targets. - SET(alltest_HEADER_FILES - ${CMAKE_SOURCE_DIR}/test/test.h - ) + set(alltest_HEADER_FILES ${CMAKE_SOURCE_DIR}/test/test.h) # start the source test executable definitions - SET(${project}_TEST_OUTPUT "") - FOREACH (source ${sources}) - STRING( REGEX REPLACE "(.*)\\.[^.]+$" "\\1" name ${source} ) - STRING( REGEX REPLACE ".*\\.([^.]+)$" "\\1" extension ${source} ) - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} individual source: ${source} (${name}.${extension})") - ENDIF(LL_TEST_VERBOSE) + set(${project}_TEST_OUTPUT "") + foreach (source ${sources}) + string( REGEX REPLACE "(.*)\\.[^.]+$" "\\1" name ${source} ) + string( REGEX REPLACE ".*\\.([^.]+)$" "\\1" extension ${source} ) + if(LL_TEST_VERBOSE) + message("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} individual source: ${source} (${name}.${extension})") + endif() # # Per-codefile additional / external source, header, and include dir property extraction # # Source GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_SOURCE_FILES ${source} LL_TEST_ADDITIONAL_SOURCE_FILES) - SET(${name}_test_SOURCE_FILES - ${source} - tests/${name}_test.${extension} - ${alltest_SOURCE_FILES} - ${${name}_test_additional_SOURCE_FILES} ) - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}") - ENDIF(LL_TEST_VERBOSE) + set(${name}_test_SOURCE_FILES + ${source} + tests/${name}_test.${extension} + ${alltest_SOURCE_FILES} + ${${name}_test_additional_SOURCE_FILES} ) + if(LL_TEST_VERBOSE) + message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}") + endif() # Headers GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES) - SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES}) - LIST(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES}) - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}") - ENDIF(LL_TEST_VERBOSE) - # Include dirs + set(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES}) + list(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES}) + if(LL_TEST_VERBOSE) + message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}") + endif() + + # Setup target + add_executable(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES}) + + # Cannot declare a dependency on ${project} because the executable create above will later declare + # add_dependencies( ${project} ${project}_tests) + # as such grab ${project}'s interface include dirs and inject them here + get_property( ${name}_test_additional_INCLUDE_DIRS TARGET ${project} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ) + target_include_directories (PROJECT_${project}_TEST_${name} PRIVATE ${${name}_test_additional_INCLUDE_DIRS} ) + GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_INCLUDE_DIRS ${source} LL_TEST_ADDITIONAL_INCLUDE_DIRS) - INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${${name}_test_additional_INCLUDE_DIRS} ) - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}") - ENDIF(LL_TEST_VERBOSE) + target_include_directories (PROJECT_${project}_TEST_${name} PRIVATE ${${name}_test_additional_INCLUDE_DIRS} ) + target_include_directories (PROJECT_${project}_TEST_${name} PRIVATE ${LIBS_OPEN_DIR}/test ) - # Setup target - ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES}) - SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") + set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") # # Per-codefile additional / external project dep and lib dep property extraction @@ -111,92 +110,95 @@ INCLUDE(GoogleMock) GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_PROJECTS ${source} LL_TEST_ADDITIONAL_PROJECTS) # Libraries GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_LIBRARIES ${source} LL_TEST_ADDITIONAL_LIBRARIES) - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_PROJECTS ${${name}_test_additional_PROJECTS}") - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}") - ENDIF(LL_TEST_VERBOSE) + + if(LL_TEST_VERBOSE) + message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_PROJECTS ${${name}_test_additional_PROJECTS}") + message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}") + endif() + # Add to project - TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} ) + target_link_libraries(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} ) add_dependencies( PROJECT_${project}_TEST_${name} ${alltest_DEP_TARGETS}) # Compile-time Definitions GET_OPT_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS) - SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} - PROPERTIES - COMPILE_FLAGS "${${name}_test_additional_CFLAGS}" - COMPILE_DEFINITIONS "LL_TEST=${name};LL_TEST_${name}") - IF(LL_TEST_VERBOSE) - MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}") - ENDIF(LL_TEST_VERBOSE) - + set_target_properties(PROJECT_${project}_TEST_${name} + PROPERTIES + COMPILE_FLAGS "${${name}_test_additional_CFLAGS}" + COMPILE_DEFINITIONS "LL_TEST=${name};LL_TEST_${name}") + if(LL_TEST_VERBOSE) + message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}") + endif() + # # Setup test targets # - SET(TEST_EXE $) - SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt) - SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) + set(TEST_EXE $) + set(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt) + set(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19 - IF(LL_TEST_VERBOSE) - MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}") - ENDIF(LL_TEST_VERBOSE) + if(LL_TEST_VERBOSE) + message(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}") + endif() SET_TEST_PATH(LD_LIBRARY_PATH) LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD}) - IF(LL_TEST_VERBOSE) - MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}") - ENDIF(LL_TEST_VERBOSE) - # Add test - ADD_CUSTOM_COMMAND( - OUTPUT ${TEST_OUTPUT} - COMMAND ${TEST_SCRIPT_CMD} - DEPENDS PROJECT_${project}_TEST_${name} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) + if(LL_TEST_VERBOSE) + message(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}") + endif() + + # Add test + add_custom_command( + OUTPUT ${TEST_OUTPUT} + COMMAND ${TEST_SCRIPT_CMD} + DEPENDS PROJECT_${project}_TEST_${name} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) # Why not add custom target and add POST_BUILD command? # Slightly less uncertain behavior # (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19 - # > I did not use a post build step as I could not make it notify of a + # > I did not use a post build step as I could not make it notify of a # > failure after the first time you build and fail a test. - daveh 2009-04-20 - LIST(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT}) - ENDFOREACH (source) + list(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT}) + endforeach (source) # Add the test runner target per-project # (replaces old _test_ok targets all over the place) - ADD_CUSTOM_TARGET(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT}) - ADD_DEPENDENCIES(${project} ${project}_tests) + add_custom_target(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT}) + add_dependencies(${project} ${project}_tests) ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS) #***************************************************************************** # GET_OPT_SOURCE_FILE_PROPERTY #***************************************************************************** MACRO(GET_OPT_SOURCE_FILE_PROPERTY var filename property) - GET_SOURCE_FILE_PROPERTY(${var} "${filename}" "${property}") - IF("${${var}}" MATCHES NOTFOUND) - SET(${var} "") - ENDIF("${${var}}" MATCHES NOTFOUND) + get_source_file_property(${var} "${filename}" "${property}") + if("${${var}}" MATCHES NOTFOUND) + set(${var} "") + endif() ENDMACRO(GET_OPT_SOURCE_FILE_PROPERTY) #***************************************************************************** # LL_ADD_INTEGRATION_TEST #***************************************************************************** -FUNCTION(LL_ADD_INTEGRATION_TEST - testname - additional_source_files - library_dependencies -# variable args - ) +FUNCTION(LL_ADD_INTEGRATION_TEST + testname + additional_source_files + library_dependencies + # variable args + ) if(TEST_DEBUG) message(STATUS "Adding INTEGRATION_TEST_${testname} - debug output is on") - endif(TEST_DEBUG) + endif() - SET(source_files - tests/${testname}_test.cpp - ${CMAKE_SOURCE_DIR}/test/test.cpp - ${CMAKE_SOURCE_DIR}/test/lltut.cpp - ${additional_source_files} - ) + set(source_files + tests/${testname}_test.cpp + ${CMAKE_SOURCE_DIR}/test/test.cpp + ${CMAKE_SOURCE_DIR}/test/lltut.cpp + ${additional_source_files} + ) - SET(libraries + set(libraries ${library_dependencies} ll::googlemock ) @@ -204,36 +206,37 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # Add test executable build target if(TEST_DEBUG) message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})") - endif(TEST_DEBUG) - ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files}) - SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" - COMPILE_DEFINITIONS "LL_TEST=${testname};LL_TEST_${testname}" - ) + endif() + + add_executable(INTEGRATION_TEST_${testname} ${source_files}) + set_target_properties(INTEGRATION_TEST_${testname} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" + COMPILE_DEFINITIONS "LL_TEST=${testname};LL_TEST_${testname}" + ) - # The following was copied to llcorehttp/CMakeLists.txt's texture_load target. + # The following was copied to llcorehttp/CMakeLists.txt's texture_load target. # Any changes made here should be replicated there. if (WINDOWS) - SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} - PROPERTIES - LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE" - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" - LINK_FLAGS_RELEASE "" - ) - endif (WINDOWS) + set_target_properties(INTEGRATION_TEST_${testname} + PROPERTIES + LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE" + ) + endif () # Add link deps to the executable if(TEST_DEBUG) message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})") - endif(TEST_DEBUG) - TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries}) + endif() + + target_link_libraries(INTEGRATION_TEST_${testname} ${libraries}) + target_include_directories (INTEGRATION_TEST_${testname} PRIVATE ${LIBS_OPEN_DIR}/test ) # Create the test running command - SET(test_command ${ARGN}) - SET(TEST_EXE $) - LIST(FIND test_command "{}" test_exe_pos) - IF(test_exe_pos LESS 0) + set(test_command ${ARGN}) + set(TEST_EXE $) + list(FIND test_command "{}" test_exe_pos) + if(test_exe_pos LESS 0) # The {} marker means "the full pathname of the test executable." # test_exe_pos -1 means we didn't find it -- so append the test executable # name to $ARGN, the variable part of the arg list. This is convenient @@ -242,26 +245,26 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # pathname of the test program as the last of its args. You need specify # {} only if the test program's pathname isn't the last argument in the # desired command line. - LIST(APPEND test_command "${TEST_EXE}") - ELSE (test_exe_pos LESS 0) + list(APPEND test_command "${TEST_EXE}") + else (test_exe_pos LESS 0) # Found {} marker at test_exe_pos. Remove the {}... - LIST(REMOVE_AT test_command test_exe_pos) + list(REMOVE_AT test_command test_exe_pos) # ...and replace it with the actual name of the test executable. - LIST(INSERT test_command test_exe_pos "${TEST_EXE}") - ENDIF (test_exe_pos LESS 0) + list(INSERT test_command test_exe_pos "${TEST_EXE}") + endif() SET_TEST_PATH(LD_LIBRARY_PATH) LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command}) if(TEST_DEBUG) message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") - endif(TEST_DEBUG) + endif() - ADD_CUSTOM_COMMAND( - TARGET INTEGRATION_TEST_${testname} - POST_BUILD - COMMAND ${TEST_SCRIPT_CMD} - ) + add_custom_command( + TARGET INTEGRATION_TEST_${testname} + POST_BUILD + COMMAND ${TEST_SCRIPT_CMD} + ) # Use CTEST? Not sure how to yet... # ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD}) diff --git a/indra/cmake/LLMath.cmake b/indra/cmake/LLMath.cmake index 893920ae6f..a707c75bc4 100644 --- a/indra/cmake/LLMath.cmake +++ b/indra/cmake/LLMath.cmake @@ -1,7 +1,2 @@ # -*- cmake -*- -set(LLMATH_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llmath - ) - -set(LLMATH_LIBRARIES llmath) -- cgit v1.2.3 From e840b5eb40edbac8e72054256112deeaf5c580c2 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 17:37:45 +0200 Subject: MacOs packaging is weird, as Nat already did point out :( Part of his change was omly taking Release builds into account, the other part from me made the same mistake. Use a generator expression with a custom command to get the symlink the way we want. --- indra/cmake/Copy3rdPartyLibs.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index b265c92e45..5bb988d639 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -152,15 +152,6 @@ if(WINDOWS) endforeach() elseif(DARWIN) - # Support our "@executable_path/../Resources" load path for executables - # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE - # directories. - # Cannot use ${SHARED_LIB_STAGING_DIR} here as it used a generator expression and tha this not - # supported by file(...) - file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/sharedlibs/Release/Resources") - file(CREATE_LINK "${CMAKE_BINARY_DIR}/sharedlibs/Release/Resources" "${CMAKE_BINARY_DIR}/sharedlibs/Resources" - SYMBOLIC) - set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(slvoice_files SLVoice) set(vivox_libs @@ -299,3 +290,12 @@ add_custom_target( stage_third_party_libs ALL DEPENDS ${third_party_targets} ) + +if(DARWIN) + # Support our "@executable_path/../Resources" load path for executables + # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE + # directories. + add_custom_command( TARGET stage_third_party_libs POST_BUILD + COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/sharedlibs/Resources + ) +endif() \ No newline at end of file -- cgit v1.2.3 From c7366f4c55c6442414eb6c5a6736baf90f1a4700 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 17 Sep 2022 02:09:04 +0300 Subject: SL-17238 Fix coding policy build issues --- indra/cmake/Copy3rdPartyLibs.cmake | 13 ++++++------- indra/cmake/LLCommon.cmake | 2 +- indra/cmake/LLCoreHttp.cmake | 2 +- indra/cmake/LLPrimitive.cmake | 4 ++-- indra/cmake/Prebuilt.cmake | 14 +++++++------- indra/cmake/UI.cmake | 4 ++-- 6 files changed, 19 insertions(+), 20 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 5bb988d639..7495de00d5 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -216,7 +216,7 @@ elseif(LINUX) list( APPEND release_files libapr-1.so.0 libaprutil-1.so.0 - libatk-1.0.so + libatk-1.0.so libfreetype.so.6.6.2 libfreetype.so.6 libhunspell-1.3.so.0.0.0 @@ -224,12 +224,11 @@ elseif(LINUX) libuuid.so.16.0.22 libfontconfig.so.1.8.0 libfontconfig.so.1 - libgmodule-2.0.so - libgobject-2.0.so + libgmodule-2.0.so + libgobject-2.0.so ) - endif() - - + endif() + if (TARGET ll::fmodstudio) set(debug_files ${debug_files} "libfmodL.so") set(release_files ${release_files} "libfmod.so") @@ -298,4 +297,4 @@ if(DARWIN) add_custom_command( TARGET stage_third_party_libs POST_BUILD COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/sharedlibs/Resources ) -endif() \ No newline at end of file +endif() diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index e56625d051..92045f7b58 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -7,4 +7,4 @@ include(Tracy) include(ZLIBNG) include(JsonCpp) -include(XmlRpcEpi) \ No newline at end of file +include(XmlRpcEpi) diff --git a/indra/cmake/LLCoreHttp.cmake b/indra/cmake/LLCoreHttp.cmake index a166c96043..22ed5fef9c 100644 --- a/indra/cmake/LLCoreHttp.cmake +++ b/indra/cmake/LLCoreHttp.cmake @@ -2,4 +2,4 @@ include(CURL) include(OpenSSL) -include(NGHTTP2) \ No newline at end of file +include(NGHTTP2) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 04afe5e405..3d8499cbc3 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -14,8 +14,8 @@ add_library( ll::colladadom INTERFACE IMPORTED ) # ND, needs fixup in collada conan pkg if( USE_CONAN ) target_include_directories( ll::colladadom SYSTEM INTERFACE - "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/" - "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" ) + "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/" + "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" ) endif() use_system_binary( colladadom ) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index f0239711aa..634cc15c21 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -60,13 +60,13 @@ endmacro (use_prebuilt_binary _binary) #Sadly we need a macro here, otherwise the return() will not properly work macro ( use_system_binary package ) if( USE_CONAN ) - target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${package} ) - foreach( extra_pkg "${ARGN}" ) - if( extra_pkg ) - target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${extra_pkg} ) - endif() - endforeach() + target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${package} ) + foreach( extra_pkg "${ARGN}" ) + if( extra_pkg ) + target_link_libraries( ll::${package} INTERFACE CONAN_PKG::${extra_pkg} ) + endif() + endforeach() return() endif() endmacro() - + diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index c02ad3e161..8b70192efc 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -8,8 +8,8 @@ if (LINUX) 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() + target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) + return() endif() use_prebuilt_binary(gtk-atk-pango-glib) -- cgit v1.2.3 From 7471788271174a673db10426b11db418928e1dd7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 17 Sep 2022 14:30:40 +0300 Subject: SL-17238 MacOS build does not recognize no-unused-but-set-variable --- indra/cmake/00-Common.cmake | 2 +- indra/cmake/Linking.cmake | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index a144973a16..f1348dbad5 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -180,7 +180,7 @@ if (LINUX OR DARWIN) list(APPEND GCC_WARNINGS -Werror) endif (NOT GCC_DISABLE_FATAL_WARNINGS) - list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-but-set-variable -Wno-unused-variable ) + list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-variable ) add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 5edb713cfa..4a501f420b 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -11,8 +11,12 @@ if (WINDOWS OR DARWIN ) # Kludge for older cmake versions, 3.20+ is needed to use a genex in add_custom_command( OUTPUT ... ) # Using this will work okay-ish, as Debug is not supported anyway. But for property multi config and also # ninja support the genex version is preferred. - if(${CMAKE_VERSION} VERSION_LESS "3.20.0") - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/Release) + if(${CMAKE_VERSION} VERSION_LESS "3.20.0") + if(CMAKE_BUILD_TYPE MATCHES Release) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/Release) + elseif (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/RelWithDebInfo) + endif() else() set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) endif() -- cgit v1.2.3 From a441ce184fef3b30daff2b3eeef9db650b748ac9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 20 Sep 2022 14:27:11 -0400 Subject: DRTVWR-568: Stop suppressing unused variable warnings -- we fixed?! --- indra/cmake/00-Common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index f1348dbad5..c848d00710 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -180,7 +180,7 @@ if (LINUX OR DARWIN) list(APPEND GCC_WARNINGS -Werror) endif (NOT GCC_DISABLE_FATAL_WARNINGS) - list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-variable ) + list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor ) add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) -- cgit v1.2.3 From 5a353bb7b21e7d251017779cc01c71247e0d8b87 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 21 Sep 2022 10:59:20 +0300 Subject: SL-17238 Small cleanup Implied 'branch' is now two different version-control systems behind --- indra/cmake/LLAddBuildTest.cmake | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 408280f0cc..bf569e5d99 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -18,9 +18,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # * properties for each sourcefile passed in indicate what libs to link that file with (MAKE NO ASSUMPTIONS ASIDE FROM TUT) # # More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code - # - # WARNING: do NOT modify this code without working with poppy - (2022-09-17: ND, I did not talk to poppy, are we all doomed now?) - # there is another branch that will conflict heavily with any changes here. # This here looks weird, but is needed. It will inject GoogleMock into projects that forgot to include `this` (LLAddBuildTest.cmake) # But through some other means have access to this macro -- cgit v1.2.3 From 31917709d9f4d9d4742910ae7990009a1580b150 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 21 Oct 2022 16:04:22 -0700 Subject: SL-18390: speculative fix for broken notarization - part2 --- indra/cmake/Copy3rdPartyLibs.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 7495de00d5..2c99d93284 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -294,7 +294,7 @@ if(DARWIN) # Support our "@executable_path/../Resources" load path for executables # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE # directories. - add_custom_command( TARGET stage_third_party_libs POST_BUILD - COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/sharedlibs/Resources - ) + #add_custom_command( TARGET stage_third_party_libs POST_BUILD + # COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/sharedlibs/Resources + # ) endif() -- cgit v1.2.3 From b4e8d7a7b28cfe8bb622e23148d66ee0a61e17e4 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 23 Oct 2022 20:08:46 +0200 Subject: Revert "SL-18390: speculative fix for broken notarization - part2" This reverts commit 31917709d9f4d9d4742910ae7990009a1580b150. --- indra/cmake/Copy3rdPartyLibs.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 2c99d93284..7495de00d5 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -294,7 +294,7 @@ if(DARWIN) # Support our "@executable_path/../Resources" load path for executables # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE # directories. - #add_custom_command( TARGET stage_third_party_libs POST_BUILD - # COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/sharedlibs/Resources - # ) + add_custom_command( TARGET stage_third_party_libs POST_BUILD + COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/sharedlibs/Resources + ) endif() -- cgit v1.2.3 From 1b6cd23abdc9e5208076d55cce9f06bc2a0713a1 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 29 Mar 2023 17:05:40 -0700 Subject: CMake and tests fixups after merge with main for DRTVWR-559 --- indra/cmake/LLCommon.cmake | 1 - indra/cmake/LLMath.cmake | 1 - indra/cmake/LLRender.cmake | 22 ---------------------- indra/cmake/Tracy.cmake | 7 ++----- 4 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 indra/cmake/LLRender.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 03f1fe39cb..869d5805f2 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -9,4 +9,3 @@ include(ZLIBNG) include(JsonCpp) include(XmlRpcEpi) - ${TRACY_LIBRARY} diff --git a/indra/cmake/LLMath.cmake b/indra/cmake/LLMath.cmake index 688e62e24b..e841d2ac78 100644 --- a/indra/cmake/LLMath.cmake +++ b/indra/cmake/LLMath.cmake @@ -2,5 +2,4 @@ include(Variables) include(Mikktspace) -include(MESHOPTIMIZER) diff --git a/indra/cmake/LLRender.cmake b/indra/cmake/LLRender.cmake deleted file mode 100644 index 2d9d3725ad..0000000000 --- a/indra/cmake/LLRender.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# -*- cmake -*- - -include(Variables) -include(FreeType) -include(GLH) -include(GLEXT) - -set(LLRENDER_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llrender - ${GLH_INCLUDE_DIR} - ${GLEXT_INCLUDE_DIR} - ) - -if (BUILD_HEADLESS) - set(LLRENDER_HEADLESS_LIBRARIES - llrenderheadless - ) -endif (BUILD_HEADLESS) -set(LLRENDER_LIBRARIES - llrender - ) - diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index cf9c866f8e..0bf3bd85ff 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -11,11 +11,8 @@ if (USE_TRACY) use_prebuilt_binary(tracy) target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy) - set(TRACY_LIBRARY "TracyClient") - set(TRACY_LIBRARY "TracyClient") -# See: indra/llcommon/llprofiler.h - target_compile_definitions(ll::tracy INTERFACE LL_PROFILER_CONFIGURATION=3 ) - set(TRACY_LIBRARY "TracyClient") + # See: indra/llcommon/llprofiler.h + add_compile_definitions(LL_PROFILER_CONFIGURATION=3) endif (USE_TRACY) -- cgit v1.2.3