]> git.mxchange.org Git - flightgear.git/commitdiff
Cmake: Split simgear libraries into core and scene (only scene uses OSG). Fix linkage...
authorJames Turner <zakalawe@mac.com>
Thu, 8 Sep 2011 12:59:40 +0000 (13:59 +0100)
committerJames Turner <zakalawe@mac.com>
Thu, 8 Sep 2011 12:59:40 +0000 (13:59 +0100)
CMakeLists.txt
CMakeModules/FindSimGear.cmake
src/FDM/YASim/CMakeLists.txt
src/Input/CMakeLists.txt
utils/GPSsmooth/CMakeLists.txt
utils/TerraSync/CMakeLists.txt
utils/fgpanel/CMakeLists.txt

index 581cb638fb8c1376f7ff9f85ac5a95c9f34c0405..54977bc47c871a010df93a85e8cf26bdf6fe39de 100644 (file)
@@ -18,6 +18,12 @@ file(READ version versionFile)
 string(STRIP ${versionFile} FLIGHTGEAR_VERSION) 
 
 #packaging
+
+# split version string into components, note CMAKE_MATCH_0 is the entire regexp match
+string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" CPACK_PACKAGE_VERSION ${FLIGHTGEAR_VERSION} )
+set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1}) 
+set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
+set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_3})
 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
 SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README")
 
index c7dc1b3e2668b976ab24b9190f641d546d35389c..f568d4b015eec66e2361d815c12cd4d74000d3fc 100644 (file)
@@ -105,29 +105,19 @@ endmacro()
 
 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
-        set(thread_lib threads)
-    endif(NOT MSVC)
-
+    set(SIMGEAR_CORE_LIBRARIES "") # clear value
+    
   # 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
-        ephem
         tsync
         environment
         nasal
-        sky
-        material
-        tgdb
-        model
-        screen
         bucket
         bvh
-        util route
+        util 
+        route
         timing
         io
         serial
@@ -136,14 +126,29 @@ if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND")
         props
         xml
         misc
-        ${thread_lib}
+        threads
         debug
         magvar
         math)
 
+    set(scene_comps
+        ephem
+        sky
+        material
+        tgdb
+        model
+        screen)
+            
     foreach(component ${comps})
+        find_sg_component(${component} SIMGEAR_CORE_LIBRARIES)
+    endforeach()
+        
+    foreach(component ${scene_comps})
         find_sg_component(${component} SIMGEAR_LIBRARIES)
     endforeach()
+    
+    # again link order matters - scene libraires depend on core ones
+    list(APPEND SIMGEAR_LIBRARIES ${SIMGEAR_CORE_LIBRARIES})
 endif()
 
 # now we've found SimGear, check its version
index 2118993a553f7d8bdb21a83d83540a39b77094df..1f91a8ed715e9472ff90c9f594e254ec4204973e 100644 (file)
@@ -37,7 +37,7 @@ add_executable(yasim yasim-test.cpp)
 
 target_link_libraries(yasim 
        fgYASim
-       ${SIMGEAR_LIBRARIES}
+       ${SIMGEAR_CORE_LIBRARIES}
        ${ZLIB_LIBRARIES})
 
 install(TARGETS yasim RUNTIME DESTINATION bin)
index 1a2df52d269614a08bc4a125d5b011f5ca58f6fa..27634bc4e14735ad3b8ebbe819c9d69625f3b760 100644 (file)
@@ -36,15 +36,15 @@ if(WIN32)
 endif(WIN32)
 
 target_link_libraries(fgjs 
+    ${SIMGEAR_CORE_LIBRARIES}
     ${SOCKETS_LIBRARY}
-       ${SIMGEAR_LIBRARIES}
        ${PLIB_LIBRARIES}
        ${ZLIB_LIBRARY})
 
 add_executable(js_demo js_demo.cxx)
 
 target_link_libraries(js_demo 
-       ${SIMGEAR_LIBRARIES}
+       ${SIMGEAR_CORE_LIBRARIES}
        ${PLIB_LIBRARIES}
        ${ZLIB_LIBRARY})
 
index 5a586d0c4a5a9a9b9dcc54d9337bac31de470972..5e90617c61bf828055402968dc7c165be2a3402d 100644 (file)
@@ -4,12 +4,7 @@ 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
-       ${SIMGEAR_IO_LIBRARY}
-       ${SIMGEAR_MISC_LIBRARY}
-       ${SIMGEAR_STRUCTURE_LIBRARY}
-       ${SIMGEAR_THREADS_LIBRARY}
-       ${SIMGEAR_TIMING_LIBRARY}
-       ${SIMGEAR_DEBUG_LIBRARY}
+       ${SIMGEAR_CORE_LIBRARIES}
        ${PLIB_SG_LIBRARY}
        ${PLIB_UL_LIBRARY}
        ${ZLIB_LIBRARIES}
@@ -20,13 +15,7 @@ target_link_libraries(GPSsmooth
 )
 
 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}
+       ${SIMGEAR_CORE_LIBRARIES}
        ${PLIB_SG_LIBRARY}
        ${PLIB_UL_LIBRARY}
        ${WINMM_LIBRARY}
@@ -35,14 +24,7 @@ target_link_libraries(MIDGsmooth
 )
 
 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}
+       ${SIMGEAR_CORE_LIBRARIES}
        ${PLIB_SG_LIBRARY}
        ${PLIB_UL_LIBRARY}
        ${WINMM_LIBRARY}
index 0fc13133e4d38cb9b7c7577abd0b11e37bd38229..6c81e0f2425e9c4b7889f2be381c32dc448d0686 100644 (file)
@@ -3,7 +3,7 @@
 add_executable(terrasync terrasync.cxx)
 
 target_link_libraries(terrasync
-       ${SIMGEAR_LIBRARIES}
+       ${SIMGEAR_CORE_LIBRARIES}
        ${ZLIB_LIBRARIES}
     ${WINSOCK_LIBRARY}
     ${RT_LIBRARY})
index 9feca02e64ebb5d5f7e87f5f571b69bcebb77c5b..3307beb7721addbeb5a9913724aba4899123204e 100644 (file)
@@ -18,7 +18,7 @@ if(GLUT_FOUND)
        target_link_libraries(fgpanel 
                ${PNG_LIBRARIES}
                ${GLUT_LIBRARIES}
-               ${SIMGEAR_LIBRARIES}
+               ${SIMGEAR_CORE_LIBRARIES}
                ${OPENGL_LIBRARIES}
                ${ZLIB_LIBRARIES}
                ${PLIB_LIBRARIES}