bibendovsky / ltjs

LithTech Jupiter System
45 stars 13 forks source link

Cmake - cannot find OpenAL #22

Closed JohnPaulHarold closed 5 years ago

JohnPaulHarold commented 5 years ago

With the following,

PS C:\Users\$User\Code> cmake --version
cmake version 3.12.3

PS C:\Users\$User\Code> cmake .\ltjs\

I get

-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.15.26730.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.12/Modules/FindOpenAL.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  engine/runtime/sound/src/sys/s_oal/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "C:/Users/$User/Code/CMakeFiles/CMakeOutput.log".
bibendovsky commented 5 years ago

Pass locations of the headers and the library to CMake manually.

If OpenAL SDK 1.1 installed this could be like the following: cmake .\ltjs\ -D "OPENAL_INCLUDE_DIR=c:\Program Files (x86)\OpenAL 1.1 SDK\include" -D "OPENAL_LIBRARY=c:\Program Files (x86)\OpenAL 1.1 SDK\libs\Win32\OpenAL32.lib"

bibendovsky commented 5 years ago

Also, it's easier to use GUI version of CMake: cmake-gui.exe

JohnPaulHarold commented 5 years ago

A slight change to the paths passed, as that progresses, thanks. New lines added for formatting only

PS C:\Users\$User\Code> cmake .\ltjs\ 
  -DOPENAL_INCLUDE_DIR="c:\Program Files (x86)\OpenAL 1.1 SDK\include" 
  -DOPENAL_LIBRARY="c:\Program Files (x86)\OpenAL 1.1 SDK\libs\Win32\OpenAL32.lib"

However, next complaint is about not finding ffmpeg. Continue this here, or raise a new ticket about ffmpeg? The same ffmpeg issue happens via CLI or gui.

bibendovsky commented 5 years ago

For FFmpeg there are two variables: LTJS_FFMPEG_INCLUDE_DIR - directory with headers. LTJS_FFMPEG_LIBRARY_DIR - directory with libraries.

Library names expected in Windows format (i.e. avcodec.lib, not libavcodec.a).

JohnPaulHarold commented 5 years ago

Yes, so I've got the (w32) dev build of ffmpeg for windows, downloaded from here https://ffmpeg.zeranoe.com/builds/ I've pointed the two LTJS_FFMPEG_* vars at the correct folders (both cli and gui), but it seems that ffmpeg isn't found.

Failed to detect FFmpeg version.

*** FFmpeg not found ***

CMake Error at CMake/FindLTJS_FFmpeg.cmake:166 (message):
Call Stack (most recent call first):
  engine/runtime/sound/src/sys/s_oal/CMakeLists.txt:5 (find_package)

-- Configuring incomplete, errors occurred!

w32 ffmpeg is on my PATH and returns this as a version

PS C:\Users\$User\Code> ffmpeg -version
ffmpeg version N-92273-g59a35fe1f6 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20181017
configuration: --enable-gpl  ... a lot more enables ...
libavutil      56. 20.100 / 56. 20.100
libavcodec     58. 34.100 / 58. 34.100
libavformat    58. 19.102 / 58. 19.102
libavdevice    58.  4.106 / 58.  4.106
libavfilter     7. 38.100 /  7. 38.100
libswscale      5.  2.100 /  5.  2.100
libswresample   3.  2.100 /  3.  2.100
libpostproc    55.  2.100 / 55.  2.100
bibendovsky commented 5 years ago

Custom CMake module checks for FFmpeg version by parsing "libavutil/ffversion.h". Version string should be like this: #define FFMPEG_VERSION "4.0" I think you downloaded a nightly build not a release one from that site you mentioned.

JohnPaulHarold commented 5 years ago

Thanks, fixed. Closing.