]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/CMakeLists.txt
Interim windows build fix
[flightgear.git] / src / Main / CMakeLists.txt
index 338a9f6d4fbaad94f3d0b81e36fc5071889d473b..4ea0fe523bf115bab90c07eafa1191e66c10563d 100644 (file)
@@ -1,10 +1,6 @@
 
 if (MSVC)
-       if (CMAKE_CL_64)
-               set( RESOURCE_FILE flightgear64.rc )
-       else (CMAKE_CL_64)
-               set( RESOURCE_FILE flightgear.rc )
-       endif (CMAKE_CL_64)
+       set( RESOURCE_FILE flightgear.rc )
 endif (MSVC)
 
 set(SOURCES
@@ -23,6 +19,7 @@ set(SOURCES
        util.cxx
     positioninit.cxx
     subsystemFactory.cxx
+    screensaver_control.cxx
        ${RESOURCE_FILE}
        )
 
@@ -40,6 +37,8 @@ set(HEADERS
        util.hxx
     positioninit.hxx
     subsystemFactory.hxx
+    AircraftDirVisitorBase.hxx
+    screensaver_control.hxx
        )
 
 get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
@@ -67,7 +66,38 @@ endforeach()
 
 source_group("Main\\Headers" FILES ${HEADERS})
 source_group("Main\\Sources" FILES ${SOURCES})
-add_executable(fgfs ${SOURCES} ${FG_SOURCES} ${FG_HEADERS} ${HEADERS})
+
+# important we pass WIN32 here so the console is optional. Other
+# platforms ignore this option. If a console is needed we allocate
+# it manually via AllocConsole()
+# similarly pass MACOSX_BUNDLE so we generate a .app on Mac
+add_executable(fgfs WIN32 MACOSX_BUNDLE
+                ${SOURCES} ${FG_SOURCES} ${FG_HEADERS} ${HEADERS})
+
+#-----------------------------------------------------------------------------
+# MacOSX bundle packagaing
+
+if(APPLE)
+    execute_process(COMMAND date +%Y
+        OUTPUT_VARIABLE CURRENT_YEAR
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+        
+    # in our local CMakeModules dir
+    set_target_properties(fgfs PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST FlightGearBundleInfo.plist.in
+        MACOSX_BUNDLE_GUI_IDENTIFIER "org.flightgear.FlightGear"
+        MACOSX_BUNDLE_SHORT_VERSION_STRING ${FLIGHTGEAR_VERSION}
+        MACOSX_BUNDLE_LONG_VERSION_STRING "FlightGear ${FLIGHTGEAR_VERSION} Nightly"
+        MACOSX_BUNDLE_BUNDLE_VERSION ${FLIGHTGEAR_VERSION}
+        MACOSX_BUNDLE_COPYRIGHT "FlightGear ${FLIGHTGEAR_VERSION} © 1997-${CURRENT_YEAR}, The FlightGear Project. Licensed under the GNU Public License version 2."
+        MACOSX_BUNDLE_INFO_STRING "Nightly build of FlightGear ${FLIGHTGEAR_VERSION} for testing and development"
+        MACOSX_BUNDLE_BUNDLE_NAME "FlightGear"
+        MACOSX_BUNDLE_ICON_FILE "FlightGear.icns"
+    )
+endif()
+
+#-----------------------------------------------------------------------------
 
 get_property(FG_LIBS GLOBAL PROPERTY FG_LIBS)
 #message(STATUS "fg libs ${FG_LIBS}")
@@ -89,18 +119,27 @@ endif()
 if(ENABLE_IAX)
     target_link_libraries(fgfs iaxclient_lib ${OPENAL_LIBRARY})
 endif()
+if(USE_DBUS)
+    target_link_libraries(fgfs ${DBUS_LIBRARIES})
+endif()
 if(FG_HAVE_GPERFTOOLS)
     include_directories(${GooglePerfTools_INCLUDE_DIR})
     target_link_libraries(fgfs ${GooglePerfTools_LIBRARIES})
 endif()
 
+if (CRASHRPT_FOUND)
+       target_link_libraries(fgfs ${CRASHRPT_LIBRARY})
+endif()
+if(X11_FOUND)
+    target_link_libraries(fgfs ${X11_LIBRARIES})
+endif()
 target_link_libraries(fgfs
        ${SQLITE3_LIBRARY}
        ${SIMGEAR_LIBRARIES}
        ${OPENSCENEGRAPH_LIBRARIES}
        ${OPENGL_LIBRARIES}
        ${PLIB_LIBRARIES}
-       ${JPEG_LIBRARY}
+        ${ZLIB_LIBRARY}
        ${HLA_LIBRARIES}
        ${EVENT_INPUT_LIBRARIES}
        ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
@@ -108,7 +147,23 @@ target_link_libraries(fgfs
        ${PLATFORM_LIBS}
 )
 
-install(TARGETS fgfs RUNTIME DESTINATION bin)
+if(ENABLE_FLITE)
+    if(SYSTEM_HTS_ENGINE)
+        target_link_libraries(fgfs flite_hts ${HTS_ENGINE_LIBRARIES})
+    else()
+        target_link_libraries(fgfs flite_hts hts_engine)
+    endif()
+endif()
+
+if (Qt5Core_FOUND)
+    target_link_libraries(fgfs Qt5::Widgets fglauncher)
+endif()
+
+if (APPLE)  
+    install(TARGETS fgfs BUNDLE DESTINATION .)
+else()
+    install(TARGETS fgfs RUNTIME DESTINATION bin)
+endif()
 
 if(ENABLE_METAR)
     add_executable(metar metar_main.cxx)