aja-video / libajantv2

Open-source library for AJA Video Systems desktop IO cards.
MIT License
22 stars 14 forks source link

AJA_DISABLE_NVIDIA=ON does not disable rdmawhacker #2

Closed tytan652 closed 9 months ago

tytan652 commented 10 months ago

Unlike other tools, rdmawhacker relies on CUDA but when AJA_DISABLE_NVIDIA=ON is set the tool is not skipped and CMake still tries to search for CUDA and add the target to build.

thomas43 commented 10 months ago

Hi - do you have CUDA installed on your system? If not - the rdmawhacker target should not be added to your build. See tools/rdmawhacker/CMakeLists.txt:

if (NOT CUDA_FOUND)
    message(STATUS "skipping rdmawhacker (CUDA not found)")
    return()
endif()
...

Any chance you can attach that section of your build log?

tytan652 commented 10 months ago

Hi - do you have CUDA installed on your system?

Installed or not is not the problem, the issue is that AJA_DISABLE_NVIDIA does not cover all the code using Nvidia. It still try to check for CUDA, which it should not with AJA_DISABLE_NVIDIA=ON.

paulh-aja commented 10 months ago

We can make it bail out of the CMakeLists that look for CUDA if AJA_DISABLE_NVIDIA is set to ON. However ideally the check for CUDA should bail out on its own with no error. If the CUDA finder is currently throwing an error if CUDA is missing then we should fix that too.

tytan652 commented 10 months ago

There is scenarios where someone wants to build a library without the support of another library even if the package is installed.

Here it would be building libajantv2 without Nvidia/CUDA even if it is installed, if I say to the build system to not build things related to Nvidia I assume it would avoid to search for CUDA.

paulh-aja commented 9 months ago

@tytan652 just wondering if you were able to test my fix?

tytan652 commented 9 months ago

Fixed on main branch