CONAN_EXPORTED variable in CMake
See original GitHub issueAcording to the docs: http://docs.conan.io/en/latest/changelog.html?highlight=conan_exported
the CMake variable CONAN_EXPORT
should be set when running conan create
, and not set when running conan build
.
The documentation is actually non existant for this variable and the only mention is in the changelog, saying on version 0.19.0
:
Feature: new cmake CONAN_EXPORTED variable, can be used in CMakeLists.txt to differentiate building in the local conan cache as package and building in user space
From my tests I see that the variable is set in both scenarios. I’ve tested this with Conan 1.0.4. Please let me know if I’m using this wrong.
I’m testing it like this:
if(CONAN_EXPORTED) # set when running "conan build"
message("=================================== CONAN_EXPORT is set: ${CONAN_EXPORT}")
else()
message("=================================== CONAN_EXPORT is not set: ${CONAN_EXPORT}")
endif()
In both scenarios the output is:
=================================== CONAN_EXPORT is set:
To help us debug your issue please explain:
- I’ve read the CONTRIBUTING guide.
- I’ve specified the Conan version, operating system version and any tool that can be relevant.
- I’ve explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
cmake — conan 1.53.0 documentation
It generates a file named conanbuildinfo.cmake and declares some variables and methods. Variables in conanbuildinfo.cmake¶. Package declared variables: For each ...
Read more >cmake-variables(7) — CMake 3.25.1 Documentation
This page documents variables that are provided by CMake or have meaning to CMake when set by project code. For general information on...
Read more >set — CMake 3.25.1 Documentation
Set a normal, cache, or environment variable to a given value. See the cmake-language(7) variables documentation for the scopes and interaction of normal ......
Read more >CMAKE_<LANG>_COMPILER — CMake 3.25.1 Documentation
The full path to the compiler for LANG . This is the command that will be used as the <LANG> compiler. Once set,...
Read more >if — CMake 3.25.1 Documentation
Named boolean constants are case-insensitive. If the argument is not one of these specific constants, it is treated as a variable or string...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, that is the differentiation I wanted to make. I can now set a variable myself, now that I know of
conanfile.in_local_cache
. I’ll test this one now.Maybe we could create a new variable in CMake to follow the
conanfile.in_local_cache
. Is that the differentiation you want to make?http://docs.conan.io/en/latest/reference/conanfile/attributes.html?highlight=in_local_cache#in-local-cache