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

Build fails with outdated fmt installed on the system #453

Closed
ton opened this issue Mar 8, 2022 · 3 comments
Closed

Build fails with outdated fmt installed on the system #453

ton opened this issue Mar 8, 2022 · 3 comments

Comments

@ton
Copy link

ton commented Mar 8, 2022

When building from source on a machine that has an outdated version of fmt installed, the build fails for the spdlog_dependency. I suspect the problem is that for the fmt dependency, the build environment is updated with the path to the required fmt version, but the compiler will still pick up the fmt version installed on the system somehow.

The following naïve patch fixes the issue for me; but there is probably a better way to fix this.

diff --git a/third_party/fmt/CMakeLists.txt b/third_party/fmt/CMakeLists.txt
index 9a4b60f..579a2b6 100644
--- a/third_party/fmt/CMakeLists.txt
+++ b/third_party/fmt/CMakeLists.txt
@@ -33,7 +33,7 @@ else ()

     include(GNUInstallDirs)
     list(APPEND PREFIX_PATH "${DEPENDENCIES_INSTALL_PREFIX}/fmt_dependency")
-    set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};${PREFIX_PATH}
+    set(CMAKE_PREFIX_PATH ${PREFIX_PATH};${CMAKE_PREFIX_PATH}
             CACHE PATH "append fmt library into the search path"
             FORCE)
 endif ()
@rizsotto
Copy link
Owner

rizsotto commented Mar 9, 2022

Thanks @ton , can you create a PR for this? (Please also include other third party dependencies which has similar lines in the CMake file.)

@rizsotto
Copy link
Owner

fix will be on master soon.

@ton
Copy link
Author

ton commented Mar 14, 2022

Thanks, I just wanted to start a pull request but you already fixed it, great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants