Skip to content

Improved cmake configs for Windows and Linux. - #2161

Merged
kimkulling merged 2 commits into
assimp:masterfrom
dormon:master
Oct 4, 2018
Merged

kimkulling merged 2 commits into
assimp:masterfrom
dormon:master

Conversation

@dormon

@dormon dormon commented Sep 30, 2018

Copy link
Copy Markdown
Contributor

Now the configs follows the standard cmake-package code: see https://cmake.org/cmake/help/v3.12/manual/cmake-packages.7.html

Downstreamer no longer have to manually specify target_include_directories with ${ASSIMP_INCLUDE_DIRS}, target_link_libraries with ${ASSIMP_LIBRARY_DIRS} and so on.

Downstreamer can now use:
find_package(assimp CONFIG REQUIRED)
target_link_libraries(AWESOME_APP PUBLIC assimp::assimp)
and everything should work.

Added assimpTargets.cmake.in
Added assimpTargets-debug.cmake.in
Added assimpTargets-release.cmake.in
Modified CMakeLists.txt
Modified code/CMakeLists.txt - added ALIAS assimp::assimp

Tested on Ubuntu 18.04 and Windows 10

I created this change using newer version of CMake by commands:

  1. export(EXPORT ...)
  2. include(CMakePackageConfigHelpers)
    write_basic_package_version_file(...)
    and then backported it to the old version of CMake - ie. created *.in files with generated content

dormon and others added 2 commits September 30, 2018 17:18
Now the configs follows the standard cmake-package code: see https://cmake.org/cmake/help/v3.12/manual/cmake-packages.7.html

Downstreamer no longer have to manually specify target_include_directories with ${ASSIMP_INCLUDE_DIRS}, target_link_libraries with ${ASSIMP_LIBRARY_DIRS} and so on.

Downstreamer can now use:
find_package(assimp CONFIG REQUIRED)
target_link_libraries(AWESOME_APP PUBLIC assimp::assimp)
and everything should work.

Added assimpTargets.cmake.in
Added assimpTargets-debug.cmake.in
Added assimpTargets-release.cmake.in
Modified CMakeLists.txt
Modified code/CMakeLists.txt - added ALIAS assimp::assimp

Tested on Ubuntu 18.04 and Windows 10
@kimkulling

Copy link
Copy Markdown
Member

Looks good. Why assimp-package and a release-package?

@kimkulling
kimkulling merged commit 5ebf81a into assimp:master Oct 4, 2018
@kimkulling

Copy link
Copy Markdown
Member

Merged, thanks a lot for the contribution.

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

Successfully merging this pull request may close these issues.

2 participants