diff --git a/CMakeLists.txt b/CMakeLists.txt index e24ac294b..94511e837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1152,8 +1152,10 @@ list(APPEND TARGETS_OWN ${TARGET_SERVER}) list(APPEND TARGETS_LINK ${TARGET_SERVER}) if(ANTIBOT) - if(CMAKE_VERSION VERSION_LESS 3.14 AND (CMAKE_VERSION VERSION_GREATER 3.8 OR CMAKE_VERSION VERSION_EQUAL 3.8)) - set_property(TARGET ${TARGET_SERVER} PROPERTY BUILD_RPATH "$ORIGIN") + if(CMAKE_VERSION VERSION_GREATER 3.8 OR CMAKE_VERSION VERSION_EQUAL 3.8) + if(CMAKE_VERSION VERSION_LESS 3.14) + set_property(TARGET ${TARGET_SERVER} PROPERTY BUILD_RPATH "$ORIGIN") + endif() else() message(STATUS "Can't set BUILD_RPATH in CMake before 3.8, pass -Wl,-rpath,'$ORIGIN' manually if you wish to emulate this. Or just install a newer version of CMake...") endif()