Replace ENABLE_DLL with NETCDF_ENABLE_DLL

This commit is contained in:
Kyle Shores 2024-03-18 15:34:43 -05:00
parent 9288a53be3
commit ece5a776cb
15 changed files with 23 additions and 23 deletions

View File

@ -465,8 +465,8 @@ endif()
# Option to Build DLL
if(WIN32)
option(ENABLE_DLL "Build a Windows DLL." ${BUILD_SHARED_LIBS})
if(ENABLE_DLL)
option(NETCDF_ENABLE_DLL "Build a Windows DLL." ${BUILD_SHARED_LIBS})
if(NETCDF_ENABLE_DLL)
set(BUILD_DLL ON CACHE BOOL "")
target_compile_definitions(netcdf PRIVATE DLL_EXPORT)
target_compile_definitions(netcdf PUBLIC DLL_NETCDF)

View File

@ -73,7 +73,7 @@ Common NetCDF/CMake Options
- NETCDF_ENABLE_DAP (On by Default)
- BUILD_SHARED_LIBS (Off by Default for Windows,
On by Default for Unix/Linux)
- ENABLE_DLL (Windows Only, Off by Default)
- NETCDF_ENABLE_DLL (Windows Only, Off by Default)
- CMAKE_PREFIX_PATH (Specify list of
This is just a partial list of options available. To see a full list

View File

@ -34,7 +34,7 @@ target_compile_options(dap2
-DCURL_STATICLIB=1
)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(dap2 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -27,7 +27,7 @@ target_compile_options(dap4
-DCURL_STATICLIB=1
)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(dap4 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -13,7 +13,7 @@ target_sources(dispatch
dcrc32.c dcrc32.h dcrc64.c ncexhash.c ncxcache.c ncjson.c ds3util.c dparallel.c dmissing.c
)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(dispatch PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -18,7 +18,7 @@ target_sources(netcdfhdf4
hdf4var.c
)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(netcdfhdf4 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -17,7 +17,7 @@ target_sources(netcdfhdf5 PRIVATE
hdf5set_format_compatibility.c hdf5debug.c
)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(netcdfhdf5 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -8,7 +8,7 @@ endif()
add_library(ncpoco OBJECT ${libncpoco_SOURCES})
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(ncpoco PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -19,7 +19,7 @@ else()
)
endif(HAVE_LIBXML2)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(ncxml PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -69,7 +69,7 @@ if(STATUS_PARALLEL)
target_link_libraries(nczarr PUBLIC MPI::MPI_C)
endif(STATUS_PARALLEL)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(nczarr PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -49,7 +49,7 @@ endif(NETCDF_ENABLE_BYTERANGE)
add_library(netcdf3 OBJECT ${libsrc_SOURCES})
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(netcdf3 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -11,7 +11,7 @@ nc4internal.c nc4type.c nc4var.c ncfunc.c ncindex.c nc4cache.c)
add_library(netcdf4 OBJECT ${libsrc4_SOURCES})
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(netcdf4 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -10,7 +10,7 @@ target_link_libraries(netcdfp PUBLIC PNETCDF::PNETCDF)
target_sources(netcdfp PRIVATE ncpdispatch.c)
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(netcdfp PRIVATE DLL_NETCDF DLL_EXPORT)
endif()

View File

@ -57,16 +57,16 @@ ENDIF()
IF(ENABLE_TESTS)
add_library(ut_util STATIC ut_util.c ut_test.c ut_includes.h ut_test.h ${XGETOPTSRC})
IF(ENABLE_DLL)
IF(NETCDF_ENABLE_DLL)
target_compile_definitions(ut_util PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
ENDIF(ENABLE_DLL)
ENDIF(NETCDF_ENABLE_DLL)
target_include_directories(ut_util PUBLIC ../libnczarr ../plugins ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(ut_util PUBLIC netcdf ${ALL_TLL_LIBS})
add_library(test_utils STATIC test_utils.c test_utils.h ${XGETOPTSRC})
IF(ENABLE_DLL)
IF(NETCDF_ENABLE_DLL)
target_compile_definitions(test_utils PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
ENDIF(ENABLE_DLL)
ENDIF(NETCDF_ENABLE_DLL)
target_include_directories(test_utils PUBLIC ../libnczarr ../plugins ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(test_utils PUBLIC netcdf ${ALL_TLL_LIBS})
@ -78,17 +78,17 @@ IF(ENABLE_TESTS)
macro(build_bin_test_with_util_lib F UTIL_LIB)
build_bin_test(${F})
IF(ENABLE_DLL)
IF(NETCDF_ENABLE_DLL)
target_compile_definitions(${F} PUBLIC -DDLL_NETCDF)
ENDIF(ENABLE_DLL)
ENDIF(NETCDF_ENABLE_DLL)
target_link_libraries(${F} ${UTIL_LIB} ${ALL_TLL_LIBS})
endmacro()
macro(add_bin_test_with_util_lib PREFIX F UTIL_LIB)
add_bin_test(${PREFIX} ${F})
IF(ENABLE_DLL)
IF(NETCDF_ENABLE_DLL)
target_compile_definitions(${PREFIX}_${F} PUBLIC -DDLL_NETCDF)
ENDIF(ENABLE_DLL)
ENDIF(NETCDF_ENABLE_DLL)
target_link_libraries(${PREFIX}_${F} ${UTIL_LIB} ${ALL_TLL_LIBS})
endmacro()

View File

@ -8,7 +8,7 @@ set(oc_SOURCES oc.c daplex.c dapparse.c dapy.c occompile.c occurlfunctions.c ocd
add_library(oc2 OBJECT ${oc_SOURCES})
if (ENABLE_DLL)
if (NETCDF_ENABLE_DLL)
target_compile_definitions(oc2 PRIVATE DLL_NETCDF DLL_EXPORT)
endif()