diff --git a/src/libs/tgfclient/CMakeLists.txt b/src/libs/tgfclient/CMakeLists.txt index 5ed13fbfb..2fe3c6f2f 100644 --- a/src/libs/tgfclient/CMakeLists.txt +++ b/src/libs/tgfclient/CMakeLists.txt @@ -95,10 +95,11 @@ ENDIF(UNIX) SD_INSTALL_FILES(INCLUDE FILES glfeatures.h guiscreen.h tgfclient.h) -# To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' -IF(UNIX AND NOT APPLE) - IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_link_options(tgfclient PRIVATE -Wl,--allow-shlib-undefined) - ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -ENDIF(UNIX AND NOT APPLE) - +IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") + # To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' + IF(UNIX AND NOT APPLE) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_link_options(tgfclient PRIVATE -Wl,--allow-shlib-undefined) + ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ENDIF(UNIX AND NOT APPLE) +ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 8079e82ee..354be9c30 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -55,12 +55,12 @@ IF(WIN32) SD_INSTALL_CUSTOM_3RDPARTY(${_TARGET_NAME}) ENDIF(WIN32) +IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") # To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' -IF(UNIX AND NOT APPLE) - IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_link_options(${_TARGET_NAME} PRIVATE -Wl,--allow-shlib-undefined) - ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_link_options(${_TARGET_NAME} PRIVATE -Wl,-E) -ENDIF(UNIX AND NOT APPLE) - - + IF(UNIX AND NOT APPLE) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_link_options(${_TARGET_NAME} PRIVATE -Wl,--allow-shlib-undefined) + ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_link_options(${_TARGET_NAME} PRIVATE -Wl,-E) + ENDIF(UNIX AND NOT APPLE) +ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") diff --git a/src/tools/menuview/CMakeLists.txt b/src/tools/menuview/CMakeLists.txt index d9d839770..33cf8ad79 100644 --- a/src/tools/menuview/CMakeLists.txt +++ b/src/tools/menuview/CMakeLists.txt @@ -52,9 +52,11 @@ ENDIF(UNIX) SD_INSTALL_FILES(BIN TARGETS ${_TARGET_NAME}) -# To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' -IF(UNIX AND NOT APPLE) - IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_link_options(${_TARGET_NAME} PRIVATE -Wl,--allow-shlib-undefined) - ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -ENDIF(UNIX AND NOT APPLE) \ No newline at end of file +IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") + # To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' + IF(UNIX AND NOT APPLE) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_link_options(${_TARGET_NAME} PRIVATE -Wl,--allow-shlib-undefined) + ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ENDIF(UNIX AND NOT APPLE) +ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") diff --git a/src/tools/trackgen/CMakeLists.txt b/src/tools/trackgen/CMakeLists.txt index 3681324b9..c8317d722 100644 --- a/src/tools/trackgen/CMakeLists.txt +++ b/src/tools/trackgen/CMakeLists.txt @@ -56,9 +56,11 @@ ENDIF(UNIX) SD_INSTALL_FILES(BIN TARGETS ${_TARGET_NAME}) -# To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' -IF(UNIX AND NOT APPLE) - IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_link_options(${_TARGET_NAME} PRIVATE -Wl,--allow-shlib-undefined) - ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -ENDIF(UNIX AND NOT APPLE) +IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13") + # To avoid 'undefined reference to glActiveTextureARB [--no-allow-shlib-undefined]' + IF(UNIX AND NOT APPLE) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_link_options(${_TARGET_NAME} PRIVATE -Wl,--allow-shlib-undefined) + ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ENDIF(UNIX AND NOT APPLE) +ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS "3.13")