question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cmake generator produces invalid conanbuildinfo.cmake when there are multiple CPPFLAGS

See original GitHub issue

I have a package (GoogleTest) that is passing more than one flag to its consumers via cpp_info.cppflags. In the generated conanbuildinfo.cmake, the line set(CONAN_CXX_FLAGS_GOOGLETEST "-DGTEST_USE_OWN_TR1_TUPLE=1 -DGTEST_LINKED_AS_SHARED_LIBRARY=1") causes CMake to issue a compilation command of the form:

/longest_path/c++    -isystem /longer_path/include  -stdlib=libc++ -O3 -DNDEBUG -fPIE   "-Wall -Werror -DGTEST_USE_OWN_TR1_TUPLE=1 -DGTEST_LINKED_AS_SHARED_LIBRARY=1" -std=c++11 -o CMakeFiles/main.dir/main.cpp.o -c /long_path/main.cpp

It looks like the CMakeFiles/main.dir/flags.make file contains:

CXX_FLAGS =  -stdlib=libc++ -O3 -DNDEBUG -fPIE   "-Wall -Werror -DGTEST_USE_OWN_TR1_TUPLE=1 -DGTEST_LINKED_AS_SHARED_LIBRARY=1" -std=c++11

I believe the fix is to remove the double quotes from the generated CMake set command.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
kent-at-multiscalecommented, Feb 28, 2017

Acknowledged, revert it and fix everybody else. When (or if) I reproduce it again I’ll provide functioning code.

0reactions
memshardedcommented, Mar 22, 2017

Excellent! Thanks to you for reporting, tracking and testing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conan Documentation
They do not build nor create the packages. ... This generator creates a conanbuildinfo.cmake file that defines CMake variables including.
Read more >
cmake-generator-expressions(7)
Generator expressions are evaluated during build system generation to produce information specific to each build configuration. They have the form $<...> .
Read more >
Cmake deps conan
Many developer SDKs and libraries set their own environment variables . ... A conan generator to make python dependencies available to cmake CMake...
Read more >
Using Conan and cross-compile to EV3
The generators could be for example cmake,make,visual studio,scons,qmake and many more, there is even a markdown generator that generates ...
Read more >
conan Changelog - pyup.io
Fix: CMakeDeps now generates CMake variables as `XXX_INCLUDE_DIR` in the ... Bugfix: Fix case where CMakeDeps generator may use the wrong dependency name ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found