]> git.mxchange.org Git - flightgear.git/commitdiff
Don't create intermediate static libraries for build fgfs. (Speeds up rebuilds in...
authorJames Turner <zakalawe@mac.com>
Mon, 26 Mar 2012 12:09:39 +0000 (13:09 +0100)
committerJames Turner <zakalawe@mac.com>
Mon, 26 Mar 2012 12:09:39 +0000 (13:09 +0100)
CMakeModules/FlightGearComponent.cmake
src/FDM/JSBSim/CMakeLists.txt
src/FDM/YASim/CMakeLists.txt
src/Main/CMakeLists.txt
src/Network/CMakeLists.txt
src/Network/jpg-httpd.hxx

index 2b0daa93c6732b950d52500391bc76d484292869..2274047c847ec5d4ecd349c8f6a2ad84dd67b9b3 100644 (file)
@@ -1,9 +1,12 @@
 
 macro(flightgear_component name sources)
+    foreach(s ${sources})
+        set_property(GLOBAL
+            APPEND PROPERTY FG_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
+    endforeach()
 
-       set(libName "fg${name}")
-       add_library(${libName} STATIC ${sources} ${ARGV2})
-
-       set_property(GLOBAL APPEND PROPERTY FG_LIBS ${libName})
-    
+       foreach(h ${ARGV2})
+               set_property(GLOBAL
+                       APPEND PROPERTY FG_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
+       endforeach()
 endmacro()
index c0082591ab2683de1ea9dca8e52e83550dcb1442..17bcb48254e2bde46c7066f9a6a26424e3b312b0 100644 (file)
@@ -159,4 +159,4 @@ set(SOURCES
     
 include_directories(${PROJECT_SOURCE_DIR}/src/FDM/JSBSim)
 
-flightgear_component(JSBSim "${SOURCES}" "${HEADERS}")
+add_library(JSBSim STATIC ${SOURCES} ${HEADERS})
index d774a1d04ef570cc6aa59325d32fed0dabd90a26..b5c218ca2d20b857aaf5f1739ccfd48cbfef3c7b 100644 (file)
@@ -32,12 +32,11 @@ set(SOURCES
 )
 
 flightgear_component(YASim "${SOURCES}")
-
-add_executable(yasim yasim-test.cpp)
+    
+add_executable(yasim yasim-test.cpp ${SOURCES})
 
 target_link_libraries(yasim 
-       fgYASim
        ${SIMGEAR_CORE_LIBRARIES}
-       ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
+    ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
 
-install(TARGETS yasim RUNTIME DESTINATION bin)
+install(TARGETS yasim RUNTIME DESTINATION bin)
\ No newline at end of file
index 718c052a05f1a2752d0e263f4138db4b3a042475..c155f527ec2d11413a971953e2c2892e2beaa124 100644 (file)
@@ -53,7 +53,10 @@ set(HEADERS
        viewmgr.hxx
        )
 
-add_executable(fgfs ${SOURCES} ${HEADERS})
+get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
+get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
+
+add_executable(fgfs ${SOURCES} ${FG_SOURCES} ${FG_HEADERS} ${HEADERS})
 
 get_property(FG_LIBS GLOBAL PROPERTY FG_LIBS)
 #message(STATUS "fg libs ${FG_LIBS}")
@@ -69,8 +72,14 @@ else()
        set(HLA_LIBRARIES "")
 endif()
 
+if(ENABLE_JSBSIM)
+    # FIXME - remove once JSBSim doesn't expose private headers
+    include_directories(${PROJECT_SOURCE_DIR}/src/FDM/JSBSim)
+    
+    target_link_libraries(fgfs JSBSim)
+endif()
+
 target_link_libraries(fgfs
-       ${FG_LIBS}
        ${SIMGEAR_LIBRARIES}
        ${OPENSCENEGRAPH_LIBRARIES}
        ${OPENGL_LIBRARIES}
index fa6643de8d5e57e375ade7bc87c88184a8d7a146..f7947495d4a77fe7708cc60e73ca108253abad0d 100644 (file)
@@ -12,7 +12,6 @@ set(SOURCES
        generic.cxx
        httpd.cxx
        joyclient.cxx
-       jpg-httpd.cxx
        jsclient.cxx
        lfsglass.cxx
        native.cxx
@@ -40,7 +39,6 @@ set(HEADERS
        generic.hxx
        httpd.hxx
        joyclient.hxx
-       jpg-httpd.hxx
        jsclient.hxx
        lfsglass.hxx
        native.hxx
@@ -55,7 +53,12 @@ set(HEADERS
        ray.hxx
        rul.hxx
        )
-       
+       
+if(FG_JPEG_SERVER)
+    list(APPEND SOURCES jpg-httpd.cxx)
+    list(APPEND HEADERS jpg-httpd.hxx)
+endif()
+       
 flightgear_component(Network "${SOURCES}" "${HEADERS}")
 
 if(RTI_FOUND)
index e4fde9e9b9a835a026fd04446b32db7c69326d85..e5adee5f15c8ce4f3110b878b5ba12991b6e0201 100644 (file)
 #ifndef _FG_JPEG_HTTPD_HXX
 #define _FG_JPEG_HTTPD_HXX
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include <simgear/io/sg_netChat.hxx>
-
-#ifdef FG_JPEG_SERVER
-#  include <simgear/screen/jpgfactory.hxx>
-#else
-// dummy it in to keep the compiler happy
-class trJpgFactory {
-public:
-    trJpgFactory();
-    void init(int, int);
-    void destroy();
-    int render();
-    void setFrustum(double,double,double,double,double,double);
-  void *data();
-};
-#endif
+#include <simgear/screen/jpgfactory.hxx>
 
 #include "protocol.hxx"
 
-class trJpgFactory;
-
 
 /* simple httpd server that makes an hasty stab at following the http
    1.1 rfc.  */