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 <[email protected]> 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
--

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

Reply via email to