On 08/25/2011 06:05 PM, Jed Brown wrote: > $ cmake .. '-DCMAKE_C_COMPILER:FILEPATH=mpicc' '-DCMAKE_C_FLAGS:STRING= > -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas' > [no problems] > $ grep CMAKE_C_FLAGS:STRING CMakeCache.txt > CMAKE_C_FLAGS:STRING= -Wall -Wwrite-strings -Wno-strict-aliasing > -Wno-unknown-pragmas > $ cmake .. > [no problems] > $ grep CMAKE_C_FLAGS:STRING CMakeCache.txt > CMAKE_C_FLAGS:STRING= -Wall -Wwrite-strings -Wno-strict-aliasing > -Wno-unknown-pragmas > $ cmake .. '-DCMAKE_C_FLAGS:STRING= -Wall -Wwrite-strings > -Wno-strict-aliasing -Wno-unknown-pragmas' > $ grep CMAKE_C_FLAGS:STRING CMakeCache.txt > CMAKE_C_FLAGS:STRING= -Wall -Wwrite-strings -Wno-strict-aliasing > -Wno-unknown-pragmas > $ cmake .. '-DCMAKE_C_COMPILER:FILEPATH=mpicc' '-DCMAKE_C_FLAGS:STRING= > -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas' > -- Configuring done > You have changed variables that require your cache to be deleted. > Configure will be re-run and you may have to reset some variables. > The following variables have changed: > CMAKE_C_COMPILER= mpicc > [...] > $ grep CMAKE_C_FLAGS:STRING CMakeCache.txt > CMAKE_C_FLAGS:STRING= > > > In this last case, I would expect CMAKE_C_FLAGS to be the value I set it to. > I even thought that worked with cmake versions prior to 1.8.5, but I could > be mistaken.
See [1-3] and additionally [4]. > Is there a way to reset both CMAKE_C_COMPILER and CMAKE_C_FLAGS in the same > invocation, without just deleting CMakeCache.txt? No, there isn't, AFAIK, and until 9980 is resolved, my recommendation is the same as in [5,6]: Use one dedicated build tree per toolchain from the first, don't change the toolchain after the build tree's initial configuration and use the -C option if you have numerous settings usually done via -D on the command line. Regards Michael [1] http://www.mail-archive.com/[email protected]/msg37403.html [2] http://www.mail-archive.com/[email protected]/msg37060.html [3] http://www.mail-archive.com/[email protected]/msg34486.html [4] http://public.kitware.com/Bug/view.php?id=9980 [5] http://www.mail-archive.com/[email protected]/msg37458.html [6] http://www.mail-archive.com/[email protected]/msg37079.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
