Does not compile on macOS Catalina
I took the current source as is, tried to compile under Catalina (10.15.3), libraries from MacPorts.
Below is the output from Terminal.
The problem is that somewhere, the library libassimp.dylib.5 is referenced, which is clearly an error; it should be libassimp.5.dylib !
I don't speak enough "make" to find the place where this wrong reference comes from.
% cmake ../ -- The C compiler identification is AppleClang 11.0.0.11000033 -- The CXX compiler identification is AppleClang 11.0.0.11000033 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:6 (add_subdirectory): The source directory
/Users/zach/Downloads/SHADERed-master/libs/ShaderDebugger
does not contain a CMakeLists.txt file.
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework
-- Found GLEW: /opt/local/include (found version "2.1.0")
-- Found GLM: /opt/local/include
CMake Warning (dev) at /opt/local/lib/cmake/assimp-5.0/assimpTargets.cmake:54 (if):
if given arguments:
"ON"
An argument named "ON" appears in a conditional statement. Policy CMP0012 is not set: if() recognizes numbers and boolean constants. Run "cmake --help-policy CMP0012" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): /opt/local/lib/cmake/assimp-5.0/assimp-config.cmake:1 (include) CMakeLists.txt:147 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at /opt/local/lib/cmake/assimp-5.0/assimpTargets.cmake:85 (message): The imported target "assimp::assimp" references the file
"/opt/local/lib/libassimp.dylib.5"
but this file does not exist. Possible reasons include:
-
The file was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and contained
"/opt/local/lib/cmake/assimp-5.0/assimpTargets.cmake"
but not all the files it references.
Call Stack (most recent call first): /opt/local/lib/cmake/assimp-5.0/assimp-config.cmake:1 (include) CMakeLists.txt:147 (find_package)
-- Configuring incomplete, errors occurred!
Updated to Catalina recently and confirm those errors.
I had a somewhat similar error. Re-cloning ASSIMP library fixed it somehow. At first.
Though, make ended up with 2 fatal errors:
make error log (after re-cloning assimp):
In file included from /Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/Objects/Debug/PixelInformation.h:2:
/Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/Engine/Model.h:2:10: fatal error:
'assimp/postprocess.h' file not found
#include <assimp/postprocess.h>
^~~~~~~~~~~~~~~~~~~~~~
[ 48%] Building CXX object libs/assimp/code/CMakeFiles/assimp.dir/LWO/LWOBLoader.cpp.o
In file included from /Users/slavakomarov/CLionProjects/SHADERed/main.cpp:6:
In file included from /Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/EditorEngine.h:3:
In file included from /Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/InterfaceManager.h:3:
In file included from /Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/Objects/DebugInformation.h:2:
In file included from /Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/Objects/Debug/PixelInformation.h:2:
/Users/slavakomarov/CLionProjects/SHADERed/src/SHADERed/Engine/Model.h:2:10: fatal error:
'assimp/postprocess.h' file not found
#include <assimp/postprocess.h>
^~~~~~~~~~~~~~~~~~~~~~
cmake error log (before re-cloning assimp):
INCLUDE could not find load file:
FindPkgMacros
CMake Error at libs/assimp/CMakeLists.txt:332 (INCLUDE):
INCLUDE could not find load file:
PrecompiledHeader
CMake Error at libs/assimp/CMakeLists.txt:506 (use_pkgconfig):
Unknown CMake command "use_pkgconfig".
-- Configuring incomplete, errors occurred!
I'm new to C/C++ and CMake, but it seems to me it wasn't supposed to build in any case. libs/assimp/cmake-modules does not contain CMake scripts required to build assimp or include it into any other project like SHADERed. (the files are just missing)
Eventually, I did make it to work using FetchContent suggestion from #67. I added ASSIMP related lines. The build was a success; the app runs. Now it's time for the tutorial. Thanks!
@chernomord oops. I accidentally pushed a commit that had an error. But this should be fixed in a latest commit.
@GabZach @ashshaosh Could you please try compiling again? Just pushed a commit that might have fixed this issue (I've added assimp as a submodule, since everyone seems to have problems with it while trying to compile SHADERed).
Great! It's get compiled now. Coooool :)
@GabZach @ashshaosh Could you please try compiling again?