From e2ff0645446caab8464952438d735d7879bd98a5 Mon Sep 17 00:00:00 2001 From: Nicholas Vitovitch Date: Wed, 11 Mar 2015 18:00:38 -0400 Subject: [PATCH] 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. --- src/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 311ae1b59..86229b464 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,7 +59,13 @@ endif() add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) target_link_libraries(glfw ${glfw_LIBRARIES}) -target_include_directories(glfw PUBLIC $) +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 $) +endif() set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}"