-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cannot cmake --install since 10.0.0 #3489
Comments
I am not sure what might be causing this but if it worked previously I recommend bisecting to the change that introduced a problem. |
@vitaut Thanks, I am doing that now. Will let you know what I find. Any ideas in the meantime are appreciated... |
@vitaut Finally had time to run a full bisect. The first commit where this behavior appears is ae25f79. I am currently on ce93a66, and am able to It appears that the first of the two referenced commits set the |
Here is a patch that fixes the bug for me. I have simply created an auxiliary list for public headers, where I have turned each relative path into an absolute one. Verified to work with the first broken commit as well with the latest HEAD. diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2ea8ef5..cc740c45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,9 +250,12 @@ target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} PUBLIC
set(FMT_DEBUG_POSTFIX d CACHE STRING "Debug library postfix.")
+set(FMT_ABS_HEADERS "${FMT_HEADERS}")
+list(TRANSFORM FMT_ABS_HEADERS PREPEND ${PROJECT_SOURCE_DIR}/)
+
set_target_properties(fmt PROPERTIES
VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
- PUBLIC_HEADER "${FMT_HEADERS}"
+ PUBLIC_HEADER "${FMT_ABS_HEADERS}"
DEBUG_POSTFIX "${FMT_DEBUG_POSTFIX}")
# Set FMT_LIB_NAME for pkg-config fmt.pc. We cannot use the OUTPUT_NAME target |
One last note: |
I think we should revert ae25f79 because it's not even clear what value it brings. A PR to do it will be welcome. |
Ever since I upgraded to 10.0.0 I am experiencing issues running cmake install on my project. This appears in 10.0.0 as well as 8732ad8 (latest master), so I thought I would be a good idea to bring to your attention. Full disclosure, I am uncertain whether this is a bug on my end or yours -- one reason that leads me to believe this is of concern upstream is that my usage of fmtlib is conventional, so there are not really that many issues where things could be going wrong
I include fmtlib in my project as a git submodule, using the following directory tree:
Then wire it up in cmake like so:
CMakeLists.txt
includeslib/CMakeLists.txt
lib/CMakeLists.txt
setsFMT_SHARED=ON
lib/CMakeLists.txt
includeslib/fmt/CMakeLists.txt
CMakeLists.txt
does its thinglib/CMakeLists.txt
specifiesinstall(TARGETS fmt)
, so that the built version of fmtlib is shipped with the rest of my project.At compilation- and runtime, everything works as expected. The issue appears when I attempt to install the project. I see the following message:
I see the same result on all Linux distributions (in CI we use Fedora, Ubuntu, Debian mostly), but not on macOS nor Windows. It does not matter what build type I select, I can confirm that the same behavior appears with
RelWithDebInfo
as well asRelease
.The error message is correct in that the file
<path to repo redacted>/lib/include/fmt/args.h
truly does not exist. Instead, I suppose cmake should be looking for<path to repo redacted>/lib/fmt/include/fmt/args.h
instead. Is there any reason for why wouldlib/fmt
be reduced to justlib/
in the installation path like this?I am of course happy to run any tests locally and report back. Thank you for any advice you can provide!
The text was updated successfully, but these errors were encountered: