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

cmake --install should only install raven, not dependent libraries #78

Open
jminor opened this issue Oct 10, 2024 · 1 comment
Open
Labels
help wanted Extra attention is needed

Comments

@jminor
Copy link
Member

jminor commented Oct 10, 2024

If you run cmake --install . after building raven, it installs the raven executable, and all the dependent libraries in /usr/local/ even though we statically link those libraries into the raven executable. Instead, only the executable should be installed.

Example:

~/git/raven/build ⭐ sudo cmake --install .
Password:
-- Install configuration: "Release"
-- Installing: /usr/local/bin/raven
-- Installing: /usr/local/include/Imath/ImathConfig.h
-- Installing: /usr/local/lib/pkgconfig/Imath.pc
-- Installing: /usr/local/lib/cmake/Imath/ImathConfig.cmake
-- Installing: /usr/local/lib/cmake/Imath/ImathConfigVersion.cmake
-- Old export file "/usr/local/lib/cmake/Imath/ImathTargets.cmake" will be replaced.  Removing files [/usr/local/lib/cmake/Imath/ImathTargets-debug.cmake, /usr/local/lib/cmake/Imath/ImathTargets-release.cmake].
-- Installing: /usr/local/lib/cmake/Imath/ImathTargets.cmake
-- Installing: /usr/local/lib/cmake/Imath/ImathTargets-release.cmake
-- Installing: /usr/local/lib/libImath-3_2.a
-- Installing: /usr/local/include/Imath/half.h
-- Up-to-date: /usr/local/include/Imath/halfFunction.h
-- Up-to-date: /usr/local/include/Imath/halfLimits.h
-- Up-to-date: /usr/local/include/Imath/ImathBox.h
-- Up-to-date: /usr/local/include/Imath/ImathBoxAlgo.h
...etc.
@meshula
Copy link
Member

meshula commented Oct 10, 2024

Notes to an implementor: I believe the solution runs along the lines of explicitly only installing raven,

install(TARGETS raven)

and then using this flag

set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)

If it's necessary to install SOMETHING, an alternative is explicitly exclude the install step for things that shouldn't be installed, using the uninituitively named EXCLUDE_FROM_ALL option.

set_target_properties(Imath PROPERTIES EXCLUDE_FROM_ALL TRUE)

@jminor jminor added the help wanted Extra attention is needed label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants