You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Visual Studio, all cmake projects build in %userprofile%\CMakeBuilds.
When using Assimp as a dependency, it's useful to have it in a git submodule. However, because config.h gets generated at compile time, and is not inserted into the source directory, any program using Assimp will fail to compile, because of the missing include.
The obvious solution would be to build Assimp in the source tree, but depending on the environment (e.g. Visual Studio) this is not always possible.
The text was updated successfully, but these errors were encountered:
This is kind of a repeat of #1566
You can get around it by including the build version of the assimp directory in the include directories for your project.
For future reference, anyone who has a similar situation like I do, if assimp is in the assimp directory of your source tree, the following cmake snippet should work:
find_package(assimp 4.1 QUIET)
if (NOT assimp_FOUND)
message(STATUS "Assimp not installed. Compiling from source.")
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF)
add_subdirectory ("assimp")
set(assimp_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assimp/include/""${CMAKE_CURRENT_BINARY_DIR}/assimp/include/")
endif (NOT assimp_FOUND)
Assimp generates
config.h
fromconfig.h.in
at compile time. When building cmake out of the source tree, this meansconfig.h
does not end up in theinclude/assimp
directory at all.On Visual Studio, all cmake projects build in
%userprofile%\CMakeBuilds
.When using Assimp as a dependency, it's useful to have it in a git submodule. However, because
config.h
gets generated at compile time, and is not inserted into the source directory, any program using Assimp will fail to compile, because of the missing include.The obvious solution would be to build Assimp in the source tree, but depending on the environment (e.g. Visual Studio) this is not always possible.
The text was updated successfully, but these errors were encountered: