summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNicky <nicky.dasmijn@gmail.com>2022-05-01 13:37:44 +0200
committerNicky <nicky.dasmijn@gmail.com>2022-05-01 13:37:44 +0200
commit756a10eeace5891c17c6894b0df44f2b9b3ea078 (patch)
tree05a19009c9cba37e38274d5b1ffd7712a27e0fef /indra
parent283c2a20cc4ef856076d287303c7143332b201fe (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')
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake6
-rw-r--r--indra/cmake/DBusGlib.cmake2
-rw-r--r--indra/cmake/Linking.cmake24
-rw-r--r--indra/cmake/Variables.cmake2
-rw-r--r--indra/newview/CMakeLists.txt55
5 files changed, 27 insertions, 62 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}" )
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 328d3a0148..a7eb7f28b9 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1686,24 +1686,14 @@ if (WINDOWS)
# stores a list in the variable myfile in which each item is a line from the input file."
# And of course it's straightforward to read a text file in Python.
- if( ${CMAKE_GENERATOR} STREQUAL "Ninja")
- set(LL_INTDIR ${CMAKE_BUILD_TYPE})
- else()
- set(LL_INTDIR ${CMAKE_CFG_INTDIR})
- endif()
-
set(COPY_INPUT_DEPENDENCIES
# The following commented dependencies are determined at variably at build time. Can't do this here.
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
- ${SHARED_LIB_STAGING_DIR}/Release/glod.dll
- ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/glod.dll
- ${SHARED_LIB_STAGING_DIR}/Release/openjpeg.dll
- ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjpeg.dll
- ${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll
- ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll
- ${SHARED_LIB_STAGING_DIR}/Release/uriparser.dll
- ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/uriparser.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/glod.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/openjpeg.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/libhunspell.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/uriparser.dll
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/SLVoice.exe
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/libsndfile-1.dll
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/vivoxoal.dll
@@ -1718,33 +1708,32 @@ if (WINDOWS)
)
if (ADDRESS_SIZE EQUAL 64)
- list(APPEND COPY_INPUT_DEPENDENCIES
- ${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/vivoxsdk_x64.dll
- ${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/ortp_x64.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1-x64.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1-x64.dll
- )
+ list(APPEND COPY_INPUT_DEPENDENCIES
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/vivoxsdk_x64.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/ortp_x64.dll
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1-x64.dll
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1-x64.dll
+ )
else (ADDRESS_SIZE EQUAL 64)
- list(APPEND COPY_INPUT_DEPENDENCIES
- ${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/vivoxsdk.dll
- ${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/ortp.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1.dll
- )
+ list(APPEND COPY_INPUT_DEPENDENCIES
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/vivoxsdk.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/ortp.dll
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1.dll
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1.dll
+ )
endif (ADDRESS_SIZE EQUAL 64)
if (TARGET ll::fmodstudio)
list(APPEND COPY_INPUT_DEPENDENCIES
- ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
- ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/fmod.dll
${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll
)
endif ()
if (TARGET ll::openal)
list(APPEND COPY_INPUT_DEPENDENCIES
- ${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/OpenAL32.dll
- ${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/alut.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/OpenAL32.dll
+ ${SHARED_LIB_STAGING_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/alut.dll
)
endif ()
@@ -1760,13 +1749,13 @@ if (WINDOWS)
"--fmodstudio=${USE_FMODSTUDIO}"
"--openal=${USE_OPENAL}"
--build=${CMAKE_CURRENT_BINARY_DIR}
- --buildtype=${CMAKE_BUILD_TYPE}
+ --buildtype=$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>
"--channel=${VIEWER_CHANNEL}"
--configuration=${CMAKE_CFG_INTDIR}
- --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
+ --dest=${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>
--grid=${GRID}
--source=${CMAKE_CURRENT_SOURCE_DIR}
- --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat
+ --touch=${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/copy_touched.bat
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py