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/CMakeLists.txt | 3 +++ indra/cmake/Linking.cmake | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 8386953cdc..ff6a68ff97 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -7,6 +7,9 @@ ## 3.13/12 is needed for add_link_options/add_compile_definitions ## 3.14 added FILE CREATE_LINK ## 3.16 is needed for target_precompile_headers +## Nicky: Ideally we want at least 3.21 for good preset support +## We're not there yet, but once done, there is a kludge in Linking.cmake +# "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING 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