Created
June 6, 2021 11:55
-
-
Save vladiant/665db795dd866f188f58e5c79dc7ff40 to your computer and use it in GitHub Desktop.
CMake check project or subproject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.14 FATAL_ERROR) | |
# This is a typical pattern used by projects, to prevent | |
# their tests being built and run, if they are | |
# loaded as a sub-project | |
if(NOT DEFINED PROJECT_NAME) | |
set(NOT_SUBPROJECT ON) | |
else() | |
# turn NOT_SUBPROJECT off, in case it was already turned | |
# on in a parent scope: | |
set(NOT_SUBPROJECT OFF) | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment