mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
using target_sources
This commit is contained in:
parent
237efec07e
commit
ca182c0979
@ -6,7 +6,7 @@
|
||||
# Set Project Properties
|
||||
##################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.12.0)
|
||||
cmake_minimum_required(VERSION 3.13.0)
|
||||
|
||||
#Project Name
|
||||
project(netCDF
|
||||
|
@ -6,22 +6,22 @@
|
||||
# Ed Hartnett
|
||||
|
||||
# The source files for the HDF5 dispatch layer.
|
||||
SET(libnchdf5_SOURCES nc4hdf.c nc4info.c hdf5file.c hdf5attr.c
|
||||
set(libnchdf5_SOURCES nc4hdf.c nc4info.c hdf5file.c hdf5attr.c
|
||||
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c hdf5open.c
|
||||
hdf5var.c nc4mem.c nc4memcb.c hdf5dispatch.c hdf5filter.c
|
||||
hdf5set_format_compatibility.c hdf5debug.c)
|
||||
|
||||
IF(ENABLE_BYTERANGE)
|
||||
SET(libnchdf5_SOURCES ${libnchdf5_SOURCES} H5FDhttp.c)
|
||||
ENDIF()
|
||||
if(ENABLE_BYTERANGE)
|
||||
set(libnchdf5_SOURCES ${libnchdf5_SOURCES} H5FDhttp.c)
|
||||
endif()
|
||||
|
||||
# Build the HDF5 dispatch layer as a library that will be included in
|
||||
# the netCDF library.
|
||||
add_library(netcdfhdf5 OBJECT ${libnchdf5_SOURCES})
|
||||
|
||||
IF(STATUS_PARALLEL)
|
||||
if(STATUS_PARALLEL)
|
||||
target_link_libraries(netcdfhdf5 PUBLIC MPI::MPI_C)
|
||||
ENDIF(STATUS_PARALLEL)
|
||||
endif(STATUS_PARALLEL)
|
||||
|
||||
# Remember to package this file for CMake builds.
|
||||
ADD_EXTRA_DIST(${libnchdf5_SOURCES} CMakeLists.txt)
|
||||
add_extra_dist(${libnchdf5_SOURCES} CMakeLists.txt)
|
||||
|
@ -8,6 +8,11 @@
|
||||
#####
|
||||
# Add target objects/modules based on options.
|
||||
#####
|
||||
target_sources(netcdf
|
||||
PRIVATE
|
||||
$<TARGET_OBJECTS:netcdf3>
|
||||
$<TARGET_OBJECTS:dispatch>
|
||||
)
|
||||
|
||||
if(USE_NETCDF4)
|
||||
target_sources(netcdf
|
||||
@ -75,8 +80,8 @@ if(ENABLE_PLUGINS)
|
||||
endif()
|
||||
|
||||
target_sources(netcdf
|
||||
PRIVATE
|
||||
nc_initialize.c
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nc_initialize.c
|
||||
)
|
||||
|
||||
if(STATUS_PARALLEL)
|
||||
@ -189,7 +194,7 @@ endif()
|
||||
if(NOT WIN32)
|
||||
if(NOT APPLE)
|
||||
if(CMAKE_DL_LIBS)
|
||||
TARGET_LINK_LIBRARIES(netcdf ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(netcdf ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -228,7 +233,7 @@ endif(ENABLE_SHARED_LIBRARY_VERSION)
|
||||
# for more information.
|
||||
###
|
||||
if(${CMAKE_VERSION} VERSION_LESS 2.8.12)
|
||||
INSTALL(
|
||||
install(
|
||||
TARGETS netcdf EXPORT netCDFTargets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
|
||||
@ -236,7 +241,7 @@ if(${CMAKE_VERSION} VERSION_LESS 2.8.12)
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
else()
|
||||
INSTALL(
|
||||
install(
|
||||
TARGETS netcdf EXPORT netCDFTargets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
|
||||
@ -248,6 +253,31 @@ endif()
|
||||
set(ALL_TLL_LIBS ${TLL_LIBS} PARENT_SCOPE)
|
||||
set(NC_LIBS ${NC_LIBS} PARENT_SCOPE)
|
||||
|
||||
FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||
file(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||
set(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
|
||||
ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
|
||||
|
||||
# [ 10%] Linking C shared library libnetcdf.dylib
|
||||
# /opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_link_script CMakeFiles/netcdf.dir/link.txt --verbose=1
|
||||
# /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
|
||||
# -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -Wall -Wshorten-64-to-32 -Wconversion -arch arm64
|
||||
# -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -dynamiclib -Wl,-headerpad_max_install_names
|
||||
# -shared -L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++ -compatibility_version 19.0.0 -current_version 19.0.0
|
||||
# -o libnetcdf.19.dylib -install_name @rpath/libnetcdf.19.dylib
|
||||
# CMakeFiles/netcdf.dir/liblib/nc_initialize.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4dispatch.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4attr.c.o
|
||||
# libsrc4/CMakeFiles/netcdf4.dir/nc4dim.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4grp.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4internal.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4type.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4var.c.o libsrc4/CMakeFiles/netcdf4.dir/ncfunc.c.o libsrc4/CMakeFiles/netcdf4.dir/ncindex.c.o libsrc4/CMakeFiles/netcdf4.dir/nc4cache.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/nc4hdf.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/nc4info.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5file.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5attr.c.o
|
||||
# libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5dim.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5grp.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5type.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5internal.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5create.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5open.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5var.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/nc4mem.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/nc4memcb.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5dispatch.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5filter.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5set_format_compatibility.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/hdf5debug.c.o libhdf5/CMakeFiles/netcdfhdf5.dir/H5FDhttp.c.o
|
||||
# oc2/CMakeFiles/oc2.dir/oc.c.o oc2/CMakeFiles/oc2.dir/daplex.c.o oc2/CMakeFiles/oc2.dir/dapparse.c.o oc2/CMakeFiles/oc2.dir/dapy.c.o oc2/CMakeFiles/oc2.dir/occompile.c.o oc2/CMakeFiles/oc2.dir/occurlfunctions.c.o oc2/CMakeFiles/oc2.dir/ocdata.c.o oc2/CMakeFiles/oc2.dir/ocdebug.c.o oc2/CMakeFiles/oc2.dir/ocdump.c.o oc2/CMakeFiles/oc2.dir/ocinternal.c.o oc2/CMakeFiles/oc2.dir/ocnode.c.o oc2/CMakeFiles/oc2.dir/ochttp.c.o oc2/CMakeFiles/oc2.dir/ocread.c.o oc2/CMakeFiles/oc2.dir/ocutil.c.o oc2/CMakeFiles/oc2.dir/xxdr.c.o
|
||||
# libdap2/CMakeFiles/dap2.dir/constraints.c.o libdap2/CMakeFiles/dap2.dir/dapcvt.c.o libdap2/CMakeFiles/dap2.dir/dapodom.c.o libdap2/CMakeFiles/dap2.dir/daputil.c.o libdap2/CMakeFiles/dap2.dir/ncdaperr.c.o libdap2/CMakeFiles/dap2.dir/cdf.c.o libdap2/CMakeFiles/dap2.dir/cache.c.o libdap2/CMakeFiles/dap2.dir/dapdump.c.o libdap2/CMakeFiles/dap2.dir/dapdebug.c.o libdap2/CMakeFiles/dap2.dir/dapattr.c.o libdap2/CMakeFiles/dap2.dir/ncd2dispatch.c.o libdap2/CMakeFiles/dap2.dir/getvara.c.o libdap2/CMakeFiles/dap2.dir/dceconstraints.c.o libdap2/CMakeFiles/dap2.dir/dcetab.c.o libdap2/CMakeFiles/dap2.dir/dceparse.c.o libdap2/CMakeFiles/dap2.dir/dcelex.c.o
|
||||
# libdap4/CMakeFiles/dap4.dir/d4curlfunctions.c.o libdap4/CMakeFiles/dap4.dir/d4fix.c.o libdap4/CMakeFiles/dap4.dir/d4data.c.o libdap4/CMakeFiles/dap4.dir/d4file.c.o libdap4/CMakeFiles/dap4.dir/d4parser.c.o libdap4/CMakeFiles/dap4.dir/d4meta.c.o libdap4/CMakeFiles/dap4.dir/d4varx.c.o libdap4/CMakeFiles/dap4.dir/d4dump.c.o libdap4/CMakeFiles/dap4.dir/d4swap.c.o libdap4/CMakeFiles/dap4.dir/d4chunk.c.o libdap4/CMakeFiles/dap4.dir/d4printer.c.o libdap4/CMakeFiles/dap4.dir/d4read.c.o libdap4/CMakeFiles/dap4.dir/d4http.c.o libdap4/CMakeFiles/dap4.dir/d4util.c.o libdap4/CMakeFiles/dap4.dir/d4odom.c.o libdap4/CMakeFiles/dap4.dir/d4cvt.c.o libdap4/CMakeFiles/dap4.dir/d4debug.c.o libdap4/CMakeFiles/dap4.dir/ncd4dispatch.c.o
|
||||
# libncxml/CMakeFiles/ncxml.dir/ncxml_xml2.c.o
|
||||
# libnczarr/CMakeFiles/nczarr.dir/zarr.c.o libnczarr/CMakeFiles/nczarr.dir/zattr.c.o libnczarr/CMakeFiles/nczarr.dir/zxcache.c.o libnczarr/CMakeFiles/nczarr.dir/zchunking.c.o libnczarr/CMakeFiles/nczarr.dir/zclose.c.o libnczarr/CMakeFiles/nczarr.dir/zcreate.c.o libnczarr/CMakeFiles/nczarr.dir/zcvt.c.o libnczarr/CMakeFiles/nczarr.dir/zdim.c.o libnczarr/CMakeFiles/nczarr.dir/zdispatch.c.o libnczarr/CMakeFiles/nczarr.dir/zfile.c.o libnczarr/CMakeFiles/nczarr.dir/zfilter.c.o libnczarr/CMakeFiles/nczarr.dir/zgrp.c.o libnczarr/CMakeFiles/nczarr.dir/zinternal.c.o libnczarr/CMakeFiles/nczarr.dir/zmap.c.o libnczarr/CMakeFiles/nczarr.dir/zmap_file.c.o libnczarr/CMakeFiles/nczarr.dir/zodom.c.o libnczarr/CMakeFiles/nczarr.dir/zopen.c.o libnczarr/CMakeFiles/nczarr.dir/zprov.c.o libnczarr/CMakeFiles/nczarr.dir/zsync.c.o libnczarr/CMakeFiles/nczarr.dir/ztype.c.o libnczarr/CMakeFiles/nczarr.dir/zutil.c.o libnczarr/CMakeFiles/nczarr.dir/zvar.c.o libnczarr/CMakeFiles/nczarr.dir/zwalk.c.o libnczarr/CMakeFiles/nczarr.dir/zdebug.c.o
|
||||
# libncpoco/CMakeFiles/ncpoco.dir/ncpoco.c.o libncpoco/CMakeFiles/ncpoco.dir/cp_unix.c.o
|
||||
# /opt/homebrew/lib/libhdf5_hl.dylib /opt/homebrew/lib/libhdf5.dylib
|
||||
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libm.tbd
|
||||
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libz.tbd
|
||||
# /opt/homebrew/lib/libzstd.dylib
|
||||
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libbz2.tbd
|
||||
# /opt/homebrew/lib/libsz.dylib
|
||||
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libcurl.tbd
|
||||
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libxml2.tbd
|
||||
|
@ -61,8 +61,8 @@ endif(BUILD_PARALLEL)
|
||||
# Generate the man page.
|
||||
if(HAVE_M4)
|
||||
|
||||
FILE(GLOB libsrc_MANPAGE ${CMAKE_CURRENT_SOURCE_DIR}/../docs/netcdf.m4)
|
||||
FILE(COPY ${libsrc_MANPAGE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(GLOB libsrc_MANPAGE ${CMAKE_CURRENT_SOURCE_DIR}/../docs/netcdf.m4)
|
||||
file(COPY ${libsrc_MANPAGE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(NOT MSVC)
|
||||
add_custom_target(manpage ALL
|
||||
|
@ -4,73 +4,73 @@
|
||||
# University Corporation for Atmospheric Research/Unidata.
|
||||
|
||||
# See netcdf-c/COPYRIGHT file for more info.
|
||||
SET(CMAKE_BUILD_TYPE "")
|
||||
set(CMAKE_BUILD_TYPE "")
|
||||
|
||||
IF(MSVC)
|
||||
SET(PLUGINEXT "dll")
|
||||
SET(PLUGINPRE "__nc")
|
||||
ELSE()
|
||||
SET(PLUGINPRE "lib__nc")
|
||||
if(MSVC)
|
||||
set(PLUGINEXT "dll")
|
||||
set(PLUGINPRE "__nc")
|
||||
else()
|
||||
set(PLUGINPRE "lib__nc")
|
||||
if(APPLE)
|
||||
SET(PLUGINEXT "dylib")
|
||||
ELSE()
|
||||
SET(PLUGINEXT "so")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
set(PLUGINEXT "dylib")
|
||||
else()
|
||||
set(PLUGINEXT "so")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
FILE(READ H5Znoop.c NOOP_SOURCE)
|
||||
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c "#define NOOP_INSTANCE 1\n")
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c "${NOOP_SOURCE}")
|
||||
file(READ H5Znoop.c NOOP_SOURCE)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c "#define NOOP_INSTANCE 1\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c "${NOOP_SOURCE}")
|
||||
|
||||
SET(h5misc_SOURCES H5Zmisc.c H5Zutil.c h5misc.h)
|
||||
set(h5misc_SOURCES H5Zmisc.c H5Zutil.c h5misc.h)
|
||||
|
||||
SET(h5noop_SOURCES H5Znoop.c H5Zutil.c h5noop.h)
|
||||
SET_SOURCE_FILES_PROPERTIES(H5Znoop.c PROPERTIES COMPILE_OPTIONS -DNOOP_INSTANCE=0)
|
||||
set(h5noop_SOURCES H5Znoop.c H5Zutil.c h5noop.h)
|
||||
set_source_files_properties(H5Znoop.c PROPERTIES COMPILE_OPTIONS -DNOOP_INSTANCE=0)
|
||||
|
||||
SET(h5noop1_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c H5Zutil.c h5noop.h)
|
||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c PROPERTIES COMPILE_OPTIONS -DNOOP_INSTANCE=1)
|
||||
set(h5noop1_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c H5Zutil.c h5noop.h)
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/H5Znoop1.c PROPERTIES COMPILE_OPTIONS -DNOOP_INSTANCE=1)
|
||||
|
||||
SET(h5unknown_SOURCES H5Zunknown.c)
|
||||
set(h5unknown_SOURCES H5Zunknown.c)
|
||||
|
||||
SET(h5shuffle_SOURCES H5Zshuffle.c)
|
||||
SET(h5fletcher32_SOURCES H5Zfletcher32.c H5checksum.c)
|
||||
SET(h5deflate_SOURCES H5Zdeflate.c)
|
||||
set(h5shuffle_SOURCES H5Zshuffle.c)
|
||||
set(h5fletcher32_SOURCES H5Zfletcher32.c H5checksum.c)
|
||||
set(h5deflate_SOURCES H5Zdeflate.c)
|
||||
|
||||
SET(nczmisc_SOURCES NCZmisc.c)
|
||||
SET(nczhdf5filters_SOURCES NCZhdf5filters.c)
|
||||
SET(nczstdfilters_SOURCES NCZstdfilters.c)
|
||||
set(nczmisc_SOURCES NCZmisc.c)
|
||||
set(nczhdf5filters_SOURCES NCZhdf5filters.c)
|
||||
set(nczstdfilters_SOURCES NCZstdfilters.c)
|
||||
|
||||
IF(ENABLE_PLUGINS)
|
||||
if(ENABLE_PLUGINS)
|
||||
# LDFLAGS = -module -avoid-version -shared -export-dynamic -no-undefined
|
||||
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
MACRO(buildplugin TARGET TARGETLIB)
|
||||
SET(MANGLELIB "${PLUGINPRE}${TARGETLIB}")
|
||||
ADD_LIBRARY(${TARGET} MODULE ${${TARGET}_SOURCES})
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LIBRARY_OUTPUT_NAME ${MANGLELIB})
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES ARCHIVE_OUTPUT_NAME ${MANGLELIB})
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES RUNTIME_OUTPUT_NAME ${MANGLELIB})
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES PREFIX "") # Critical that this be set to ""
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES SUFFIX ".${PLUGINEXT}")
|
||||
TARGET_LINK_LIBRARIES(${TARGET} PUBLIC ${ALL_TLL_LIBS};${ARGN})
|
||||
IF(MSVC)
|
||||
macro(buildplugin TARGET TARGETLIB)
|
||||
set(MANGLELIB "${PLUGINPRE}${TARGETLIB}")
|
||||
add_library(${TARGET} MODULE ${${TARGET}_SOURCES})
|
||||
set_target_properties(${TARGET} PROPERTIES LIBRARY_OUTPUT_NAME ${MANGLELIB})
|
||||
set_target_properties(${TARGET} PROPERTIES ARCHIVE_OUTPUT_NAME ${MANGLELIB})
|
||||
set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_NAME ${MANGLELIB})
|
||||
set_target_properties(${TARGET} PROPERTIES PREFIX "") # Critical that this be set to ""
|
||||
set_target_properties(${TARGET} PROPERTIES SUFFIX ".${PLUGINEXT}")
|
||||
target_link_libraries(${TARGET} PUBLIC ${ALL_TLL_LIBS};${ARGN})
|
||||
if(MSVC)
|
||||
target_compile_options(${TARGET} PRIVATE /Zi)
|
||||
# Tell linker to include symbol data
|
||||
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF")
|
||||
# Set file name & location
|
||||
set_target_properties(${TARGET} PROPERTIES COMPILE_PDB_NAME ${TARGET} COMPILE_PDB_OUTPUT_DIR ${CMAKE_BINARY_DIR})
|
||||
IF(MPI_C_INCLUDE_PATH)
|
||||
if(MPI_C_INCLUDE_PATH)
|
||||
target_include_directories(${TARGET} PRIVATE ${MPI_C_INCLUDE_PATH})
|
||||
ENDIF(MPI_C_INCLUDE_PATH)
|
||||
ENDIF()
|
||||
endif(MPI_C_INCLUDE_PATH)
|
||||
endif()
|
||||
|
||||
IF(STATUS_PARALLEL)
|
||||
if(STATUS_PARALLEL)
|
||||
target_link_libraries(${TARGET} PUBLIC MPI::MPI_C)
|
||||
ENDIF(STATUS_PARALLEL)
|
||||
ENDMACRO()
|
||||
endif(STATUS_PARALLEL)
|
||||
endmacro()
|
||||
|
||||
buildplugin(h5misc "h5misc" netcdf)
|
||||
buildplugin(h5noop "h5noop")
|
||||
@ -85,67 +85,67 @@ buildplugin(nczmisc "zmisc")
|
||||
buildplugin(nczhdf5filters "zhdf5filters" netcdf)
|
||||
buildplugin(nczstdfilters "zstdfilters" netcdf)
|
||||
|
||||
IF(ENABLE_BLOSC)
|
||||
SET(h5blosc_SOURCES H5Zblosc.c)
|
||||
buildplugin(h5blosc "h5blosc" netcdf;${Blosc_LIBRARIES})
|
||||
ENDIF()
|
||||
if(ENABLE_BLOSC)
|
||||
set(h5blosc_SOURCES H5Zblosc.c)
|
||||
buildplugin(h5blosc "h5blosc" netcdf;${Blosc_LIBRARIES})
|
||||
endif()
|
||||
|
||||
IF(ENABLE_ZSTD)
|
||||
SET(h5zstd_SOURCES H5Zzstd.c H5Zzstd.h)
|
||||
buildplugin(h5zstd "h5zstd" netcdf;${Zstd_LIBRARIES})
|
||||
ENDIF()
|
||||
if(ENABLE_ZSTD)
|
||||
set(h5zstd_SOURCES H5Zzstd.c H5Zzstd.h)
|
||||
buildplugin(h5zstd "h5zstd" netcdf;${Zstd_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# Need our version of szip if libsz available and we are not using HDF5
|
||||
IF(HAVE_SZ)
|
||||
SET(h5szip_SOURCES H5Zszip.c H5Zszip.h)
|
||||
if(HAVE_SZ)
|
||||
set(h5szip_SOURCES H5Zszip.c H5Zszip.h)
|
||||
buildplugin(h5szip "h5szip" ${Szip_LIBRARIES})
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
IF(HAVE_LOCAL_BZ2)
|
||||
SET(h5bzip2_SOURCES H5Zbzip2.c blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c bzlib.h bzlib_private.h)
|
||||
buildplugin(h5bzip2 "h5bzip2")
|
||||
ELSE()
|
||||
SET(h5bzip2_SOURCES H5Zbzip2.c)
|
||||
buildplugin(h5bzip2 "h5bzip2" ${Bzip2_LIBRARIES})
|
||||
ENDIF()
|
||||
if(HAVE_LOCAL_BZ2)
|
||||
set(h5bzip2_SOURCES H5Zbzip2.c blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c bzlib.h bzlib_private.h)
|
||||
buildplugin(h5bzip2 "h5bzip2")
|
||||
else()
|
||||
set(h5bzip2_SOURCES H5Zbzip2.c)
|
||||
buildplugin(h5bzip2 "h5bzip2" ${Bzip2_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
# Installation
|
||||
IF(ENABLE_PLUGIN_INSTALL)
|
||||
if(ENABLE_PLUGIN_INSTALL)
|
||||
|
||||
MACRO(installplugin PLUG)
|
||||
SET(INSTALLED_PLUGIN_LIB "${PLUGINPRE}${PLUG}.${PLUGINEXT}")
|
||||
MESSAGE(STATUS "Installing: ${INSTALLED_PLUGIN_LIB} into ${PLUGIN_INSTALL_DIR}")
|
||||
macro(installplugin PLUG)
|
||||
set(INSTALLED_PLUGIN_LIB "${PLUGINPRE}${PLUG}.${PLUGINEXT}")
|
||||
message(STATUS "Installing: ${INSTALLED_PLUGIN_LIB} into ${PLUGIN_INSTALL_DIR}")
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${INSTALLED_PLUGIN_LIB} DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
ENDMACRO()
|
||||
endmacro()
|
||||
|
||||
install(DIRECTORY DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
IF(Bzip2_FOUND)
|
||||
installplugin(h5bzip2)
|
||||
ENDIF()
|
||||
IF(Zstd_FOUND)
|
||||
installplugin(h5zstd)
|
||||
ENDIF()
|
||||
IF(Blosc_FOUND)
|
||||
installplugin(h5blosc)
|
||||
ENDIF()
|
||||
IF(ENABLE_NCZARR)
|
||||
if(Bzip2_FOUND)
|
||||
installplugin(h5bzip2)
|
||||
endif()
|
||||
if(Zstd_FOUND)
|
||||
installplugin(h5zstd)
|
||||
endif()
|
||||
if(Blosc_FOUND)
|
||||
installplugin(h5blosc)
|
||||
endif()
|
||||
if(ENABLE_NCZARR)
|
||||
installplugin(h5fletcher32)
|
||||
installplugin(h5shuffle)
|
||||
installplugin(h5deflate)
|
||||
installplugin(zhdf5filters)
|
||||
installplugin(zstdfilters)
|
||||
IF(Szip_FOUND)
|
||||
installplugin(h5szip)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
if(Szip_FOUND)
|
||||
installplugin(h5szip)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ENDIF(ENABLE_PLUGIN_INSTALL)
|
||||
endif(ENABLE_PLUGIN_INSTALL)
|
||||
|
||||
ENDIF(ENABLE_PLUGINS)
|
||||
endif(ENABLE_PLUGINS)
|
||||
|
||||
# Copy some test files from current source dir to out-of-tree build dir.
|
||||
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
|
||||
IF(MSVC)
|
||||
FILE(COPY ${COPY_FILES} DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}/)
|
||||
ENDIF()
|
||||
file(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
|
||||
if(MSVC)
|
||||
file(COPY ${COPY_FILES} DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}/)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user