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

[BUG] Incorrect configuration using toolchain file. #648

Closed
raplonu opened this issue Jun 7, 2024 · 0 comments · Fixed by #649
Closed

[BUG] Incorrect configuration using toolchain file. #648

raplonu opened this issue Jun 7, 2024 · 0 comments · Fixed by #649

Comments

@raplonu
Copy link
Contributor

raplonu commented Jun 7, 2024

Describe the Bug

CMake allows to specify a toolchain file to, among other things, specify options.
However, setting up options in the toolchain file does not have any effect.

To Reproduce

  1. Create a conan_toolchain.cmake in the project root directory with the following content:
set(MATX_BUILD_EXAMPLES ON CACHE BOOL "")
  1. Run the following commands:
mkdir build && cd build
cmake --toolchain ../conan_toolchain.cmake ..
make -j

Expected Behavior

The project should build the examples but looking at CMakeCache.txt, MATX_BUILD_EXAMPLES is still set to OFF.

System Details

  • OS: AlmaLinux release 8.4
  • CUDA version: 12.2
  • g++ version: 11.2

Additional Context

CMake being CMake, this issue seems to depends on the relative position of the options and project in the CMakeLists.txt. When project comes first, using a toolchain file will modify the cache as expected.

AFAIK, this is undocumented.

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

Successfully merging a pull request may close this issue.

1 participant