From cebdcd1d4354615696ca676451cd0bf58382e7a3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 13:47:44 -0700 Subject: [PATCH] Revert "Revise AutoInclude.cmake: My version of CMake, despite being >=2.8.11, doesn't actually support CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE." This reverts commit 6a38e3c95df00da728cbd253c0bf80c22d0c419b. --- cmake/modules/AutoInclude.cmake | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake index 40916f1e68..3a2f2d74e0 100644 --- a/cmake/modules/AutoInclude.cmake +++ b/cmake/modules/AutoInclude.cmake @@ -4,12 +4,8 @@ # behavior by default. # -# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior if -# this version doesn't define CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. -# CFSworks's version of CMake (2.8.12) doesn't have -# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE even though it should be supported, -# hence test if it's defined (as either ON or OFF) before trying to use it. -if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") +# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. +if(CMAKE_VERSION VERSION_LESS 2.8.11) # Replace some built-in functions in order to extend their functionality. function(add_library target) _add_library(${target} ${ARGN}) @@ -33,16 +29,14 @@ if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") endif() endforeach() - if(interface_dirs) - list(REMOVE_DUPLICATES interface_dirs) + list(REMOVE_DUPLICATES interface_dirs) - #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interface_dirs}) - include_directories(${interface_dirs}) + #NB. target_include_directories is new in 2.8.8. + #target_include_directories("${target}" ${interface_dirs}) + include_directories(${interface_dirs}) - # Update this target's interface inc dirs. - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") - endif() + # Update this target's interface inc dirs. + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") # Call to the built-in function we are overriding. _target_link_libraries(${target} ${ARGN})