Skip to content

Commit d8d2f21

Browse files
committed
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 parent 172a585 commit d8d2f21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ ADD_EXECUTABLE(libgit2_clar ${SRC_CLAR} ${SRC_TEST} ${LIBGIT2_OBJECTS})
3737

3838
SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
3939

40-
IF (${CMAKE_VERSION} VERSION_GREATER 2.8.11)
40+
IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
41+
# Already handled by a global INCLUDE_DIRECTORY()
42+
ELSE()
4143
TARGET_INCLUDE_DIRECTORIES(libgit2_clar PRIVATE ../src PUBLIC ../include)
4244
ENDIF()
4345

0 commit comments

Comments
 (0)