Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assimp generates headers at compile time #1924

Closed
Binero opened this issue Apr 27, 2018 · 2 comments
Closed

Assimp generates headers at compile time #1924

Binero opened this issue Apr 27, 2018 · 2 comments

Comments

@Binero
Copy link
Contributor

Binero commented Apr 27, 2018

Assimp generates config.h from config.h.in at compile time. When building cmake out of the source tree, this means config.h does not end up in the include/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.

@mjgalindo
Copy link

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.

@Binero
Copy link
Contributor Author

Binero commented Apr 28, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants