$OpenBSD$ --- CMakeLists.txt.orig Tue Aug 6 05:57:30 2013 +++ CMakeLists.txt Sat Aug 10 17:48:28 2013 @@ -32,6 +32,9 @@ endif() # Platform specific libs if(UNIX) + find_package(X11 REQUIRED QUIET) + include_directories(${X11_INCLUDE_DIR}) + link_directories(${X11_LIBRARY_DIR}) list(APPEND LIBS "X11" "Xcursor") endif(UNIX) @@ -64,7 +67,11 @@ endif() mark_as_advanced(SHARE_INSTALL) #TODO: This would be more elegant and compiler independent to do through configure_file(), # but that would break other build systems for good. -add_definitions(-DSHARED_DATA_DIR="${SHARE_INSTALL}") +if(NOT SHARED_DATA_DIR) + add_definitions(-DSHARED_DATA_DIR="${SHARE_INSTALL}") +else() + add_definitions(-DSHARED_DATA_DIR="${SHARED_DATA_DIR}") +endif() if (DEFINED CMAKE_BUILD_TYPE) @@ -121,7 +128,10 @@ if(BUILD_GAME OR BUILD_EDITOR) endforeach() if(UNIX) - list(APPEND LIBS "rt") # For clock_gettime() + check_library_exists(rt clock_gettime "" HAVE_LIBRT) + if (HAVE_LIBRT) + list(APPEND LIBS "rt") # For clock_gettime() + endif() endif() endif()