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

David Cole david.cole at kitware.com
Thu Nov 19 10:44:37 EST 2009


You could generate a script that you call that calls the configure command
the way you want it to and then execute the script as the configure
command...

I'll take a look at passing args like this and see if I can figure out a way
to get them to work. For now, the generate script approach should definitely
work for you.


HTH,
David


On Thu, Nov 19, 2009 at 8:36 AM, <winfried_mb2 at xmsnet.nl> wrote:

>
> 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  .
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091119/dfdd0b0c/attachment-0001.htm>


More information about the CMake mailing list