From bc611490d909e8b63ef82f87cf696c6c9447d6e3 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Thu, 19 Oct 2023 17:45:51 +0100 Subject: [PATCH] CMake: Don't add uninstall target and CPack config if not top-level Fixes #128 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6202498..45bc5c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ ################################## #Minimum required CMake Version -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.21.0) #Project Name PROJECT(NCXX C CXX) @@ -685,4 +685,6 @@ ENDIF() ## # CPack, CMakeInstallation.cmake file. ## -INCLUDE(CMakeInstallation.cmake) +if (PROJECT_IS_TOP_LEVEL) + include(CMakeInstallation.cmake) +endif()