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/bugsplat.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/cmake/bugsplat.cmake') 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 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/bugsplat.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 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/bugsplat.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 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/bugsplat.cmake | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'indra/cmake/bugsplat.cmake') 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/bugsplat.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/cmake/bugsplat.cmake') 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 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/bugsplat.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/cmake/bugsplat.cmake') 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 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/bugsplat.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 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/bugsplat.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake/bugsplat.cmake') 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/bugsplat.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/bugsplat.cmake') 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/bugsplat.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/bugsplat.cmake') 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 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/bugsplat.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