Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: Improved finding of FMOD, LibOVR; OS X plugin install names
- Loading branch information
Showing
12 changed files
with
127 additions
and
92 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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
if (NOT DEFINED AMETHYST_EXECUTABLE) | ||
find_program (AMETHYST_EXECUTABLE amethyst | ||
if (NOT DEFINED AMETHYST_COMMAND) | ||
find_program (AMETHYST_COMMAND amethyst | ||
DOC "Amethyst document processor executable" | ||
) | ||
mark_as_advanced (AMETHYST_EXECUTABLE) | ||
message (STATUS "Found Amethyst: ${AMETHYST_EXECUTABLE}") | ||
mark_as_advanced (AMETHYST_COMMAND) | ||
message (STATUS "Found Amethyst: ${AMETHYST_COMMAND}") | ||
endif () | ||
|
||
if (NOT AMETHYST_EXECUTABLE STREQUAL AMETHYST_EXECUTABLE-NOTFOUND) | ||
if (NOT AMETHYST_COMMAND STREQUAL AMETHYST_COMMAND-NOTFOUND) | ||
set (AMETHYST_FOUND YES) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
set (FMOD_DIR "FMOD Programmers API" CACHE PATH | ||
"Location of the FMOD Programmer's API SDK" | ||
set (FMOD_DIR "" CACHE PATH "Location of the FMOD Programmer's API SDK") | ||
|
||
set (_oldPath ${FMOD_FMOD_H}) | ||
|
||
find_file (FMOD_FMOD_H api/inc/fmod.h | ||
PATHS | ||
"${FMOD_DIR}" | ||
"${FMOD_DIR}/FMOD Programmers API" | ||
NO_DEFAULT_PATH | ||
) | ||
mark_as_advanced (FMOD_FMOD_H) | ||
|
||
if (NOT FMOD_FOUND) | ||
get_filename_component (fullPath "${FMOD_DIR}" ABSOLUTE) | ||
if (EXISTS "${fullPath}/api") | ||
set (FMOD_FOUND YES CACHE BOOL "FMOD SDK found") | ||
mark_as_advanced (FMOD_FOUND) | ||
message (STATUS "Found FMOD: ${FMOD_DIR}") | ||
if (NOT _oldPath STREQUAL FMOD_FMOD_H) | ||
if (FMOD_FMOD_H) | ||
message (STATUS "Looking for FMOD Ex - found") | ||
else () | ||
message (STATUS "Looking for FMOD Ex - not found") | ||
endif () | ||
endif () | ||
|
||
if (FMOD_FOUND AND NOT TARGET fmodex) | ||
if (NOT FMOD_FMOD_H STREQUAL "FMOD_FMOD_H-NOTFOUND" AND NOT TARGET fmodex) | ||
get_filename_component (fmodInc "${FMOD_FMOD_H}" DIRECTORY) | ||
get_filename_component (fmodApi "${fmodInc}" DIRECTORY) | ||
|
||
add_library (fmodex INTERFACE) | ||
target_include_directories (fmodex INTERFACE ${FMOD_DIR}/api/inc) | ||
target_include_directories (fmodex INTERFACE ${fmodInc}) | ||
if (APPLE) | ||
target_link_libraries (fmodex INTERFACE | ||
${FMOD_DIR}/api/lib/libfmodex.dylib | ||
) | ||
target_link_libraries (fmodex INTERFACE ${fmodApi}/lib/libfmodex.dylib) | ||
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 |
---|---|---|
@@ -1,24 +1,39 @@ | ||
set (LIBOVR_DIR "LibOVR" CACHE PATH "Location of the LibOVR library (from Oculus SDK)") | ||
set (LIBOVR_DIR "" CACHE PATH "Location of the LibOVR library (in the 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}") | ||
set (_oldPath ${LIBOVR_OVR_H}) | ||
|
||
find_file (LIBOVR_OVR_H Include/OVR.h | ||
PATHS | ||
"${LIBOVR_DIR}" | ||
"${LIBOVR_DIR}/LibOVR" | ||
"${LIBOVR_DIR}/OculusSDK/LibOVR" | ||
NO_DEFAULT_PATH | ||
) | ||
mark_as_advanced (LIBOVR_OVR_H) | ||
|
||
if (NOT _oldPath STREQUAL LIBOVR_OVR_H) | ||
if (LIBOVR_OVR_H) | ||
message (STATUS "Looking for LibOVR - found") | ||
else () | ||
message (STATUS "Looking for LibOVR - not found") | ||
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) | ||
if (NOT LIBOVR_OVR_H STREQUAL "LIBOVR_OVR_H-NOTFOUND") | ||
if (NOT TARGET LibOVR) | ||
get_filename_component (ovrDir "${LIBOVR_OVR_H}" DIRECTORY) | ||
get_filename_component (ovrDir "${ovrDir}" DIRECTORY) | ||
|
||
add_library (LibOVR INTERFACE) | ||
target_include_directories (LibOVR INTERFACE "${ovrDir}/Include" "${ovrDir}/Src") | ||
target_compile_definitions (LibOVR INTERFACE -DDENG_HAVE_OCULUS_API) | ||
if (APPLE) | ||
target_link_libraries (LibOVR INTERFACE | ||
debug "${ovrDir}/Lib/Mac/Debug/libovr.a" | ||
optimized "${ovrDir}/Lib/Mac/Release/libovr.a" | ||
) | ||
link_framework (LibOVR INTERFACE Cocoa) | ||
link_framework (LibOVR INTERFACE IOKit) | ||
endif () | ||
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
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