[CMake] ExternalProject_Add with flexible install commands
Petr Kmoch
petr.kmoch at gmail.com
Thu Feb 25 03:46:23 EST 2016
Hi Kent,
I believe it's not "empty quotes" that disables the install command, it's
the empty string. So you should not escape the quotes:
#######################
# Default behavior is to NOT install library, empty quotes should disable
install
set( libxxx_inst_comm INSTALL_COMMAND "" )
# Build the library as an external project
ExternalProject_Add( libxxx
SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
${libxxx_inst_comm}
)
#######################
Petr
On Thu, Feb 25, 2016 at 7:04 AM, Knox, Kent <Kent.Knox at amd.com> wrote:
> I am having a problem passing parameters as a variable into
> ExternalProject_Add(). I seem to be fighting syntax, i've tried many
> different variants with the set() statement
>
>
> #######################
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "\"\"" )
>
> # Build the library as an external project
> ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
> )
> #######################
>
> I get this message, which appears to be within ExternalProject_add()
> using add_custom_command. Is there a way around this?
>
> CMake Error at
> /opt/homebrew-cask/Caskroom/cmake/3.2.2/CMake.app/Contents/share/cmake-3.2/Modules/ExternalProject.cmake:1487
> (add_custom_command):
>
> COMMAND may not contain literal quotes:
>
>
> ""
>
>
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160225/5265fd9b/attachment-0001.html>
More information about the CMake
mailing list