]> git.mxchange.org Git - flightgear.git/blobdiff - CMakeLists.txt
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / CMakeLists.txt
index bb023c0e91c219ef3e0b53b3355b01988cbcec9d..a6a3194a2ebf1daf5572233cd2830051e4a1685c 100644 (file)
@@ -7,6 +7,9 @@ include (CheckIncludeFile)
 
 project(FlightGear)
 
+# We have some custom .cmake scripts not in the official distribution.
+set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
+
 if(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
     # use official include provided by latest CMake
     include(GNUInstallDirs)
@@ -46,9 +49,6 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "flightgear-${FLIGHTGEAR_VERSION}" CACHE INTE
 
 include (CPack)
 
-# We have some custom .cmake scripts not in the official distribution.
-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
-
 if (FG_DATA_DIR)
     message(STATUS "Using explicit data-dir: ${FG_DATA_DIR}")
 else()
@@ -80,8 +80,11 @@ IF(APPLE)
     list(APPEND PLATFORM_LIBS ${COCOA_LIBRARY} ${CORESERVICES_LIBRARY})
 
 elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
-    # disabled while DBus / HAL / udev issues are decided
-    #set(EVENT_INPUT_DEFAULT 1)
+       find_package(UDev)
+
+       if(UDEV_FOUND)
+               set(EVENT_INPUT_DEFAULT 1)
+       endif(UDEV_FOUND)
 endif()
 
 find_package(Git)
@@ -160,19 +163,23 @@ endif (MSVC AND MSVC_3RDPARTY_ROOT)
 
 if(EVENT_INPUT)
        message(STATUS "checking event-based Input")
-       
+
        IF(APPLE)
 
        elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
-        find_package(DBus)
-        if(NOT DBUS_FOUND)
-            message(WARNING "DBus not found, event input will be disabled")
-            set(EVENT_INPUT 0)
-        endif()
-        
+               if(NOT UDEV_FOUND)
+                       message(WARNING "UDev not found, event input is disabled!")
+                       set(EVENT_INPUT 0)
+               else()
+                       set(EVENT_INPUT_LIBRARIES ${UDEV_LIBRARIES})
+               endif()
+
        else()
                message(WARNING "event input is not supported on this platform yet")
        endif()
+
+       # Keep PLIB INPUT enabled as long as EventInput does not replace current joystick configurations.
+       set(ENABLE_PLIB_JOYSTICK 1)
 else(EVENT_INPUT)
        set(ENABLE_PLIB_JOYSTICK 1)
 endif(EVENT_INPUT)
@@ -188,6 +195,13 @@ find_package(OpenSceneGraph 3.0.0 REQUIRED osgText osgSim osgDB osgParticle osgF
 
 if(ENABLE_FGADMIN)
   find_package(FLTK)
+
+       if ( FLTK_FOUND )
+
+               set( CMAKE_REQUIRED_INCLUDES ${FLTK_INCLUDE_DIR} )
+               set( CMAKE_REQUIRED_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xinerama_LIB} ${X11_Xft_LIB} )
+
+       endif ( FLTK_FOUND )
 endif(ENABLE_FGADMIN)
 
 if(ENABLE_LIBSVN)
@@ -276,6 +290,7 @@ include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
        ${Boost_INCLUDE_DIRS}
        ${ZLIB_INCLUDE_DIR}
        ${ALUT_INCLUDE_DIR}
+       ${OPENGL_INCLUDE_DIR}
        ${OPENAL_INCLUDE_DIR}
        ${SIMGEAR_INCLUDE_DIR}
        ${PLIB_INCLUDE_DIR} )