openbsd's port fix for non Linux systems w/o libRT
authorDavid Carlier <devnexen@gmail.com>
Sun, 19 Jun 2016 07:48:12 +0000 (08:48 +0100)
committerest31 <MTest31@outlook.com>
Sun, 3 Jul 2016 11:01:49 +0000 (13:01 +0200)
X11 headers are not always in expected locations, add them to include list.

Modifications by est31: indentation fixes, commit message improved

src/CMakeLists.txt

index f02812415351df2372e4206c62f29fb12a853b5f..bffc1f7eb7306dfd2f0dec77076868ead98a4a48 100644 (file)
@@ -336,7 +336,10 @@ else()
        if(APPLE)
                set(PLATFORM_LIBS "-framework CoreFoundation" ${PLATFORM_LIBS})
        else()
-               set(PLATFORM_LIBS -lrt ${PLATFORM_LIBS})
+               check_library_exists(rt clock_gettime "" HAVE_LIBRT)
+               if (HAVE_LIBRT)
+                       set(PLATFORM_LIBS -lrt ${PLATFORM_LIBS})
+               endif(HAVE_LIBRT)
        endif(APPLE)
 
        # This way Xxf86vm is found on OpenBSD too
@@ -555,6 +558,7 @@ include_directories(
        ${LUA_INCLUDE_DIR}
        ${GMP_INCLUDE_DIR}
        ${JSON_INCLUDE_DIR}
+       ${X11_INCLUDE_DIR}
        ${PROJECT_SOURCE_DIR}/script
 )