The CUDA_ADD_LIBRARY infrastructure is deprecated and it is understandable that it isn't aware of the toolsets since it is based on custom commands.
I recommend using the new CUDA first class language support. You can find an intro blog post on using this at: https://devblogs.nvidia.com/building-cuda-applications-cmake/ On Wed, Aug 8, 2018 at 3:58 PM Sophonet <cm...@kant.sophonet.de> wrote: > > Hi Robert, > > thanks for the hint - indeed, it somewhat solved the problems I have > mentioned. However, the CMake backend for CUDA (one of the preprocessing > steps in CUDA_ADD_LIBRARY for example) calls nvcc -M (do get dependencies), > and this command first tries to load vcvars.bat without any command line > options. Therefore, nvcc -M still sees the default toolkit and not the one > which I have specified with CMAKE_GENERATOR_TOOLSET=„version=14.11“. > > The only solution up to now is to run the vcvars.bat script from VS 2017 > before doing any cmake operations with the option "-vcvars_ver=14.11“, such > that the INCLUDE_PATH variables etc are already set to the right value before > nvcc tries to set them anew (with the wrong value). > > Any hint how this can be added to the CUDA functionality in CMake? I guess > others might stumble across this problem as well. > > Thanks, > > Sophonet > > Am 02.08.2018 um 22:50 schrieb Robert Maynard <robert.mayn...@kitware.com>: > > When initially configuring a project you can specify which toolset you > would like to use. Starting in CMake 3.12 this now also supports > specifying which patch version. You can see what the syntax looks like > at: https://cmake.org/cmake/help/v3.12/release/3.12.html#id3 > On Thu, Aug 2, 2018 at 4:12 PM Sophonet <cm...@kant.sophonet.de> wrote: > > > Hi list, > > it seems that Cuda 9.0 has problems with VS 2017 (5.5 upwards) and requires > an old toolset to be installed for successful compilation (15.4, see > https://blogs.msdn.microsoft.com/vcblog/2017/11/15/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/). > The new VS 2017 toolset have an incompatible _MSC_VER variable, among other > things. > > The link above mentions to manually revert the toolset for a solution, but I > was wondering how CMake-based projects could be configured to automatically > pick the 15.4 toolset (which has version 14.11 instead of 14.12). The CMake > documentation for toolsets is somehow sparse and only mentions toolsets with > name „v141“, which I think would apply for both. Any hints to find out (i) > what toolsets are actually available for a specific compiler or (ii) forcing > toolset 14.12 as mentioned above - without manual editing of the vcproj > project files? > > Thanks, > > Sophonet > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > https://cmake.org/mailman/listinfo/cmake > > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake