-
Notifications
You must be signed in to change notification settings - Fork 330
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
Add CMake option to disable installing #239
Comments
Can you explain further what you wish to achieve ? i happen to be building this without having to "install" anything anywhere. just use the add_subdirectory CMAKE directive to add the project and then link against it by using #....blabla your code here
add_subdirectory(relative/path/to/OpenXLSX)
#.....blabla your code here
add_executable(your_exe ${YOUR_EXE_SOURCES})
target_link_libraries(your_exe PRIVATE OpenXLSX::OpenXLSX) cmake magic will take care of the rest or have i misunderstood what you wish to achieve ? |
I am doing the same as what you descirbe above with the addition of So I am proposing that OpenXLSX adds something like Many libraries do the same thing. For example take a look at GTest's |
Yeah, i can see many cases where that might be needed . If you are interested , i currently tested with a rather small, private project and it appears using the EXCLUDE_FROM_ALL might achieve exactly what you want by excluding OpenXLSXs own install targets and only linking against it (tested with CMAKE 3.16.3) .This is , In case the requested option was never integrated in the project. add_subdirectory(relative/path/to/OpenXLSX EXCLUDE_FROM_ALL) Source : https://cmake.cmake.narkive.com/WKIKLMMB/disabling-install-target-for-subdirectory |
I'll give that a try, thanks. |
It would be nice to have an option like "OPENXLSX_ENABLE_INSTALL" that allows projects using this as subroject to avoid having the headers and static libs installed.
The text was updated successfully, but these errors were encountered: