On 04.09.2019 11:55, Edoardo Pasca wrote:
What I do is let CMake handle this
itself by defining a (list) variable for the configure command:
set(cmd
"${CMAKE_BINARY_DIR}/configure")
list(APPEND cmd
"CPPFLAGS=-I/dir/include -L/dir/lib")
ExternalProject_Add(...
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E
env ${cmd}
...)
Since cmd is a list, CMake knows that
the -L/dir/lib belongs to the CPPFLAGS=-I/dir/include part, and
puts double quotes around the entire thing, e.g. the actual
command line will look something like this:
<xxx>/configure "CPPFLAG=-Idir/include -L/dir/lib" This works with GNU autoconf. I've
found that in general, dealing with quoting in ExternalProject_Add
is a gigantic pain, so if the method above is not sufficient, I
use configure_file or file(WRITE) to generate a shell script
(Linux) or batch file (Windows) with the correct parameters and
call that instead.
With kind regards, Dr. Eric Dönges
MVTec Software
GmbH | Arnulfstr. 205 | 80634 Munich | Germany Sign up for our MVTec Newsletter! Geschäftsführer:
Dr. Wolfgang Eckstein, Dr. Olaf Munkelt
|
-- 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