diff --git a/CMakeModules/FlightGearComponent.cmake b/CMakeModules/FlightGearComponent.cmake index 2b0daa93c..2274047c8 100644 --- a/CMakeModules/FlightGearComponent.cmake +++ b/CMakeModules/FlightGearComponent.cmake @@ -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() diff --git a/src/FDM/JSBSim/CMakeLists.txt b/src/FDM/JSBSim/CMakeLists.txt index c0082591a..17bcb4825 100644 --- a/src/FDM/JSBSim/CMakeLists.txt +++ b/src/FDM/JSBSim/CMakeLists.txt @@ -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}) diff --git a/src/FDM/YASim/CMakeLists.txt b/src/FDM/YASim/CMakeLists.txt index d774a1d04..b5c218ca2 100644 --- a/src/FDM/YASim/CMakeLists.txt +++ b/src/FDM/YASim/CMakeLists.txt @@ -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 diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index 718c052a0..c155f527e 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -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} diff --git a/src/Network/CMakeLists.txt b/src/Network/CMakeLists.txt index fa6643de8..f7947495d 100644 --- a/src/Network/CMakeLists.txt +++ b/src/Network/CMakeLists.txt @@ -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) diff --git a/src/Network/jpg-httpd.hxx b/src/Network/jpg-httpd.hxx index e4fde9e9b..e5adee5f1 100644 --- a/src/Network/jpg-httpd.hxx +++ b/src/Network/jpg-httpd.hxx @@ -28,31 +28,11 @@ #ifndef _FG_JPEG_HTTPD_HXX #define _FG_JPEG_HTTPD_HXX -#ifdef HAVE_CONFIG_H -# include -#endif - #include - -#ifdef FG_JPEG_SERVER -# include -#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 #include "protocol.hxx" -class trJpgFactory; - /* simple httpd server that makes an hasty stab at following the http 1.1 rfc. */