# 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
# /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.
FIND_PATH(SIMGEAR_INCLUDE_DIR simgear/math/SGMath.hxx
HINTS $ENV{SIMGEAR_DIR}
- PATH_SUFFIXES include
+ PATH_SUFFIXES include
PATHS
~/Library/Frameworks
/Library/Frameworks
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
# 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
sky
material
tgdb
- model
+ model
screen
bucket
bvh
util route
timing
- ${thread_lib}
io
serial
sound
props
xml
misc
- debug
+ ${thread_lib}
+ debug
magvar
math)
-
+
foreach(component ${comps})
find_sg_component(${component} SIMGEAR_LIBRARIES)
endforeach()
check_cxx_source_runs(
"#include <cstdio>
#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;
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)
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}
${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}
${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}
-
+
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()
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)
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)