diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/X11/CMakeLists.txt | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt index a4cc123..6a4abef 100644 --- a/Tests/X11/CMakeLists.txt +++ b/Tests/X11/CMakeLists.txt @@ -1,19 +1,20 @@ # a simple C only test case PROJECT (X11 C) -INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake) - -IF(CMAKE_HAS_X) - IF(CMAKE_X_CFLAGS) - SET(CMAKE_C_FLAGS "${CMAKE_X_CFLAGS} ${CMAKE_C_FLAGS}") - ENDIF(CMAKE_X_CFLAGS) +# Temporary hack to deal with dirty cache files. +IF(EXISTS ${X11_BINARY_DIR}/X11.exe) + EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E remove ${X11_BINARY_DIR}/X11.exe) +ENDIF(EXISTS ${X11_BINARY_DIR}/X11.exe) +IF(EXISTS ${X11_BINARY_DIR}/X11) + EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E remove ${X11_BINARY_DIR}/X11) +ENDIF(EXISTS ${X11_BINARY_DIR}/X11) - INCLUDE_DIRECTORIES(${CMAKE_X11_INCLUDES}) - ADD_DEFINITIONS(-DCMAKE_HAS_X) -ENDIF(CMAKE_HAS_X) +INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake) -ADD_EXECUTABLE (X11 X11.c) +ADD_EXECUTABLE (useX11 X11.c) IF(CMAKE_HAS_X) - TARGET_LINK_LIBRARIES(X11 ${CMAKE_X_LIBS}) + ADD_DEFINITIONS(-DCMAKE_HAS_X) + INCLUDE_DIRECTORIES(${CMAKE_X_INCLUDE_DIRS}) + TARGET_LINK_LIBRARIES(useX11 ${CMAKE_X_LIBS}) ENDIF(CMAKE_HAS_X) |