endif(HAVE_RT)
endif(HAVE_CLOCK_GETTIME)
+set(DL_LIBRARY "")
+check_cxx_source_compiles(
+ "#include <dlfcn.h>
+ int main(void) {
+ return 0;
+ }
+ "
+ HAVE_DLFCN_H)
+
+if(HAVE_DLFCN_H)
+ check_library_exists(dl dlerror "" HAVE_DL)
+ set(DL_LIBRARY "dl")
+endif()
+
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually 'd' on windows")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
SET(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
endif(ENABLE_TESTS)
# always set TEST_LIBS as it is also used by other tools/applications
-# TODO maybe better rename?
-if(SIMGEAR_SHARED)
- set( TEST_LIBS
- SimGearCore)
-else()
- set( TEST_LIBS
- SimGearCore
- ${CMAKE_THREAD_LIBS_INIT}
- ${ZLIB_LIBRARY}
- ${WINSOCK_LIBRARY}
- ${RT_LIBRARY}
- ${CORE_SERVICES_LIBRARY})
-endif()
+set(TEST_LIBS_INTERNAL_CORE
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${ZLIB_LIBRARY}
+ ${WINSOCK_LIBRARY}
+ ${RT_LIBRARY}
+ ${DL_LIBRARY}
+ ${CORE_SERVICES_LIBRARY})
+set(TEST_LIBS SimGearCore ${TEST_LIBS_INTERNAL_CORE})
if(NOT SIMGEAR_HEADLESS)
- set( TEST_LIBS
- SimGearScene
- ${TEST_LIBS}
- ${OPENGL_LIBRARIES})
+ set(TEST_LIBS SimGearScene ${OPENGL_LIBRARIES} ${TEST_LIBS})
endif()
install (FILES ${PROJECT_BINARY_DIR}/simgear/simgear_config.h DESTINATION include/simgear/)
set_property(TARGET SimGearCore PROPERTY VERSION ${SIMGEAR_VERSION})
set_property(TARGET SimGearCore PROPERTY SOVERSION ${SIMGEAR_SOVERSION})
- target_link_libraries(SimGearCore ${ZLIB_LIBRARY} ${RT_LIBRARY}
- ${LibArchive_LIBRARIES}
- ${EXPAT_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CORE_SERVICES_LIBRARY})
-
if(NOT SIMGEAR_HEADLESS)
add_library(SimGearScene SHARED ${sceneSources})
# set_property(TARGET SimGearScene PROPERTY FRAMEWORK 1)
set_property(TARGET SimGearScene PROPERTY VERSION ${SIMGEAR_VERSION})
set_property(TARGET SimGearScene PROPERTY SOVERSION ${SIMGEAR_SOVERSION})
- target_link_libraries(SimGearScene
- SimGearCore
- ${ZLIB_LIBRARY}
- ${OPENSCENEGRAPH_LIBRARIES}
- ${OPENAL_LIBRARY}
- ${OPENGL_LIBRARY}
- ${JPEG_LIBRARY})
-
install(TARGETS SimGearScene LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif(NOT SIMGEAR_HEADLESS)
endif(SIMGEAR_SHARED)
+target_link_libraries(SimGearCore
+ ${ZLIB_LIBRARY}
+ ${RT_LIBRARY}
+ ${DL_LIBRARY}
+ ${LibArchive_LIBRARIES}
+ ${EXPAT_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${CORE_SERVICES_LIBRARY})
+
+if(NOT SIMGEAR_HEADLESS)
+ target_link_libraries(SimGearScene
+ SimGearCore
+ ${ZLIB_LIBRARY}
+ ${OPENSCENEGRAPH_LIBRARIES}
+ ${OPENAL_LIBRARY}
+ ${OPENGL_LIBRARY}
+ ${JPEG_LIBRARY})
+endif()
+
if(ENABLE_RTI)
# Ugly first aid to make hla compile agian
set_property(SOURCE hla/RTI13InteractionClass.cxx hla/RTI13ObjectClass.cxx