cmake: option to disable install & drop curlu target when unused#12287
cmake: option to disable install & drop curlu target when unused#12287i1qh2n wants to merge 7 commits intocurl:masterfrom i1qh2n:master
curlu target when unused#12287Conversation
|
Can you add a few words about why the new |
|
It is my understanding that the |
|
Did those targets get built for you with |
|
With the default configuration on this repository: Setting I have this repository embedded in an experimental project that uses curl as a submodule. The initial example is what I am using to lock the options I need in place before recursing into this repository’s scripts. Toggling For instance, if I wanted to include this project’s tests as part of my project testing, I would conditionally switch that variable to I added the conditional BUILD_TESTING statement around |
|
Your results say that |
|
That is a miscommunication on my end, the above settings are only with the extra guards in place. With |
|
What do you mean by 'project' in this context? The reason I'm insisting is because this test: when built, does not produce a I'm looking for an example which builds |
|
I see what you are saying. By ‘project’ I am referring to visual studio project files. Even if it is not referenced in the actual build, the project file is still generated. In turn, it is loaded in the visual studio solution. By default, the ALL_BUILD project will build both it and either The purpose of this patch is to add the option to toggle off the installation projects in the generated solution. With the It allows a strict filter to only generate and include the core libraries needed to build, link and use curl. |
|
Thanks for explaining! If I got it correctly this patch does these two things:
Would you mind updating the PR message to clarify? |
Done. Thank you for your time! |
|
Thank you, LGTM! |
curlu target when unused
Before this patch `BUILD_TESTING` was used once, then initialized, then used again. This caused the `curlu` library not being built when relying on an implicit `BUILD_TESTING=ON` setting, and ending up with a link error when building the `testdeps` target. It did not cause issues when `BUILD_TESTING` was explicitly set. Move the initialization before the first use to fix it. Regression from aace27b #12287 Closes #13668
…n lib and src Based on existing code and commit history it appears `CURL_DISABLE_INSTALL` means to prevent calling `install()`; `CURL_ENABLE_EXPORT_TARGET` means to prevent calling `export()` and `install()`s with `EXPORT` in them. Fix them to also apply to the lib and src directories in that vain: - lib: honor `CURL_DISABLE_INSTALL` - src: honor `CURL_DISABLE_INSTALL` - src: honor `CURL_ENABLE_EXPORT_TARGET` https://cmake.org/cmake/help/v4.2/command/install.html https://cmake.org/cmake/help/v4.2/command/export.html - `CURL_DISABLE_INSTALL` follow-up to: aace27b #12287 - `CURL_ENABLE_EXPORT_TARGET` follow-up to: 8698825 #9638 643ec29 #7060 Closes #19144
This patch makes the following changes:
CURL_DISABLE_INSTALL- to disable 'install' targets.curluwhen the optionBUILD_TESTINGis set toOFF- to prevent it from being loaded in Visual Studio.