From 3134acca83a4ba67ea92e149381dafac01a2b3f4 Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sun, 26 Dec 2010 13:55:52 +0100 Subject: [PATCH] Add the hla stuff to the cmake build system. --- CMakeLists.txt | 15 ++++++++++----- src/Include/config_cmake.h.in | 8 +++++--- src/Main/CMakeLists.txt | 9 +++++++++ src/Network/CMakeLists.txt | 4 ++++ src/Network/HLA/CMakeLists.txt | 7 +++++++ 5 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 src/Network/HLA/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 08b2cdd1e..9505c6480 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,9 +72,9 @@ endif() if(EVENT_INPUT) message(STATUS "checking event-based Input") IF(APPLE) - + elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") - + else() message(WARNING "event input is not supported on this platform yet") endif() @@ -163,6 +163,11 @@ endif(HAVE_RT) endif(NOT CLOCK_GETTIME_IN_LIBC) endif(HAVE_CLOCK_GETTIME) +find_package(RTI) +if(RTI_FOUND) + set(FG_HAVE_HLA 1) +endif() + if(CMAKE_COMPILER_IS_GNUCXX) set(WARNING_FLAGS -Wall) endif(CMAKE_COMPILER_IS_GNUCXX) @@ -185,9 +190,9 @@ endif(WIN32) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT") -include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR} +include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR} ${SIMGEAR_INCLUDE_DIR} diff --git a/src/Include/config_cmake.h.in b/src/Include/config_cmake.h.in index 734b4dc5e..047717038 100644 --- a/src/Include/config_cmake.h.in +++ b/src/Include/config_cmake.h.in @@ -4,17 +4,17 @@ #cmakedefine ENABLE_SP_FDM // JSBSim needs this, to switch from standalone to in-FG mode -#define FGFS +#define FGFS #define PU_USE_NONE // PLIB needs this to avoid linking to GLUT #cmakedefine ENABLE_PLIB_JOYSTICK // threads are required (used to be optional) -#define ENABLE_THREADS 1 +#define ENABLE_THREADS 1 // audio support is assumed -#define ENABLE_AUDIO_SUPPORT 1 +#define ENABLE_AUDIO_SUPPORT 1 #cmakedefine HAVE_SYS_TIME_H #cmakedefine HAVE_WINDOWS_H @@ -33,3 +33,5 @@ #cmakedefine HAVE_LIBSVN_CLIENT_1 #define PKGLIBDIR "@PKGLIBDIR" + +#cmakedefine FG_HAVE_HLA diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index ffc87c857..ff4538c2e 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -30,8 +30,17 @@ get_property(FG_LIBS GLOBAL PROPERTY FG_LIBS) #message(STATUS "OSG libs ${OPENSCENEGRAPH_LIBRARIES}") #message(STATUS "SG libs ${SIMGEAR_LIBRARIES}") +if(RTI_FOUND) + find_sg_component(hla13 SIMGEAR_LIBRARIES) + find_sg_component(hla SIMGEAR_LIBRARIES) + set(HLA_LIBRARIES ${RTI_LIBRARIES}) +else() + set(HLA_LIBRARIES "") +endif() + target_link_libraries(fgfs ${FG_LIBS} + ${HLA_LIBRARIES} ${SIMGEAR_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES} ${OPENAL_LIBRARY} diff --git a/src/Network/CMakeLists.txt b/src/Network/CMakeLists.txt index c74044e14..4787fa184 100644 --- a/src/Network/CMakeLists.txt +++ b/src/Network/CMakeLists.txt @@ -30,3 +30,7 @@ set(SOURCES flightgear_component(Network "${SOURCES}") +if(RTI_FOUND) + add_subdirectory(HLA) +endif() + diff --git a/src/Network/HLA/CMakeLists.txt b/src/Network/HLA/CMakeLists.txt new file mode 100644 index 000000000..aeed0529d --- /dev/null +++ b/src/Network/HLA/CMakeLists.txt @@ -0,0 +1,7 @@ +include(FlightGearComponent) + +set(SOURCES + hla.cxx + ) + +flightgear_component(HLA "${SOURCES}")