[CMake] Ignore install()

Andreas Schuh andreas.schuh.84 at googlemail.com
Mon Apr 23 19:04:46 EDT 2012


Hi Stefan,

one solution I can think about is overwriting the install() command
before you traverse into these subdirectories and restoring the
default CMake behavior afterwards, i.e., something like

# overwrite install() command with a dummy macro that is a nop
macro (install)
endmacro ()

# configure build system for external libraries
add_subdirectory(external)

# replace install macro by one which simply invokes the CMake
install() function with the given arguments
macro (install)
  _install(${ARGV})
endmacro(install)

# configure build system of project own sources including installation rules
add_subdirectory(src)

Andreas

On Wed, Apr 18, 2012 at 2:12 PM, Stefan Schindler <stefan at boxbox.org> wrote:
> Hey guys,
>
> I wonder if it's possible to ignore install() commands in projects that
> are being built using add_subdirectory().
>
> I've got a project that builds external libraries and links statically
> to them, so there's no need to install them in the final step.
>
> A workaround is to remove the files after installing, but I'd rather go
> with a "cleaner" solution.
>
> Greetings,
> Stefan.
> --
>
> 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


More information about the CMake mailing list