-
Notifications
You must be signed in to change notification settings - Fork 278
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
Switch from CMAKE_x_DIR to PROJECT_x_DIR, thus isolating build artefacts #2711
Switch from CMAKE_x_DIR to PROJECT_x_DIR, thus isolating build artefacts #2711
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2711 +/- ##
=======================================
Coverage 63.91% 63.91%
=======================================
Files 103 103
Lines 22313 22313
Branches 10804 10804
=======================================
Hits 14261 14261
Misses 5828 5828
Partials 2224 2224 |
Uuuuu. I see, INSTALL target got messed up. |
Yep, and the CI failures reflect this I guess. Isn't there a way to keep old behaviour when Edit: See e.g. how LibTIFF tried to do it. (I guess we also want to use |
I believe so. Technically, first two of my commits do not even touch the BINARY_DIR's. But then some additional questions arises. For example, where to put EDIT: some of the includes goes up the currently processed directory. So, |
…JECT_BINARY_DIR" This reverts commit 057ddfc.
…h for ROOT_PROJECT/include for <exiv2/exiv2.hpp>
@kmilos I believe I've managed to reduce the surface and impact only on to the include paths and CMAKE_MODULES being served. Still kind of bamboozled why the |
So, does this resolve #2707 fully now? |
Thanks a lot, it does indeed! With this PR the scenario when the libexiv2 is included using CMake's |
@Mergifyio backport 0.28.x |
✅ Backports have been created
|
Briefly on CMake specifics:
${PROJECT_BINARY_DIR}
- project specific binary directory${PROJECT_SOURCE_DIR}
- project specific root directory for the source (containing main CMakeLists.txt)${CMAKE_CURRENT_x_DIR}
- stands for source/binary directory for CMakeLists.txt currently being processed${CMAKE_x_DIR}
- "global" source directory, which may be from the parent project which includes Exiv2 by the means ofFetchContent
oradd_subdirectory
.So, introduction of ${PROJECT_SOURCE_DIR} in the libraries code-base broke a possibility to include Exiv2 as a sub-project, for example briefly mentioned here: #2707
I took maybe a bit overly aggressive approach on moving everything to the scope of the project, so adding and building Exiv2 would no longer produce build artifacts in the following manner like it used to do in <0.28:
But the following:
Does that make sense?
EDIT: reverted most of the invasiveness, in such a way that
x_BINARY_DIR
and related behavior are left unchanged, but the handling of include dirs andx_SOURCE_DIR
.