How to configure/hack cmake to build particular executable added with add_executable() but do not install it?
The executable is a unit test and will eventually be handled with add_test but for now I just want to strip test binaries off the release touching as little as possible.
Thanks
CMake will only install an executable target if you apply the
installfunction to it, i.e.:To prevent the installation of the
ExecutableTestfor aReleasebuild, add aCONFIGURATIONSrestriction:Alternatively, you can make
ExecutableTestan optional target, which is not built by default:and then optionally only install the
ExecutableTestif it has been built explicitly:All optional test targets can be pooled in a super target to allow for building them in one step: