XDND support now can be disabled using WITH_GHOST_XDND=OFF with CMake and WITH_GHOST_...
[blender.git] / intern / ghost / CMakeLists.txt
index d7658c50a366428ee136946e4637d7ab58c32eaa..5693aea08658c14a80ce8e78dfa4228a37c225a7 100644 (file)
@@ -1,4 +1,3 @@
-# $Id$
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
 # This program is free software; you can redistribute it and/or
@@ -109,6 +108,10 @@ if(WITH_INPUT_NDOF)
        )
 endif()
 
+if(WITH_XDG_USER_DIRS)
+       add_definitions(-DWITH_XDG_USER_DIRS)
+endif()
+
 if(WITH_HEADLESS OR WITH_GHOST_SDL)
        if(WITH_HEADLESS)
                list(APPEND SRC
@@ -149,6 +152,10 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL)
                        intern/GHOST_SystemPathsX11.cpp
                        intern/GHOST_SystemPathsX11.h
                )
+
+               if(NOT WITH_INSTALL_PORTABLE)
+                       add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
+               endif()
        elseif(WIN32)
 
                list(APPEND SRC
@@ -204,10 +211,6 @@ elseif(APPLE)
 
 elseif(UNIX)
 
-       if(WITH_X11_XINPUT)
-               add_definitions(-DWITH_X11_XINPUT)
-       endif()
-
        list(APPEND INC_SYS
                ${X11_X11_INCLUDE_PATH}
        )
@@ -224,8 +227,18 @@ elseif(UNIX)
                intern/GHOST_WindowX11.h
        )
 
-       if(NOT WITH_INSTALL_PORTABLE)
-               add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
+       if(WITH_GHOST_XDND)
+               add_definitions(-DWITH_XDND)
+
+               list(APPEND INC
+                       ../../extern/xdnd
+               )
+
+               list(APPEND SRC
+                       intern/GHOST_DropTargetX11.cpp
+
+                       intern/GHOST_DropTargetX11.h
+               )
        endif()
 
        if(X11_XF86keysym_INCLUDE_PATH)
@@ -235,6 +248,13 @@ elseif(UNIX)
                )
        endif()
 
+       if(WITH_X11_XF86VMODE)
+               add_definitions(-DWITH_X11_XF86VMODE)
+               list(APPEND INC_SYS
+                       ${X11_xf86vmode_INCLUDE_PATH}
+               )
+       endif()
+
        if(WITH_INPUT_NDOF)
                list(APPEND SRC
                        intern/GHOST_NDOFManagerX11.cpp
@@ -243,11 +263,20 @@ elseif(UNIX)
                )
        endif()
 
-elseif(WIN32)
-       if(MSVC)
-               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
+       if(NOT WITH_INSTALL_PORTABLE)
+               add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
        endif()
 
+       if(WITH_X11_XINPUT)
+               add_definitions(-DWITH_X11_XINPUT)
+       endif()
+
+elseif(WIN32)
+       ## Warnings as errors, this is too strict!
+       #if(MSVC)
+       #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
+       #endif()
+
        list(APPEND INC_SYS
                ${WINTAB_INC}
        )