Are you trying to construct a BUILD_COMMAND line that looks like
CXXFLAGS=-g -02 -w && ./configure?

If so, you should be able to do that with the CMake -E env command option
like this ( Starting in CMake 3.1 ):

set(cxx_flags "-g -O2 -w")
set(command_to_run ${CMAKE_COMMAND} -E environment)
ExternalProject_Add(MyProject
   DOWNLOAD_COMMAND ""
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ${CMAKE_COMMAND} -E env CXXFLAGS=${cxx_flags}
${command_to_run}
   )


On Sat, Apr 21, 2018 at 10:39 PM, Andrew Brownsword <
andrew.e.brownsw...@gmail.com> wrote:

> I’m using the externalproject_add command to build a non-cmake project.
> To the build I am passing CXXFLAGS=value, but I cannot manage to get any
> spaces into the value no matter how I quote, use variables, use escapes,
> etc.  Searching turns up other people with the same problem and no
> particularly good solutions.  One example was to use cmake_command -E echo
> to create a wrapper script that contains the desired string, however this
> isn’t working for me either (its seems to behave as if the cmake_command
> variable is empty or undefined).  This seems WAY harder than it should be...
>
> --
>
> 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
>
-- 

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

Reply via email to