From 887d82b15eb24795384e81be7964f8f11b801a1e Mon Sep 17 00:00:00 2001 From: silverqx Date: Mon, 22 Jul 2024 13:55:50 +0200 Subject: [PATCH] cmake unified if() AND/OR at the end --- cmake/CommonModules/CsDebug.cmake | 5 +++-- cmake/TinyPackageConfigHelpers.cmake | 18 +++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cmake/CommonModules/CsDebug.cmake b/cmake/CommonModules/CsDebug.cmake index c11e0c0eb..95f0f6475 100644 --- a/cmake/CommonModules/CsDebug.cmake +++ b/cmake/CommonModules/CsDebug.cmake @@ -62,8 +62,9 @@ function(cs_print_target_properties target) foreach(property ${CMAKE_PROPERTY_LIST}) string(REPLACE "" "${cmakeBuildTypeUpper}" property ${property}) - if(property STREQUAL "LOCATION" OR property MATCHES "^LOCATION_" - OR property MATCHES "_LOCATION$") + if(property STREQUAL "LOCATION" OR property MATCHES "^LOCATION_" OR + property MATCHES "_LOCATION$" + ) continue() endif() diff --git a/cmake/TinyPackageConfigHelpers.cmake b/cmake/TinyPackageConfigHelpers.cmake index c5a0ad2cc..5500eec1d 100644 --- a/cmake/TinyPackageConfigHelpers.cmake +++ b/cmake/TinyPackageConfigHelpers.cmake @@ -141,9 +141,9 @@ function(tiny_build_type_requirements_install_tree # Match Debug builds types for MSVC (linking debug against release # (or vice-versa) cause crashes) - elseif(MSVC AND ((cmakeBuildTypeLower STREQUAL "debug" - AND NOT "debug" IN_LIST cvfTargetConfigurations) - OR (NOT cmakeBuildTypeLower STREQUAL "debug" AND cvfIsDebugOnly)) + elseif(MSVC AND ((cmakeBuildTypeLower STREQUAL "debug" AND + NOT "debug" IN_LIST cvfTargetConfigurations) OR + (NOT cmakeBuildTypeLower STREQUAL "debug" AND cvfIsDebugOnly)) ) # Obtain target configurations in printable format tiny_printable_configurations(tinyPrintableConfigurations @@ -208,12 +208,12 @@ function(tiny_build_type_requirements_build_tree # (or vice-versa) cause crashes) # Or if matching equal build tree was enabled and builds types don't match then # also tag as unsuitable (this is Build tree specific) - elseif((cvf_match_buildtree - AND NOT cmakeBuildTypeLower STREQUAL cvfConfigBuildTypeLower) - OR (MSVC AND ((cmakeBuildTypeLower STREQUAL "debug" - AND NOT cvfConfigBuildTypeLower STREQUAL "debug") - OR (NOT cmakeBuildTypeLower STREQUAL "debug" - AND cvfConfigBuildTypeLower STREQUAL "debug"))) + elseif((cvf_match_buildtree AND + NOT cmakeBuildTypeLower STREQUAL cvfConfigBuildTypeLower) OR + (MSVC AND ((cmakeBuildTypeLower STREQUAL "debug" AND + NOT cvfConfigBuildTypeLower STREQUAL "debug") OR + (NOT cmakeBuildTypeLower STREQUAL "debug" AND + cvfConfigBuildTypeLower STREQUAL "debug"))) ) set(${out_package_version} "${${out_package_version}} single-config CMAKE_BUILD_TYPE=${cvf_config_build_type}"