2018-03-25 12:18:24 +00:00
|
|
|
function(setup_fgfs_libraries target)
|
|
|
|
if(RTI_FOUND)
|
2020-03-15 22:31:05 +00:00
|
|
|
set(HLA_LIBRARIES ${RTI_LDFLAGS})
|
2018-03-25 12:18:24 +00:00
|
|
|
else()
|
|
|
|
set(HLA_LIBRARIES "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_JSBSIM)
|
|
|
|
target_link_libraries(${target} JSBSim)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_IAX)
|
2020-08-19 13:49:50 +00:00
|
|
|
target_link_libraries(${target} iaxclient_lib)
|
2018-03-25 12:18:24 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-27 21:33:08 +00:00
|
|
|
if(HAVE_DBUS)
|
|
|
|
# ALIAS doesn't work with CMake 3.10, so we need
|
|
|
|
# variable to store the target name
|
|
|
|
target_link_libraries(${target} ${dbus_target})
|
2019-05-27 10:37:35 +00:00
|
|
|
endif()
|
|
|
|
|
2018-03-25 12:18:24 +00:00
|
|
|
if(X11_FOUND)
|
|
|
|
target_link_libraries(${target} ${X11_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2021-07-17 22:19:14 +00:00
|
|
|
if(ENABLE_OSGXR)
|
2022-01-12 23:25:15 +00:00
|
|
|
target_link_libraries(${target} osgXR)
|
2021-07-17 22:19:14 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-21 11:13:10 +00:00
|
|
|
target_link_libraries(${target} fgsqlite3 fgvoicesynth fgembeddedresources)
|
2020-08-19 13:49:50 +00:00
|
|
|
|
2018-03-25 12:18:24 +00:00
|
|
|
target_link_libraries(${target}
|
|
|
|
SimGearCore
|
|
|
|
SimGearScene
|
2020-08-19 13:49:50 +00:00
|
|
|
Boost::boost
|
2018-03-25 12:18:24 +00:00
|
|
|
${EVENT_INPUT_LIBRARIES}
|
|
|
|
${HLA_LIBRARIES}
|
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
${OPENSCENEGRAPH_LIBRARIES}
|
|
|
|
${PLATFORM_LIBS}
|
|
|
|
${PLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2020-08-22 20:33:57 +00:00
|
|
|
if (ENABLE_SWIFT)
|
2020-08-27 21:33:08 +00:00
|
|
|
# ALIAS doesn't work with CMake 3.10, so we need
|
|
|
|
# variable to store the target name
|
|
|
|
target_link_libraries(${target} ${dbus_target} ${libEvent_target})
|
2020-08-22 20:33:57 +00:00
|
|
|
endif()
|
|
|
|
|
2016-01-13 04:44:28 +00:00
|
|
|
if (ENABLE_PLIB_JOYSTICK)
|
|
|
|
target_link_libraries(${target} PLIBJoystick)
|
|
|
|
endif()
|
2018-03-25 12:18:24 +00:00
|
|
|
|
2020-03-13 11:27:11 +00:00
|
|
|
target_link_libraries(${target} PLIBFont)
|
|
|
|
|
2021-03-08 15:53:53 +00:00
|
|
|
if (HAVE_QT)
|
2021-03-09 21:04:21 +00:00
|
|
|
target_link_libraries(${target} fglauncher fgqmlui)
|
2018-03-25 12:18:24 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
|
|
|
target_link_libraries(${target} execinfo)
|
|
|
|
endif()
|
2019-08-12 16:52:53 +00:00
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
|
|
|
target_link_libraries(${target} execinfo)
|
|
|
|
endif()
|
2021-03-08 15:53:53 +00:00
|
|
|
|
|
|
|
if (TARGET sentry::sentry)
|
|
|
|
target_link_libraries(${target} sentry::sentry)
|
|
|
|
endif()
|
2018-03-25 12:18:24 +00:00
|
|
|
endfunction()
|
2021-03-09 10:46:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
# CMake < 3.12 can't define a link to an OBJECT library to specify its include
|
|
|
|
# paths, so we have to essentially duplicate the above and configure the paths manually.
|
|
|
|
# Once we require CMake 3.12, delete all this and use the function above.
|
|
|
|
|
|
|
|
function (_apply_target_includes dest target)
|
|
|
|
if (NOT TARGET ${target})
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# retrieve the list of includes from the target
|
|
|
|
get_target_property(includes ${target} INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
|
|
|
|
foreach(i ${includes})
|
|
|
|
# skip any invalid includes
|
|
|
|
if (NOT i)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_include_directories(${dest} PUBLIC ${i})
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function (_apply_all_target_includes dest)
|
|
|
|
foreach(arg IN LISTS ARGN)
|
|
|
|
_apply_target_includes(${dest} ${arg})
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function (setup_fgfs_library_includes target)
|
|
|
|
|
|
|
|
_apply_all_target_includes(${target}
|
|
|
|
SimGearCore
|
|
|
|
SimGearScene
|
|
|
|
Boost::boost
|
|
|
|
${EVENT_INPUT_LIBRARIES}
|
|
|
|
${HLA_LIBRARIES}
|
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
${OPENSCENEGRAPH_LIBRARIES}
|
|
|
|
${PLATFORM_LIBS}
|
|
|
|
${PLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(ENABLE_JSBSIM)
|
|
|
|
_apply_target_includes(${target} JSBSim)
|
|
|
|
endif()
|
|
|
|
|
2022-01-12 23:20:12 +00:00
|
|
|
if(ENABLE_OSGXR)
|
2022-01-12 23:25:15 +00:00
|
|
|
_apply_target_includes(${target} osgXR)
|
2022-01-12 23:20:12 +00:00
|
|
|
endif()
|
|
|
|
|
2021-03-09 10:46:46 +00:00
|
|
|
_apply_target_includes(${target} fgsqlite3)
|
|
|
|
_apply_target_includes(${target} fgvoicesynth)
|
|
|
|
_apply_target_includes(${target} fgembeddedresources)
|
|
|
|
|
|
|
|
if(ENABLE_IAX)
|
|
|
|
_apply_target_includes(${target} iaxclient_lib)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (ENABLE_SWIFT)
|
2021-07-31 18:21:18 +00:00
|
|
|
_apply_all_target_includes(${target} ${dbus_target} ${libEvent_target})
|
|
|
|
elseif(HAVE_DBUS)
|
2021-03-09 10:46:46 +00:00
|
|
|
_apply_all_target_includes(${target} ${dbus_target})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (ENABLE_PLIB_JOYSTICK)
|
|
|
|
_apply_target_includes(${target} PLIBJoystick)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
_apply_target_includes(${target} PLIBFont)
|
|
|
|
|
|
|
|
if (TARGET sentry::sentry)
|
|
|
|
_apply_target_includes(${target} sentry::sentry)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endfunction()
|