CMake issue when building optix-toolkit SDK

Hi,

I wanted to build optix-toolkit for use in Optix-Apps but I am getting an cmake error shown below

CMake Error at D:/dev_packages/vcpkg/scripts/buildsystems/vcpkg.cmake:632 (_add_library):
  _add_library cannot create ALIAS target "OpenEXR::Config" because another
  target with the same name already exists.
Call Stack (most recent call first):
  build/_deps/openexr-src/cmake/CMakeLists.txt:166 (add_library)


CMake Error at D:/dev_packages/vcpkg/scripts/buildsystems/vcpkg.cmake:632 (_add_library):
  _add_library cannot create ALIAS target "OpenEXR::Config" because another
  target with the same name already exists.
Call Stack (most recent call first):
  build/_deps/openexr-src/cmake/CMakeLists.txt:177 (add_library)

I just ran this command after cloning - cmake -DOptiX_INSTALL_DIR=/path-to-optix/ where the path to optix SDK is specified

When I try to build openexr separately, it does buildwithout any issues. Am I missing something here? It would be helpful if I can clear this issue.

Hello.

Can we get some information about your setup: windows version, cmake version. Also, looks like you are using a vcpkg toolchain with cmake. Can you try building without vcpkg?

Thanks

Hey Keith,

I’m using Windows 11 with CMake 3.23. Usage of vcpkg was actually the issue. When I remove the env variable of CMAKE_TOOLCHAIN_FILE pointing to vcpkg.cmake, it builds fine. Thank you for the help

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.