Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add_subdirectory() without installing anything [duplicate]

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?

like image 330
Timmmm Avatar asked Feb 08 '17 16:02

Timmmm


1 Answers

You can use this to prevent Google Test from being installed:

add_directory(gtest EXCLUDE_FROM_ALL)
like image 75
rdb Avatar answered Oct 15 '22 07:10

rdb