mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
CMake: Export targets so the build directory can be used directly
This commit is contained in:
parent
cb61d34185
commit
5ee66e87ac
@ -2745,6 +2745,11 @@ install(EXPORT netCDFTargets
|
||||
NAMESPACE netCDF::
|
||||
)
|
||||
|
||||
export(EXPORT netCDFTargets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/netCDFTargets.cmake"
|
||||
NAMESPACE netCDF::
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
CONFIGURE_PACKAGE_CONFIG_FILE(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/netCDFConfig.cmake.in"
|
||||
@ -2772,14 +2777,14 @@ target_include_directories(netcdf
|
||||
|
||||
# Create export configuration
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/netCDF/netCDFConfigVersion.cmake"
|
||||
netCDFConfigVersion.cmake
|
||||
VERSION ${netCDF_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/netCDF/netCDFConfigVersion.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/netCDFConfigVersion.cmake"
|
||||
DESTINATION ${ConfigPackageLocation}
|
||||
COMPONENT headers
|
||||
)
|
||||
|
@ -5,9 +5,6 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set(NetCDFVersion "@PACKAGE_VERSION@")
|
||||
set_and_check(netCDF_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
|
||||
set_and_check(netCDF_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
|
||||
set_and_check(netCDF_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
|
||||
|
||||
set(netCDF_LIBRARIES netCDF::netcdf)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user