diff options
author | Nicky <nicky.dasmijn@gmail.com> | 2022-05-01 13:37:44 +0200 |
---|---|---|
committer | Nicky <nicky.dasmijn@gmail.com> | 2022-05-01 13:37:44 +0200 |
commit | 756a10eeace5891c17c6894b0df44f2b9b3ea078 (patch) | |
tree | 05a19009c9cba37e38274d5b1ffd7712a27e0fef /indra/cmake | |
parent | 283c2a20cc4ef856076d287303c7143332b201fe (diff) |
Simplify cmake files by uaing generator expressions and be more
configuration specific, rather than staging files to Release and
RelWithdebInfo all the time
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 6 | ||||
-rw-r--r-- | indra/cmake/DBusGlib.cmake | 2 | ||||
-rw-r--r-- | indra/cmake/Linking.cmake | 24 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 2 |
4 files changed, 5 insertions, 29 deletions
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}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>" 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/$<LOWER_CASE:$<CONFIG>>) 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}" ) |