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")
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
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
target_link_libraries(yasim
fgYASim
- ${SIMGEAR_LIBRARIES}
+ ${SIMGEAR_CORE_LIBRARIES}
${ZLIB_LIBRARIES})
install(TARGETS yasim RUNTIME DESTINATION bin)
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})
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}
)
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}
)
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}
add_executable(terrasync terrasync.cxx)
target_link_libraries(terrasync
- ${SIMGEAR_LIBRARIES}
+ ${SIMGEAR_CORE_LIBRARIES}
${ZLIB_LIBRARIES}
${WINSOCK_LIBRARY}
${RT_LIBRARY})
target_link_libraries(fgpanel
${PNG_LIBRARIES}
${GLUT_LIBRARIES}
- ${SIMGEAR_LIBRARIES}
+ ${SIMGEAR_CORE_LIBRARIES}
${OPENGL_LIBRARIES}
${ZLIB_LIBRARIES}
${PLIB_LIBRARIES}