Commit d8d2f21e24933cddabf30f2d4a4ddf1be0072e56

Patrick Steinhardt 2017-09-06T07:52:12

cmake: unify version check for target include directories There are two locations where we check whether CMake supports `TARGET_INCLUDE_DIRECTORIES`. While the first one uses `VERSION_LESS 2.8.12`, the second one uses `VERSION_GREATER 2.8.11`, which are obviously equivalent to each other. It'd still be easier to grep for specific CMake versions being required for some features if both used the same conditional mentioning the actual target version required. So this commit refactors these conditions to make them equal.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 190870a..53265cc 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -37,7 +37,9 @@ ADD_EXECUTABLE(libgit2_clar ${SRC_CLAR} ${SRC_TEST} ${LIBGIT2_OBJECTS})
 
 SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 
-IF (${CMAKE_VERSION} VERSION_GREATER 2.8.11)
+IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
+	# Already handled by a global INCLUDE_DIRECTORY()
+ELSE()
 	TARGET_INCLUDE_DIRECTORIES(libgit2_clar PRIVATE ../src PUBLIC ../include)
 ENDIF()