diff options
author | Brad King <brad.king@kitware.com> | 2023-08-23 15:20:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-25 15:08:21 (GMT) |
commit | 10f435a58f97a71f6718bfdd0cacb72175a906ef (patch) | |
tree | 0a833b86b2ff09f684ab21810dfe9860276ba4f1 | |
parent | 9575e6f57bf21244d48aaf041bb0c975c8dbcd49 (diff) | |
download | CMake-10f435a58f97a71f6718bfdd0cacb72175a906ef.zip CMake-10f435a58f97a71f6718bfdd0cacb72175a906ef.tar.gz CMake-10f435a58f97a71f6718bfdd0cacb72175a906ef.tar.bz2 |
Tests: Simplify nested if conditions in Complex tests
-rw-r--r-- | Tests/Complex/Executable/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/Complex/Library/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/Executable/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/Library/CMakeLists.txt | 16 |
4 files changed, 10 insertions, 38 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 2a79629..ceb6b54 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -45,12 +45,8 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else() - if (NOT BORLAND) - if(NOT MINGW) - target_link_libraries(complex rpcrt4.lib) - endif() - endif() +elseif(NOT BORLAND AND NOT MINGW) + target_link_libraries(complex rpcrt4.lib) endif () # Test linking to static lib when a shared lib has the same name. diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index df874ef..9f2d5e1 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -23,19 +23,9 @@ set(LibrarySources ${LibrarySources} remove(LibrarySources create_file.cxx GENERATED nonexisting_file) add_library(CMakeTestLibrary ${LibrarySources}) -if(WIN32) - if(NOT CYGWIN) - if(NOT BORLAND) - if(NOT MINGW) - target_link_libraries(CMakeTestLibrary - debug - user32.lib) - target_link_libraries(CMakeTestLibrary - optimized - kernel32.lib) - endif() - endif() - endif() +if(WIN32 AND NOT CYGWIN AND NOT BORLAND AND NOT MINGW) + target_link_libraries(CMakeTestLibrary debug user32.lib) + target_link_libraries(CMakeTestLibrary optimized kernel32.lib) endif() # diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index f935aed..ec76e83 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -45,12 +45,8 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else() - if (NOT BORLAND) - if(NOT MINGW) - target_link_libraries(complex rpcrt4.lib) - endif() - endif() +elseif(NOT BORLAND AND NOT MINGW) + target_link_libraries(complex rpcrt4.lib) endif () # Test linking to static lib when a shared lib has the same name. diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index df874ef..9f2d5e1 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -23,19 +23,9 @@ set(LibrarySources ${LibrarySources} remove(LibrarySources create_file.cxx GENERATED nonexisting_file) add_library(CMakeTestLibrary ${LibrarySources}) -if(WIN32) - if(NOT CYGWIN) - if(NOT BORLAND) - if(NOT MINGW) - target_link_libraries(CMakeTestLibrary - debug - user32.lib) - target_link_libraries(CMakeTestLibrary - optimized - kernel32.lib) - endif() - endif() - endif() +if(WIN32 AND NOT CYGWIN AND NOT BORLAND AND NOT MINGW) + target_link_libraries(CMakeTestLibrary debug user32.lib) + target_link_libraries(CMakeTestLibrary optimized kernel32.lib) endif() # |