Menu

Should assimp-config.cmake be installed to a directory with a name that include the assimp version?

Vinnie
2017-04-04
2017-04-04
  • Vinnie

    Vinnie - 2017-04-04

    Hi Guys

    Firstly, excellent work on assimp!

    Secondly, I've successfully build and installed assimp 3.3.1 from source, on Windows 10 with Mingw64-W64.

    I noticed that the assimp-config.cmake file is being installed to a versioned directory (as shown on line 164 of CMakeLists.txt):

    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})

    This means that my find_package() command has to look as follow:

    find_package(assimp 3.3 CONFIG REQUIRED PATH_SUFFIXES "/cmake/assimp-3.3")

    This is not horrible, but it means that when Version 3.4 of assimp is out, I (and I would guess everyone else using cmake) will have to change this path suffixes to match the new version of assimp. Since cmake has an inbuilt version and compatibility check mechanism, would it not be better to install the config file to a non-version tagged directory? I.e. change line 164 to:

    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp" COMPONENT ${LIBASSIMP-DEV_COMPONENT})

    Since there is no version suffix to the generated lib files or include directories, I can't see much benifit to version tagging the directory where the assimp-config.cmake file is installed. With the version removed, the more generic find_package() command can be used:

    find_package(assimp 3.3 CONFIG REQUIRED PATH_SUFFIXES "/cmake/assimp")

    This way developers using assimp can specify the minimum required version, and by using the assimp-config-version.cmake, the assimp developers can control the range of compatible assimp versions. With the minimum version specified, it means that developers will not have to update their build scripts unless there is an incompatibility with the new release of assimp.

    ... Or am I using this all wrong or not considering another important perspective?

    Cheers
    -Vinnie

     
  • Kim Kulling

    Kim Kulling - 2017-04-04

    Good idea, I need to think a little bit about it. I opened an issue on our github-page: https://github.com/assimp/assimp/issues/1222 .

    And thanks for all the nice words :-).

    Kimmi

     
  • Vinnie

    Vinnie - 2017-04-04

    Cheers Kimmi.

     

Log in to post a comment.