I don't need to use indirection, but the reason I decided to try was to simplify my code. I could either wrap the ExternalProject_Add() call in a branch/switch or a single set() call.
I am using your 'hack' thusly: set( libxxx_inst_comm INSTALL_COMMAND ${CMAKE_COMMAND} -E echo_append ) and it's working great for me. I have no problem documenting what i'm doing in my code. Thank you for your input! K ________________________________________ From: David Cole <dlrd...@aol.com> Sent: Thursday, February 25, 2016 10:57 AM To: Knox, Kent Cc: Petr Kmoch; cmake@cmake.org Subject: Re: [CMake] ExternalProject_Add with flexible install commands 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.k...@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.km...@gmail.com> > Sent: Thursday, February 25, 2016 2:46 AM > To: Knox, Kent > Cc: cmake@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 -- 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