FGCom OpenAL CMake fixes
Ensure we detect OpenAL the way IAXClient expects, and set it up as a dependency of IAXClient, not FGCom.
This commit is contained in:
parent
218df89b29
commit
e4e2b34a4c
3 changed files with 48 additions and 6 deletions
|
@ -45,9 +45,6 @@ if (MSVC AND MSVC_3RDPARTY_ROOT)
|
|||
set( BOOST_LIB lib )
|
||||
endif (CMAKE_CL_64)
|
||||
|
||||
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 ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/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 ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/include)
|
||||
|
||||
# ensure 3rdparty/lib/cmake is searched
|
||||
list(APPEND CMAKE_PREFIX_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR})
|
||||
|
||||
|
@ -60,5 +57,4 @@ if (MSVC AND MSVC_3RDPARTY_ROOT)
|
|||
set(BOOST_INCLUDEDIR ${MSVC_ROOT_PARENT_DIR})
|
||||
message(STATUS "BOOST_INCLUDEDIR is ${BOOST_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
endif (MSVC AND MSVC_3RDPARTY_ROOT)
|
||||
|
|
48
CMakeModules/FindOpenAL.cmake
Normal file
48
CMakeModules/FindOpenAL.cmake
Normal file
|
@ -0,0 +1,48 @@
|
|||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindOpenAL
|
||||
----------
|
||||
|
||||
|
||||
Finds Open Audio Library (OpenAL).
|
||||
This module defines ``OPENAL_LIBRARY OPENAL_FOUND``, if
|
||||
false, do not try to link to OpenAL ``OPENAL_INCLUDE_DIR``, where to find
|
||||
the headers.
|
||||
|
||||
``$OPENALDIR`` is an environment variable that would correspond to the
|
||||
``./configure --prefix=$OPENALDIR`` used in building OpenAL.
|
||||
|
||||
Created by Eric Wing. This was influenced by the ``FindSDL.cmake``
|
||||
module.
|
||||
#]=======================================================================]
|
||||
|
||||
# Modifed for FlightGear by James Turner
|
||||
# We want to use the 'parented' directories here, unlike the standard CMake version
|
||||
# of this.
|
||||
|
||||
if (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
|
||||
# already set, do nothing
|
||||
else()
|
||||
find_path(OPENAL_INCLUDE_DIR OpenAL/al.h AL/al.h
|
||||
HINTS
|
||||
ENV OPENALDIR
|
||||
PATH_SUFFIXES include
|
||||
PATHS
|
||||
/opt
|
||||
)
|
||||
|
||||
find_library(OPENAL_LIBRARY
|
||||
NAMES OpenAL al openal OpenAL32
|
||||
HINTS
|
||||
ENV OPENALDIR
|
||||
PATH_SUFFIXES libx32 lib64 lib libs64 libs
|
||||
PATHS
|
||||
/opt
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
|
||||
endif()
|
|
@ -1,7 +1,5 @@
|
|||
set(name fgcom)
|
||||
|
||||
find_package(OpenAL REQUIRED)
|
||||
|
||||
# Copy positions.txt content in const char* _positionsData[];
|
||||
file(READ utils/positions.txt POSITIONS_DATA)
|
||||
string(REGEX REPLACE "\n" "\"%
|
||||
|
|
Loading…
Add table
Reference in a new issue