Browse Source

Better way to check old cmake version. [ci skip]

Yao Wei Tjong 姚伟忠 12 years ago
parent
commit
1b304cf2e7
1 changed files with 2 additions and 5 deletions
  1. 2 5
      Source/Engine/CMakeLists.txt

+ 2 - 5
Source/Engine/CMakeLists.txt

@@ -181,10 +181,7 @@ endif ()
 # \todo This is a deprecated property in CMake version 2.8.12 - Remove below macros when CMake minimum version is 2.8.12
 set_target_properties (${TARGET_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
 if (URHO3D_LIB_TYPE STREQUAL SHARED)
-    if (CMAKE_MAJOR_VERSION STREQUAL 2 AND CMAKE_MINOR_VERSION STREQUAL 8)
-        string (COMPARE GREATER ${CMAKE_PATCH_VERSION} 11 OLD_CMAKE)
-    endif ()
-    if (OLD_CMAKE)
+    if (CMAKE_VERSION VERSION_LESS 2.8.11)
         get_target_property (LINK_LIBRARIES ${TARGET_NAME} LINK_LIBRARIES)
         target_link_libraries (${TARGET_NAME} LINK_PRIVATE ${LINK_LIBRARIES})
     endif ()
@@ -231,7 +228,7 @@ if (URHO3D_LIB_TYPE STREQUAL SHARED)
     add_compiler_export_flags ()
     # Use PIC on platforms that support it (shared library type has this property set to true by default, so we only have to deal with those static ones that the shared library links against)
     set_target_properties (${STATIC_LIBRARY_TARGETS} PROPERTIES POSITION_INDEPENDENT_CODE true)
-    if (OLD_CMAKE)  # \todo Remove this when CMake minimum version is 2.8.9
+    if (CMAKE_VERSION VERSION_LESS 2.8.9)  # \todo Remove this when CMake minimum version is 2.8.9
         set_property (TARGET ${STATIC_LIBRARY_TARGETS} APPEND PROPERTY COMPILE_FLAGS -fPIC)
     endif ()
 endif ()