-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: Cleanup and finding LibOVR, OpenAL, SDL2
- Loading branch information
Showing
14 changed files
with
113 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# The Doomsday Engine Project | ||
# Copyright (c) 2015 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
|
||
cmake_minimum_required (VERSION 3.0) | ||
project (DENG_OPENAL) | ||
include (CheckIncludeFile) | ||
include (../PluginConfig.cmake) | ||
|
||
find_package (OpenAL QUIET) | ||
|
||
if (OPENAL_FOUND) | ||
# Check if the headers are in a plain folder. | ||
set (CMAKE_REQUIRED_INCLUDES ${OPENAL_INCLUDE_DIR}) | ||
check_include_file (al.h HAVE_AL_H) | ||
if (HAVE_AL_H) | ||
add_definitions (-DHAVE_AL_H) | ||
endif () | ||
|
||
append (CMAKE_CXX_FLAGS_DEBUG "-DDENG_DSOPENAL_DEBUG") | ||
|
||
include_directories (include) | ||
include_directories (SYSTEM ${OPENAL_INCLUDE_DIR}) | ||
|
||
file (GLOB SOURCES src/*.cpp include/*.h) | ||
deng_add_plugin (audio_openal ${SOURCES}) | ||
target_link_libraries (audio_openal PRIVATE ${OPENAL_LIBRARY}) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set (LIBOVR_DIR "LibOVR" CACHE PATH "Location of the LibOVR library (from Oculus SDK)") | ||
|
||
if (NOT LIBOVR_FOUND) | ||
get_filename_component (fullPath "${LIBOVR_DIR}" ABSOLUTE) | ||
if (EXISTS "${fullPath}/Include") | ||
set (LIBOVR_FOUND YES CACHE BOOL "LibOVR found") | ||
mark_as_advanced (LIBOVR_FOUND) | ||
message (STATUS "Found LibOVR: ${LIBOVR_DIR}") | ||
endif () | ||
endif () | ||
|
||
if (LIBOVR_FOUND AND NOT TARGET LibOVR) | ||
add_library (LibOVR INTERFACE) | ||
target_include_directories (LibOVR INTERFACE "${LIBOVR_DIR}/Include" "${LIBOVR_DIR}/Src") | ||
target_compile_definitions (LibOVR INTERFACE -DDENG_HAVE_OCULUS_API) | ||
if (APPLE) | ||
target_link_libraries (LibOVR INTERFACE | ||
debug "${LIBOVR_DIR}/Lib/Mac/Debug/libovr.a" | ||
optimized "${LIBOVR_DIR}/Lib/Mac/Release/libovr.a" | ||
) | ||
link_framework (LibOVR INTERFACE Cocoa) | ||
link_framework (LibOVR INTERFACE IOKit) | ||
endif () | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
find_package (PkgConfig) | ||
|
||
add_pkgconfig_interface_library (SDL2 OPTIONAL sdl2) | ||
add_pkgconfig_interface_library (SDL2_mixer OPTIONAL SDL2_mixer) | ||
|
||
if (NOT TARGET SDL2) | ||
add_definitions (-DDENG_NO_SDL) | ||
endif () | ||
if (NOT TARGET SDL2_mixer) | ||
add_definitions (-DDENG_DISABLE_SDLMIXER) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters