mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Merge pull request #2776 from ZedThree/cmake-optional-uninstall-target
CMake: Don't add uninstall target and CPack config if not top-level
This commit is contained in:
commit
a5d15a5857
@ -6,9 +6,7 @@
|
||||
# Set Project Properties
|
||||
##################################
|
||||
|
||||
#Minimum required CMake Version
|
||||
cmake_minimum_required(VERSION 3.12.0)
|
||||
# CMake 3.12: Use libraries specified in CMAKE_REQUIRED_LIBRARIES for check include macros
|
||||
|
||||
#Project Name
|
||||
project(netCDF
|
||||
@ -18,6 +16,14 @@ DESCRIPTION "NetCDF is a set of software libraries and machine-independent data
|
||||
)
|
||||
set(PACKAGE "netCDF" CACHE STRING "")
|
||||
|
||||
# Backport of built-in `PROJECT_IS_TOP_LEVEL` from CMake 3.21
|
||||
if (NOT DEFINED NETCDF_IS_TOP_LEVEL)
|
||||
set(NETCDF_IS_TOP_LEVEL OFF)
|
||||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
set(NETCDF_IS_TOP_LEVEL ON)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
#####
|
||||
# Version Info:
|
||||
#
|
||||
@ -2790,5 +2796,8 @@ install(
|
||||
####
|
||||
|
||||
# CPack inclusion must come last.
|
||||
# INCLUDE(CPack)
|
||||
INCLUDE(CMakeInstallation.cmake)
|
||||
option(NETCDF_PACKAGE "Create netCDF-C package " ${NETCDF_IS_TOP_LEVEL})
|
||||
|
||||
if (NETCDF_PACKAGE)
|
||||
include(CMakeInstallation.cmake)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user