pytorch/cmake/public
Sacha 3027e783b1 Fix multi-configuration on Windows CMake (CUDA) (#18548)
Summary:
Multiple configurations is the default (eg. Release;Debug) on Windows and this check always broke this configuration as CMAKE_BUILD_TYPE was not set. The workaround was to always set CMAKE_BUILD_TYPE to Debug or Release, which was very unfortunate.

The correct method is to use generator expressions that expand depending on the current CONFIG being processed.

Side note: Anywhere else CMAKE_BUILD_TYPE is checked should probably be fixed too.
Note that the CMakeLists.txt forces it in to Release mode. However, I came across this error when importing the prebuilt Config in to another project, where CMAKE_BUILD_TYPE was not set.

> 3>CMake Error at pre_built/pytorch-1.0.1/share/cmake/Caffe2/public/cuda.cmake:380 (message):
> 3>  Unknown cmake build type:

Proper support for configurations would mean we can build debug and release at the same time and as you can see, it is less CMake code.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18548

Differential Revision: D14730790

Pulled By: ezyang

fbshipit-source-id: 70ae16832870d742c577c34a50ec7564c3da0afb
2019-04-02 13:19:07 -07:00
..
cuda.cmake Fix multi-configuration on Windows CMake (CUDA) (#18548) 2019-04-02 13:19:07 -07:00
gflags.cmake Fix public protobuf interface (#1961) 2018-02-21 00:39:00 -05:00
glog.cmake Caffe2 module update: move observers as well as binaries. (#2145) 2018-03-06 14:45:21 -08:00
LoadHIP.cmake Support all ROCm supported uarchs simultaneously: gfx803, gfx900, gfx906 (#17367) 2019-02-26 11:54:07 -08:00
mkl.cmake defer resolution of mkl to a cmake wrapper library (#11298) 2018-09-06 09:10:39 -07:00
mkldnn.cmake build with mkl-dnn by default (#13303) 2018-11-08 11:18:27 -08:00
protobuf.cmake Remove more protobuf APIs. (#2348) 2018-03-21 10:29:45 -07:00
threads.cmake Stop propagating std flags to downstream gcc/nvcc (#10098) 2018-08-06 15:30:27 -07:00
utils.cmake Pass WERROR to CMake as an explicit parameter rather than an env var. 2019-01-28 20:57:18 -08:00