On 4 November at 08:43, Eric Doenges wrote: > Welcome to the wonderful world of lists and their interaction with quoting in > CMake ! Since space is used > as a list item separator outside of double quoted strings, CMake is escaping > the space within CXX_FLAGS > to keep it as a single element within the list of arguments passed to > add_custom_command. To avoid this, > you need to turn CXX_FLAGS into a list prior to using it in > add_custom_command: > >string(REGEX REPLACE " " ";" CXX_FLAGS "${CXX_FLAGS}") > >Of course, this will not work if you want to pass a double quoted string as an >actual command line argument ...
Thank you! I'd never have worked this out for myself, though it makes perfect sense now you've explained it. Thank you for answering my other question about -fPIC -std=gnu++17 as well. -- 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