NVIDIA / MatX

An efficient C++17 GPU numerical computing library with Python-like syntax

Home Page:https://nvidia.github.io/MatX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Incorrect configuration using toolchain file.

raplonu opened this issue · comments

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.