Re: [CMake] FindCUDA discard any previous value of CUDA_USE_STATIC_CUDA_RUNTIME

2015-10-13 Thread James Bigler
Yeah, I thought about this method yesterday, but I'm not really excited about this approach. It adds yet another variable for the configuration that doesn't really match the others. Granted the behavior of the other FindCUDA options allow setting it before the first FindCUDA invocation, so there

Re: [CMake] FindCUDA discard any previous value of CUDA_USE_STATIC_CUDA_RUNTIME

2015-10-13 Thread Thibaut Neiger
Maybe we could make the FindCUDA script check if the caller defined that variable prior to any inclusion. If the user did, then FindCUDA should respect the caller choice. Something like that would make the trick: if(NOT DEFINED CUDA_USE_STATIC_CUDA_RUNTIME_FORCED) if(DEFINED CUDA_USE_STATIC_CUDA

Re: [CMake] FindCUDA discard any previous value of CUDA_USE_STATIC_CUDA_RUNTIME

2015-10-12 Thread James Bigler
Whether you can use the static runtime is based on the toolkit found, so if you change the toolkit (checked with the CUDA_TOOLKIT_ROOT_DIR_INTERNAL variable) we need to reset all dependent values. I don't see a clean way to get this to work in the way you want. The script can't tell the differenc

[CMake] FindCUDA discard any previous value of CUDA_USE_STATIC_CUDA_RUNTIME

2015-10-06 Thread Thibaut Neiger
Hello. I am using cmake 3.3.2. The following script sets the CUDA_USE_STATIC_CUDA_RUNTIME option, then finds the CUDA package. cmake_minimum_required(VERSION 3.3) option(CUDA_USE_STATIC_CUDA_RUNTIME OFF) set(CUDA_TOOLKIT_ROOT_DIR "d:/work/CUDAToolkit") message(STATUS CUDA_USE_STATIC_CUDA_RUNTIM