Conditionaly enables target_include_directories.

CMake's target_include_directories breaks compatibility with glfw's
minimum required version. The command is now if-guarded for
CMake <2.8.11.
This commit is contained in:
Nicholas Vitovitch 2015-03-11 18:00:38 -04:00 committed by Zbigniew Mandziejewicz
parent 6297f916a6
commit e2ff064544

View File

@ -59,7 +59,13 @@ endif()
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
target_link_libraries(glfw ${glfw_LIBRARIES})
if (NOT CMAKE_VERSION VERSION_LESS "2.8.11")
# CMake 2.8.11 introduced the target_include_directories command to
# include and/or export public, private, and interface include
# directories. TODO If/when cmake_minimum_required increases to
# >=2.8.11, call this command unconditionally.
target_include_directories(glfw PUBLIC $<INSTALL_INTERFACE:${GLFW_INSTALL_INCLUDE_DIR}>)
endif()
set_target_properties(glfw PROPERTIES
OUTPUT_NAME "${GLFW_LIB_NAME}"