-
Notifications
You must be signed in to change notification settings - Fork 81
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
Duplicate project name directories in installation include directory #43
Comments
This is a very conscious decision, because it solves an issue described here: Dobiasd/FunctionalPlus#222 As a CMake user, you are unaffected by this extra directory in the path for the includes, because the exported CMake package is very much aware of it. Of course, something like this is entirely avoided when using Conan and vcpkg, because those do things in locations where you know you won't accidentally include something you aren't supposed to. |
Very informative! Thank you for the reference! |
…kflow (#155) Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com>
Hello, is it intentional to duplicate the project name in the installation layout for the headers?
I see the following when installing the shared/static library (initialized with
cmake-init -s /tmp/test-shared
) example:Note the line here with duplicate
test-shared/test-shared/
directoriesI would have expected it to read
which is a more compact directory layout while still maintaining directory isolation of the project headers.
I realize I can manually set
-DCMAKE_INSTALL_INCLUDEDIR=include
when configuring, but I think the expected behavior should be default for this initializer project.I also realize that
test-sharedTargets.cmake
contains the followingwhich means that an
#include <test-shared/test-shared.hpp>
still works from a CMake project that finds the library and uses the target with the duplicate project name directories in theinclude
directory, but I still would have expected theinclude
directory layout of the installation to be more compact by default, which would then make this snippet readINTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
.I believe the line(s) responsible for directory duplication are here and removal would produce the expected directory layout by default
cmake-init/cmake-init/templates/common/cmake/install-rules.cmake
Lines 1 to 3 in 44b8e24
Unrelated: I'm not sure whether this kind of post belongs in the
Issues
orDiscussions
section, so apologies if this is posted in the wrong spot.The text was updated successfully, but these errors were encountered: