With CMake I use add_subdirectory(gtest) to build gtest for testing my project. I also use CPack to make an installer.
The problem is the gtest repo (which is a git submodule) runs install() on some files so they end up in my installer! Obviously I don't want that. Is there a way to disable install() commands for a given subdirectory without just removing them from the CMakeLists?
You can use this to prevent Google Test from being installed:
add_directory(gtest EXCLUDE_FROM_ALL)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With