Hello
I am quite novice to CMake. I am trying to cross compile a project which uses OpenAL, using MinGW in my CMake file. However I am struggling to find a way to add the OpenAL headers and DLL for the target platform. I have OpenAL headers installed on my main machine (manjaro, arch based unix distro), and I also happen to have the OpenAL32.dll
file. But what I don’t know, is how to add the target system headers, and how to link the DLL. The project I’m trying to compile has an FindOpenAL.cmake
file , which has the following setup:
if (WIN32 OR MINGW)
if (OPENAL_SDK_ROOT)
set(OPENAL_SEARCH_PATHS ${OPENAL_SDK_ROOT})
else ()
if (WIN32)
file(
GLOB
OPENAL_SEARCH_PATHS
"C:/OpenAL*"
"D:/OpenAL*"
"E:/OpenAL*"
"C:/Lib*/OpenAL*"
"D:/Lib*/OpenAL*"
"E:/Lib*/OpenAL*"
)
endif ()
endif ()
find_library(
OPENAL_LIBS
NAMES
OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
ENV OPENAL_SDK_PATH
PATH_SUFFIXES
lib64 lib libs64 libs libs/Win64
PATHS
${OPENAL_SEARCH_PATHS}
REQUIRED
NO_DEFAULT_PATH
)
if (WIN32)
# find DLL
find_file(
OPENAL_DLL
NAMES
soft_oal.dll
OpenAL32.dll
HINTS
ENV OPENALDIR
ENV OPENAL_SDK_PATH
PATH_SUFFIXES
bin bin/Win64
PATHS
${OPENAL_SEARCH_PATHS}
)
endif ()
So to reiterate my Q: How would I specify the target system OpenAL headers and DLL file in this cmake?