endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
message(STATUS "Library installation directory: ${CMAKE_INSTALL_LIBDIR}")
+#####################################################################################
+# Configure library search paths
+#####################################################################################
+
+if(NOT "${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
+ # Workaround for Ubuntu/Debian which introduced the "multiarch" library
+ # directory structure, which is unsupported by CMake < 2.8.10, so we need to
+ # add paths manually
+ # see http://www.cmake.org/Bug/view.php?id=12049 and
+ # http://www.cmake.org/Bug/view.php?id=12037
+ list(APPEND ADDITIONAL_LIBRARY_PATHS
+ /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+ /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+ /lib/${CMAKE_LIBRARY_ARCHITECTURE})
+ message(STATUS "additional library directories: ${ADDITIONAL_LIBRARY_PATHS}")
+endif()
+
+if(NOT MSVC)
+ # TBD: are these really necessary? Aren't they considered by cmake automatically?
+ list(APPEND ADDITIONAL_LIBRARY_PATHS
+ /opt/local
+ /usr/local
+ /usr)
+endif()
+#####################################################################################
+
+if (NOT MSVC)
option(SIMGEAR_SHARED "Set to ON to build SimGear as a shared library/framework" OFF)
+option(SYSTEM_EXPAT "Set to ON to build SimGear using the system libExpat" OFF)
+else()
+# Building SimGear DLLs is currently not supported for MSVC.
+set(SIMGEAR_SHARED OFF)
+# Using a system expat is currently not supported for MSVC - it would require shared simgear (DLL).
+set(SYSTEM_EXPAT OFF)
+endif()
+
option(SIMGEAR_HEADLESS "Set to ON to build SimGear without GUI/graphics support" OFF)
option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" ON)
option(ENABLE_RTI "Set to ON to build SimGear with RTI support" OFF)
option(ENABLE_TESTS "Set to OFF to disable building SimGear's test applications" ON)
-option(SYSTEM_EXPAT "Set to ON to build SimGear using the system libExpat" OFF)
+option(ENABLE_SOUND "Set to OFF to disable building SimGear's sound support" ON)
if (MSVC)
GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_SOURCE_DIR} PATH)
set( MSVC_3RDPARTY_DIR 3rdParty )
endif (CMAKE_CL_64)
- set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib )
- set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include)
+ set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/lib )
+ set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/include)
find_path(BOOST_ROOT boost/version.hpp
${MSVC_3RDPARTY_ROOT}/boost
+ ${MSVC_3RDPARTY_ROOT}/boost_1_52_0
${MSVC_3RDPARTY_ROOT}/boost_1_51_0
${MSVC_3RDPARTY_ROOT}/boost_1_50_0
${MSVC_3RDPARTY_ROOT}/boost_1_49_0
if(SIMGEAR_HEADLESS)
message(STATUS "SimGear mode: HEADLESS")
+ set(ENABLE_SOUND 0)
else()
message(STATUS "SimGear mode: NORMAL")
find_package(OpenGL REQUIRED)
- find_package(OpenAL REQUIRED)
+
+ if (ENABLE_SOUND)
+ find_package(OpenAL REQUIRED)
+ endif(ENABLE_SOUND)
+
find_package(OpenSceneGraph 3.0.0 REQUIRED osgText osgSim osgDB osgParticle osgGA osgUtil)
endif(SIMGEAR_HEADLESS)
add_definitions(-DHAVE_EXPAT_CONFIG_H)
endif(SYSTEM_EXPAT)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(windows.h HAVE_WINDOWS_H)
+if(HAVE_INTTYPES_H)
+ # ShivaVG needs inttypes.h
+ add_definitions(-DHAVE_INTTYPES_H)
+endif()
+
if(ENABLE_RTI)
# See if we have any rti library variant installed
message(STATUS "RTI: ENABLED")
void f() { isnan(0.0);} "
HAVE_ISNAN)
+check_cxx_source_compiles(
+ "#include <cmath>
+ void f() { std::isnan(0.0);} "
+ HAVE_STD_ISNAN)
+
if(CMAKE_COMPILER_IS_GNUCXX)
set(WARNING_FLAGS_CXX "-Wall")
set(WARNING_FLAGS_C "-Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} ${BOOST_CXX_FLAGS}")
include_directories(${PROJECT_SOURCE_DIR})
+include_directories(${PROJECT_SOURCE_DIR}/simgear/canvas/ShivaVG/include)
include_directories(${PROJECT_BINARY_DIR}/simgear)
include_directories(${PROJECT_BINARY_DIR}/simgear/xml)