mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Add code to generate an export library.
This commit is contained in:
parent
5259123089
commit
dfed98c691
@ -2,7 +2,7 @@
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
|
||||
#Project Name
|
||||
project(NetCDF C)
|
||||
project(NetCDF C CXX)
|
||||
SET(NetCDF_VERSION 4.2.1)
|
||||
ENABLE_TESTING()
|
||||
INCLUDE(CTest)
|
||||
@ -18,6 +18,13 @@ SET (CTEST_DROP_LOCATION "/submit.php?project=WinNETCDF" CACHE STRING "")
|
||||
SET (CTEST_DROP_SITE_CDASH TRUE CACHE BOOL "")
|
||||
SET (CTEST_MEMORYCHECK_COMMAND valgrind CACHE STRING "")
|
||||
|
||||
# Set variable to define the build type.
|
||||
INCLUDE(GenerateExportHeader)
|
||||
SET (LIB_TYPE STATIC)
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
SET(LIB_TYPE SHARED)
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS()
|
||||
|
||||
### Verbose make, for debugging.
|
||||
@ -490,6 +497,14 @@ IF(ENABLE_TESTS)
|
||||
|
||||
ENDIF()
|
||||
|
||||
# Code to generate an export header
|
||||
GENERATE_EXPORT_HEADER(netcdf
|
||||
BASE_NAME netcdf
|
||||
EXPORT_MACRO_NAME netcdf_EXPORT
|
||||
EXPORT_FILE_NAME netcdf_Export.h
|
||||
STATIC_DEFINE netcdf_BUILT_AS_STATIC
|
||||
)
|
||||
|
||||
#####
|
||||
# Build doxygen documentation, if need be.
|
||||
#####
|
||||
|
@ -25,19 +25,16 @@ FOREACH(LIBS ${liblib_LIBS})
|
||||
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
|
||||
ENDFOREACH()
|
||||
|
||||
ADD_LIBRARY(netcdf stub.c ${LARGS} )
|
||||
ADD_LIBRARY(netcdf ${LIB_TYPE} stub.c ${LARGS} )
|
||||
|
||||
|
||||
#####
|
||||
# Add dependencies required for linking.
|
||||
#####
|
||||
SET(TLL_LIBS ${HAVE_LIBM} ${ZLIB_LIBRARY})
|
||||
#TARGET_LINK_LIBRARIES(netcdf ${HAVE_LIBM})
|
||||
|
||||
#TARGET_LINK_LIBRARIES(netcdf ${MMATH})
|
||||
|
||||
IF(USE_DAP)
|
||||
SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES})
|
||||
# TARGET_LINK_LIBRARIES(netcdf ${CURL_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
IF(USE_HDF5 OR USE_NETCDF4)
|
||||
@ -46,7 +43,6 @@ ENDIF()
|
||||
|
||||
IF(ENABLE_PNETCDF AND PNETCDF)
|
||||
SET(TLL_LIBS ${TLL_LIBS} ${PNETCDF})
|
||||
#TARGET_LINK_LIBRARIES(netcdf ${PNETCDF})
|
||||
ENDIF()
|
||||
TARGET_LINK_LIBRARIES(netcdf ${TLL_LIBS})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user