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)
|
cmake_minimum_required(VERSION 2.8.8)
|
||||||
|
|
||||||
#Project Name
|
#Project Name
|
||||||
project(NetCDF C)
|
project(NetCDF C CXX)
|
||||||
SET(NetCDF_VERSION 4.2.1)
|
SET(NetCDF_VERSION 4.2.1)
|
||||||
ENABLE_TESTING()
|
ENABLE_TESTING()
|
||||||
INCLUDE(CTest)
|
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_DROP_SITE_CDASH TRUE CACHE BOOL "")
|
||||||
SET (CTEST_MEMORYCHECK_COMMAND valgrind CACHE STRING "")
|
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()
|
ADD_DEFINITIONS()
|
||||||
|
|
||||||
### Verbose make, for debugging.
|
### Verbose make, for debugging.
|
||||||
@ -490,6 +497,14 @@ IF(ENABLE_TESTS)
|
|||||||
|
|
||||||
ENDIF()
|
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.
|
# Build doxygen documentation, if need be.
|
||||||
#####
|
#####
|
||||||
|
@ -25,19 +25,16 @@ FOREACH(LIBS ${liblib_LIBS})
|
|||||||
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
|
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
|
||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
|
|
||||||
ADD_LIBRARY(netcdf stub.c ${LARGS} )
|
ADD_LIBRARY(netcdf ${LIB_TYPE} stub.c ${LARGS} )
|
||||||
|
|
||||||
|
|
||||||
#####
|
#####
|
||||||
# Add dependencies required for linking.
|
# Add dependencies required for linking.
|
||||||
#####
|
#####
|
||||||
SET(TLL_LIBS ${HAVE_LIBM} ${ZLIB_LIBRARY})
|
SET(TLL_LIBS ${HAVE_LIBM} ${ZLIB_LIBRARY})
|
||||||
#TARGET_LINK_LIBRARIES(netcdf ${HAVE_LIBM})
|
|
||||||
|
|
||||||
#TARGET_LINK_LIBRARIES(netcdf ${MMATH})
|
|
||||||
|
|
||||||
IF(USE_DAP)
|
IF(USE_DAP)
|
||||||
SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES})
|
SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES})
|
||||||
# TARGET_LINK_LIBRARIES(netcdf ${CURL_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(USE_HDF5 OR USE_NETCDF4)
|
IF(USE_HDF5 OR USE_NETCDF4)
|
||||||
@ -46,7 +43,6 @@ ENDIF()
|
|||||||
|
|
||||||
IF(ENABLE_PNETCDF AND PNETCDF)
|
IF(ENABLE_PNETCDF AND PNETCDF)
|
||||||
SET(TLL_LIBS ${TLL_LIBS} ${PNETCDF})
|
SET(TLL_LIBS ${TLL_LIBS} ${PNETCDF})
|
||||||
#TARGET_LINK_LIBRARIES(netcdf ${PNETCDF})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
TARGET_LINK_LIBRARIES(netcdf ${TLL_LIBS})
|
TARGET_LINK_LIBRARIES(netcdf ${TLL_LIBS})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user