Dear all,

I'm using ExternalProjectAdd to build an external package.

On the CONFIGURE_COMMAND I have to pass some variables to the configure
script in this form:

configure CPPFLAGS="-I/dir/include -L/dir/lib"

To do this I use

CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${CMAKE_BINARY_DIR}/configure
CPPFLAGS="-I/dir/include -L/dir/lib"

However, when cmake issues that command (you can see that with make
VERBOSE=1) it wraps the CPPFLAGS parameters with quotation marks (as below)
and the configure script fails

configure "CPPFLAGS=\"-I/dir/include -L/dir/lib\""

Below you can find a minimal CMakeLists.txt to test this.

I'd appreciate any help on how I'd remove those quotation marks.

Thanks

Edo



cmake_minimum_required(VERSION 3.9.0)

project(libACE)
include(ExternalProject)

#create a configure script
file(WRITE ${CMAKE_SOURCE_DIR}/configure
"
#! /bin/bash

echo $0 received $# parameters

for arg
do echo $arg
done
")
file(COPY ${CMAKE_SOURCE_DIR}/configure
     DESTINATION ${CMAKE_BINARY_DIR}
     FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
ExternalProject_Add(
  external_test
  GIT_REPOSITORY https://github.com/paskino/libace-conda
  GIT_TAG origin/master

  CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${CMAKE_BINARY_DIR}/configure
NVCCFLAGS="-Idir -Ldir" CPPFLAGS="-Idirc -Ldirl"

  BUILD_COMMAND ""
  INSTALL_COMMAND ""

  LOG_INSTALL 1
  BINARY_DIR ${CMAKE_BINARY_DIR}/build/
  INSTALL_DIR ${CMAKE_BINARY_DIR}/install
  STAMP_DIR ${CMAKE_BINARY_DIR}/stamp
  TMP_DIR ${CMAKE_BINARY_DIR}/tmp
  DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/download
  SOURCE_DIR ${CMAKE_BINARY_DIR}/source
)

-- 
Edo
I know you think you understand what you thought I said, but I'm not sure
you realize that what you heard is not what I meant (prob. Alan Greenspan)
:wq
-- 

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