From 6b6238293f617c005a53c6a88d5371e12093da3a Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Thu, 1 Sep 2011 21:05:50 +0200 Subject: [PATCH] Revert to simgears thread support. Flightgear side. For all source directories outside of simgear/scene, which really depends very hard on osg, avoid using osg classes. This should reenable the use of some basic and scenegraph independent parts of simgear without the the need for osg. --- CMakeModules/FindSimGear.cmake | 28 ++++++++++++++-------------- utils/GPSsmooth/CMakeLists.txt | 12 ++++++------ utils/TerraSync/CMakeLists.txt | 10 +++++----- utils/fgpanel/CMakeLists.txt | 3 +-- utils/fgviewer/CMakeLists.txt | 9 +++++---- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CMakeModules/FindSimGear.cmake b/CMakeModules/FindSimGear.cmake index b8c446bba..c7dc1b3e2 100644 --- a/CMakeModules/FindSimGear.cmake +++ b/CMakeModules/FindSimGear.cmake @@ -1,7 +1,7 @@ # Locate SimGear # This module defines # SIMGEAR_LIBRARIES -# SIMGEAR_FOUND, if false, do not try to link to SimGear +# SIMGEAR_FOUND, if false, do not try to link to SimGear # SIMGEAR_INCLUDE_DIR, where to find the headers # # $SIMGEAR_DIR is an environment variable that would @@ -30,7 +30,7 @@ # /System/Library/Frameworks/SimGear.framework/Headers # # On OS X, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of +# People will have to manually change the cache values of # SimGear_LIBRARIES to override this selection or set the CMake environment # CMAKE_INCLUDE_PATH to modify the search paths. @@ -38,7 +38,7 @@ include(SelectLibraryConfigurations) FIND_PATH(SIMGEAR_INCLUDE_DIR simgear/math/SGMath.hxx HINTS $ENV{SIMGEAR_DIR} - PATH_SUFFIXES include + PATH_SUFFIXES include PATHS ~/Library/Frameworks /Library/Frameworks @@ -103,9 +103,9 @@ macro(find_sg_component comp libs) endmacro() -if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND") +if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND") set(SIMGEAR_LIBRARIES "") # clear value - + if(NOT MSVC) # Olaf indicates that linking the threads libs causes failures # on MSVC builds @@ -115,7 +115,7 @@ if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND") # note the order here affects the order Simgear libraries are # linked in, and hence ability to link when using a traditional # linker such as GNU ld on Linux - set(comps + set(comps ephem tsync environment @@ -123,13 +123,12 @@ if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND") sky material tgdb - model + model screen bucket bvh util route timing - ${thread_lib} io serial sound @@ -137,10 +136,11 @@ if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND") props xml misc - debug + ${thread_lib} + debug magvar math) - + foreach(component ${comps}) find_sg_component(${component} SIMGEAR_LIBRARIES) endforeach() @@ -157,14 +157,14 @@ SET(CMAKE_REQUIRED_INCLUDES ${SIMGEAR_INCLUDE_DIR}) check_cxx_source_runs( "#include #include \"simgear/version.h\" - + #define xstr(s) str(s) #define str(s) #s - + #define MIN_MAJOR ${SimGear_FIND_VERSION_MAJOR} #define MIN_MINOR ${SimGear_FIND_VERSION_MINOR} #define MIN_MICRO ${SimGear_FIND_VERSION_PATCH} - + int main() { int major, minor, micro; @@ -185,6 +185,6 @@ check_cxx_source_runs( SIMGEAR_VERSION_OK) include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(SimGear DEFAULT_MSG +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SimGear DEFAULT_MSG SIMGEAR_LIBRARIES SIMGEAR_INCLUDE_DIR SIMGEAR_VERSION_OK) diff --git a/utils/GPSsmooth/CMakeLists.txt b/utils/GPSsmooth/CMakeLists.txt index 453e2369c..5a586d0c4 100644 --- a/utils/GPSsmooth/CMakeLists.txt +++ b/utils/GPSsmooth/CMakeLists.txt @@ -3,10 +3,11 @@ add_executable(GPSsmooth gps.cxx gps_main.cxx) add_executable(MIDGsmooth MIDG-II.cxx MIDG_main.cxx) add_executable(UGsmooth UGear.cxx UGear_command.cxx UGear_main.cxx UGear_telnet.cxx) -target_link_libraries(GPSsmooth +target_link_libraries(GPSsmooth ${SIMGEAR_IO_LIBRARY} ${SIMGEAR_MISC_LIBRARY} ${SIMGEAR_STRUCTURE_LIBRARY} + ${SIMGEAR_THREADS_LIBRARY} ${SIMGEAR_TIMING_LIBRARY} ${SIMGEAR_DEBUG_LIBRARY} ${PLIB_SG_LIBRARY} @@ -15,18 +16,17 @@ target_link_libraries(GPSsmooth ${WINMM_LIBRARY} ${WINSOCK_LIBRARY} ${ZLIB_LIBRARIES} - ${OPENTHREADS_LIBRARIES} ${RT_LIBRARY} ) -target_link_libraries(MIDGsmooth +target_link_libraries(MIDGsmooth ${SIMGEAR_IO_LIBRARY} ${SIMGEAR_MATH_LIBRARY} ${SIMGEAR_SERIAL_LIBRARY} ${SIMGEAR_STRUCTURE_LIBRARY} + ${SIMGEAR_THREADS_LIBRARY} ${SIMGEAR_TIMING_LIBRARY} ${SIMGEAR_DEBUG_LIBRARY} - ${OPENTHREADS_LIBRARIES} ${PLIB_SG_LIBRARY} ${PLIB_UL_LIBRARY} ${WINMM_LIBRARY} @@ -34,15 +34,15 @@ target_link_libraries(MIDGsmooth ${RT_LIBRARY} ) -target_link_libraries(UGsmooth +target_link_libraries(UGsmooth ${SIMGEAR_DEBUG_LIBRARY} ${SIMGEAR_IO_LIBRARY} ${SIMGEAR_MATH_LIBRARY} ${SIMGEAR_MISC_LIBRARY} ${SIMGEAR_SERIAL_LIBRARY} ${SIMGEAR_STRUCTURE_LIBRARY} + ${SIMGEAR_THREADS_LIBRARY} ${SIMGEAR_TIMING_LIBRARY} - ${OPENTHREADS_LIBRARIES} ${PLIB_SG_LIBRARY} ${PLIB_UL_LIBRARY} ${WINMM_LIBRARY} diff --git a/utils/TerraSync/CMakeLists.txt b/utils/TerraSync/CMakeLists.txt index 25c01f084..0fc13133e 100644 --- a/utils/TerraSync/CMakeLists.txt +++ b/utils/TerraSync/CMakeLists.txt @@ -1,17 +1,17 @@ - + add_executable(terrasync terrasync.cxx) -target_link_libraries(terrasync +target_link_libraries(terrasync ${SIMGEAR_LIBRARIES} - ${OPENTHREADS_LIBRARIES} ${ZLIB_LIBRARIES} - ${WINSOCK_LIBRARY}) + ${WINSOCK_LIBRARY} + ${RT_LIBRARY}) if(LIBSVN_FOUND) target_link_libraries(terrasync ${LIBSVN_LIBRARIES}) set_property(TARGET terrasync APPEND PROPERTY COMPILE_FLAGS "${APR_CFLAGS}") - + IF(APPLE) set_property(SOURCE terrasync.cxx PROPERTY COMPILE_FLAGS "-iwithsysroot ${LIBSVN_INCLUDE_DIR}") ELSE() diff --git a/utils/fgpanel/CMakeLists.txt b/utils/fgpanel/CMakeLists.txt index 3595bf164..9feca02e6 100644 --- a/utils/fgpanel/CMakeLists.txt +++ b/utils/fgpanel/CMakeLists.txt @@ -16,14 +16,13 @@ if(GLUT_FOUND) panel_io.cxx) target_link_libraries(fgpanel - ${RT_LIBRARY} ${PNG_LIBRARIES} ${GLUT_LIBRARIES} ${SIMGEAR_LIBRARIES} - ${OPENTHREADS_LIBRARIES} ${OPENGL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLIB_LIBRARIES} + ${RT_LIBRARY} ) install(TARGETS fgpanel RUNTIME DESTINATION bin) diff --git a/utils/fgviewer/CMakeLists.txt b/utils/fgviewer/CMakeLists.txt index f6654788b..5872d8a80 100644 --- a/utils/fgviewer/CMakeLists.txt +++ b/utils/fgviewer/CMakeLists.txt @@ -1,11 +1,12 @@ add_executable(fgviewer fgviewer.cxx) -target_link_libraries(fgviewer +target_link_libraries(fgviewer ${SIMGEAR_LIBRARIES} - ${OPENSCENEGRAPH_LIBRARIES} + ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES} ${ZLIB_LIBRARIES} - ${PLIB_LIBRARIES}) - + ${PLIB_LIBRARIES} + ${RT_LIBRARY}) + install(TARGETS fgviewer RUNTIME DESTINATION bin)