make CMakeToolChain use customised initial cache file
Author: hghzbc44Created Mar 22, 2023Updated Sep 3, 2026
Labelsstage: triaging
What is your question?
Hi! I am trying to migrate from conan1 to conan2 and am having trouble understanding how to pre-load a script to populate the cmake cache.
This is how it is currently done with conans.cmake class:
cache_file = str(os.environ["CMAKE_CACHE_FILE"])
cmake = CMake(self)
cmake.configure(args=["-C", os.path.expandvars(cache_file)])I am trying to get CMakeToolChain to use the initial cache file that is shipped to us. This is how the profile looks like now:
include(linux-gcc8-x86_64)
[settings]
os=Neutrino
os.version=7.1
arch=aarch64le
compiler=qcc
compiler.version=8.3
compiler.libcxx=cxx
[options]
[build_requires]
[env]
CC=qcc
CXX=QCC
CONAN_CMAKE_GENERATOR="Unix Makefiles"
CONAN_CMAKE_TOOLCHAIN_FILE=${CONAN_USER_HOME}/.conan/cmake/toolchain/qcc8_qnx710_aarch64.cmake
CMAKE_CACHE_FILE=${CONAN_USER_HOME}/.conan/cmake/config/qnx710_aarch64le_qcc8.cmake
[conf]
tools.build:compiler_executables={"c": "qcc", "cpp": "qcc"}
tools.cmake.cmaketoolchain:user_toolchain=["/home/.conan/cmake/toolchain/qcc8_qnx710_aarch64.cmake"]Would appreciate some guidance, I got it to start using the toolchain that is shipped to us, but it is as important to use the correct cache file.
Have you read the CONTRIBUTING guide?
- I've read the CONTRIBUTING guide
Source: conan-io/conan