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 `` to set the path to file > containing overrides, this must be set before calling ``project()``
> I'm not sure if this is really the correct route to go down though for > your use case. That wouldn't be impossible. A more generic way to achieve what you did, one that doesn't require patching "client" CMake files (which I find unacceptable): Store the customised settings in a file (I'd call it cmake.initcache) and call cmake as %> cmake -C./cmake.initcache "$@" This is an approach I follow with a more basic building workflow of my own, one where I keep localised/customised settings (CC/CXX, CFLAGS/CXXFLAGS, LDFLAGS etc) in a ./wconfigure.env file, which is parsed by wrappers to configure and cmake. It's not a usual approach for MacPorts, though. R. -- 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: http://public.kitware.com/mailman/listinfo/cmake