[CMake] cmake_check_build_system is causing a rebuild at "make install"

2015-10-13 Thread John Cary
For future reference, one can determine what triggered the reconfigure by doing make install VERBOSE=1 It appears not to be enough to have configured with -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE. In our case, for reasons we have not yet figured out, the depend file for a particular .cu.o object b

Re: [CMake] C++11 flag not being added

2015-10-13 Thread Matthew S Wallace
Thanks, setting the global variable solved my issue. -Matt > On Oct 13, 2015, at 10:46 AM, Johannes Zarl-Zierl > wrote: > > Hi, > > CXX_STANDARD is a target property, not a global one. You can either set > CXX_STANDARD for every target that needs it, or set it globally by changing > the def

Re: [CMake] C++11 flag not being added

2015-10-13 Thread Johannes Zarl-Zierl
Hi, CXX_STANDARD is a target property, not a global one. You can either set CXX_STANDARD for every target that needs it, or set it globally by changing the default value. You can do the latter by setting the variable CMAKE_CXX_STANDARD before defining any target that depends on it: set(CMAKE

Re: [CMake] C++11 flag not being added

2015-10-13 Thread Petr Bena
I would also like to know this, right now I do this and it works, but it produced warnings on MSVC, so I did this nasty patch: if(WIN32) if(MINGW) SET(CMAKE_CXX_FLAGS "-mwindows -std=c++11") endif() else() SET(CMAKE_CXX_FLAGS "-std=c++11") endif() however doing just the SE

[CMake] C++11 flag not being added

2015-10-13 Thread Matthew S Wallace
I have the following two lines in my CMakeLists.txt set_property(GLOBAL PROPERTY CXX_STANDARD 11) set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED) However when compiling some of my source files, the -std=c++11 flag is not added. Just for good measure I added: target_compile_features(my_targe

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] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-13 Thread René J . V . Bertin
Dan Liew wrote: > Hi, > > >> - If not, what is the best/official way to get exact control over the >> compiler and linker options used? > > I had to do something similar recently where I didn't want > ``-DNDEBUG`` to be in any of the configurations. > > I used ``CMAKE_USER_MAKE_RULES_OVERRIDE

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-13 Thread Dan Liew
Hi, > - If not, what is the best/official way to get exact control over the compiler > and linker options used? I had to do something similar recently where I didn't want ``-DNDEBUG`` to be in any of the configurations. I used ``CMAKE_USER_MAKE_RULES_OVERRIDE `` to set the path to file contain