summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeBackwardCompatibilityC.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeBackwardCompatibilityC.cmake')
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index a96f953..c15a9a9 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -28,8 +28,12 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
- SET (CMAKE_X_CFLAGS "-I${CMAKE_X11_INCLUDE_PATH}" CACHE STRING
- "X11 extra flags.")
+ IF("${CMAKE_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+ SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
+ ELSE("${CMAKE_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+ SET (CMAKE_X_CFLAGS "-I${CMAKE_X11_INCLUDE_PATH}" CACHE STRING
+ "X11 extra flags.")
+ ENDIF("${CMAKE_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
SET (CMAKE_X_LIBS "${CMAKE_X_LIBS}" CACHE STRING
"Libraries and options used in X11 programs.")
SET (CMAKE_HAS_X "${CMAKE_HAS_X}" CACHE INTERNAL "Is X11 around.")