[CMake] ExternalProject_Add with flexible install commands

David Cole DLRdave at aol.com
Thu Feb 25 11:57:02 EST 2016


Do you need to do it indirectly through a variable like this?

If you just use:
  INSTALL_COMMAND ""

directly in the ExternalProject_Add call, it will work.

If you really need to do it indirectly, there's probably a way, but it
will also probably be more confusing for people reading the code in
the future. Not sure it's worth that trade-off. You could always
"cheat" and execute a no-op command for the install step rather than
"skipping" it. i.e. INSTALL_COMMAND ${CMAKE_COMMAND} -E echo
NoInstallStep ...


HTH,
David C.




On Thu, Feb 25, 2016 at 11:03 AM, Knox, Kent <Kent.Knox at amd.com> wrote:
> Hi Petr~
>
> Thanks for your reply.
>
>
> These set statements do not appear to work.  Either the command 'installs'
> the dependency, or an error pops up.
>
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
> --> this installs the dependency
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
> --> /bin/sh: 1:  : not found
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
> --> CMake Warning (dev) in CMakeLists.txt
> --> Argument not separated from preceding token by whitespace.
>
> Kent
>
> ________________________________
> From: Petr Kmoch <petr.kmoch at gmail.com>
> Sent: Thursday, February 25, 2016 2:46 AM
> To: Knox, Kent
> Cc: cmake at cmake.org
> Subject: Re: [CMake] ExternalProject_Add with flexible install commands
>
> 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
>
>
> --
>
> 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


More information about the CMake mailing list