We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I import assimp v5.3.1 as a submodule. Then use similar cmake as below:
add_subdirectory(assimp) function(link_assimp target_name) target_link_libraries(${target_name} PRIVATE assimp) endfunction()
When I use link_assimp later, something wrong happend.
As the image showed, header file including work normally in source file but fail in the header.
I have tried to use forward declaration to avoid this, but it's hard to deal with enum type like aiTextureType.
I test all these things under win11 with visual studio toolchain in Clion.
I wonder if there is some smart tricks for fixing. Please give me some advice.
The text was updated successfully, but these errors were encountered:
The situation is just similar to this one - #4827
But the include directory should be already linked with target_link_libraries. So confusing...
Sorry, something went wrong.
Oh! I got an answer. Update the previous code like this will work:
add_library(assimp_header INTERFACE) target_include_directories(assimp_header INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/assimp/include) target_include_directories(assimp_header INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/assimp/include) function(link_assimp target_name) target_link_libraries(${target_name} PRIVATE assimp) target_link_libraries(${target_name} INTERFACE assimp_header) endfunction()
Adding INTERFACE library will help with including. I check few repo for this ( like eigen,), all of these having similar design.
I wonder maybe assimp need one either.
No branches or pull requests
I import assimp v5.3.1 as a submodule. Then use similar cmake as below:
When I use link_assimp later, something wrong happend.
As the image showed, header file including work normally in source file but fail in the header.
I have tried to use forward declaration to avoid this, but it's hard to deal with enum type like aiTextureType.
I test all these things under win11 with visual studio toolchain in Clion.
I wonder if there is some smart tricks for fixing. Please give me some advice.
The text was updated successfully, but these errors were encountered: