]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
cmake: better way to set per OS options
authorThomas Debesse <dev@illwieckz.net>
Tue, 4 Jun 2019 00:48:52 +0000 (02:48 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sun, 16 Jun 2019 13:22:15 +0000 (15:22 +0200)
CMakeLists.txt

index c4bc7cef76f7caa4160a47d965b62975107ae278..54102b5396dea8e96aaa851a01b97c68e54f985a 100644 (file)
@@ -169,38 +169,27 @@ if (BUILD_RADIANT)
     disable_deprecated(PANGO 0)
 endif ()
 
-IF(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-    link_directories(
-            /usr/local/lib
-    )
-endif ()
-
 if (BUILD_BINARIES)
-    if (APPLE)
-        add_definitions(
-                -DPOSIX=1
-        )
-
+    if(APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
         link_directories(
-                /usr/local/lib
+            /usr/local/lib
         )
-    elseif (WIN32)
+    endif ()
+
+    if (WIN32)
         add_definitions(
-                -DWIN32=1
-                -D_WIN32=1
+            -DWIN32=1
+            -D_WIN32=1
         )
     else ()
-        if (BUILD_RADIANT)
-             set(XWINDOWS ON)
-        endif ()
-
         add_definitions(
-                -DPOSIX=1
+            -DPOSIX=1
         )
     endif ()
 endif ()
 
-if (BUILD_RADIANT AND XWINDOWS)
+if (BUILD_RADIANT AND NOT APPLE AND NOT WIN32)
+    set(XWINDOWS ON)
     find_package(X11 REQUIRED)
     include_directories(${X11_INCLUDE_DIR})
     add_definitions(-DXWINDOWS=1)