[CMake] ExternalProject_Add: not possible to add multiple flags to configure

winfried_mb2 at xmsnet.nl winfried_mb2 at xmsnet.nl
Thu Nov 19 08:36:10 EST 2009


I'm trying to build several external libraries with the ExternalProject_Add command, among which ffmpeg.

When using the msys generator, I can't find a way to add multiple compile flags to the configure script.

The configure command should be generated like this:
configure --prefix=/some/path --extra-cflags='-mno-cygwin -mms-bitfields'

However when I specify CONFIGURE_COMMAND as follows:
CONFIGURE_COMMAND configure --prefix=${EXT_BASE_DIR}/ffmpeg/${CMAKE_BUILD_TYPE} --extra-cflags='-mno-cygwin -mms-bitfields' 
the configure command ends up in the generated makefile as follows:
configure --prefix=/c//buildtools_data/externals/EXTERNALS_1_0_0/ffmpeg/Release "--extra-cflags='-mno-cygwin" "-mms-bitfields'"

I've tried all kinds of possibilities such as:
CONFIGURE_COMMAND configure --prefix=${EXT_BASE_DIR}/ffmpeg/${CMAKE_BUILD_TYPE} "--extra-cflags='-mno-cygwin -mms-bitfields'"
CONFIGURE_COMMAND configure --prefix=${EXT_BASE_DIR}/ffmpeg/${CMAKE_BUILD_TYPE} --extra-cflags="-mno-cygwin -mms-bitfields"
CONFIGURE_COMMAND "configure --prefix=${EXT_BASE_DIR}/ffmpeg/${CMAKE_BUILD_TYPE} --extra-cflags='-mno-cygwin -mms-bitfields'"
all of which give an error during configure.

If anybody knows a way to do this, I'd be glad to hear.

regards,
W. Dobbe

ps:

The complete externalproject_add command is

ExternalProject_Add(
    ffmpeg
    PREFIX ffmpeg
    DOWNLOAD_COMMAND svn export ${SVN_3RDPARTY_URL}/ffmpeg/${FFMPEG_VERSION}/ffmpeg_${FFMPEG_VERSION}.tar.bz2 && ${CMAKE_COMMAND} -E chdir ${FFMP_PATH}/src/ffmpeg tar xvfj ../ffmpeg_${FFMPEG_VERSION}.tar.bz2 --strip-components=1
    UPDATE_COMMAND ""
    CONFIGURE_COMMAND ${FFMP_PATH}/src/ffmpeg/configure --prefix=${EXT_BASE_DIR}/ffmpeg/${CMAKE_BUILD_TYPE} --extra-cflags='-mno-cygwin -mms-bitfields' --extra-ldflags='-Wl -add-stdcall-alias' --enable-memalign-hack --target-os=mingw32 --enable-shared --disable-static 
  )

cmake called as follows:
cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release  .


More information about the CMake mailing list