mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
CMake: Set BUILD_SHARED_LIBS
before add_library(netcdf)
This commit is contained in:
parent
3341fbddf4
commit
046846ecb4
@ -38,7 +38,17 @@ endif ()
|
||||
# The target
|
||||
################################
|
||||
|
||||
add_library(netcdf SHARED)
|
||||
##
|
||||
# Default building shared libraries.
|
||||
# BUILD_SHARED_LIBS is provided by/used by
|
||||
# CMake directly.
|
||||
##
|
||||
option(BUILD_SHARED_LIBS "Configure netCDF as a shared library." ON)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
add_library(netcdf)
|
||||
add_library(netCDF::netcdf ALIAS netcdf)
|
||||
|
||||
#####
|
||||
@ -213,16 +223,6 @@ include(GenerateExportHeader)
|
||||
# Compiler and Linker Configuration
|
||||
################################
|
||||
|
||||
##
|
||||
# Default building shared libraries.
|
||||
# BUILD_SHARED_LIBS is provided by/used by
|
||||
# CMake directly.
|
||||
##
|
||||
option(BUILD_SHARED_LIBS "Configure netCDF as a shared library." ON)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
option(NC_FIND_SHARED_LIBS "Find dynamically-built versions of dependent libraries" ${BUILD_SHARED_LIBS})
|
||||
|
||||
##
|
||||
|
Loading…
Reference in New Issue
Block a user