2012-07-18 05:44:41 +08:00
|
|
|
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(".")
|
|
|
|
|
2012-07-19 05:12:58 +08:00
|
|
|
SET(liblib_LIBS dispatch netcdf3)
|
2012-07-18 05:44:41 +08:00
|
|
|
|
2012-07-26 06:09:19 +08:00
|
|
|
#####
|
|
|
|
# Add target objects/modules based on options.
|
|
|
|
#####
|
|
|
|
|
2012-07-19 05:12:58 +08:00
|
|
|
IF(USE_HDF5 OR USE_NETCDF4)
|
|
|
|
SET(liblib_LIBS ${liblib_LIBS} netcdf4)
|
|
|
|
ENDIF()
|
2012-07-18 05:44:41 +08:00
|
|
|
|
2012-07-26 06:09:19 +08:00
|
|
|
IF(USE_DAP)
|
2012-08-04 06:24:29 +08:00
|
|
|
SET(liblib_LIBS ${liblib_LIBS} oc2 dap2)
|
2012-07-20 06:11:10 +08:00
|
|
|
ENDIF()
|
|
|
|
|
2012-07-25 06:53:58 +08:00
|
|
|
IF(BUILD_CDMREMOTE)
|
|
|
|
SET(liblib_LIBS ${liblib_LIBS} cdmr)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
2012-07-19 05:12:58 +08:00
|
|
|
FOREACH(LIBS ${liblib_LIBS})
|
|
|
|
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
|
|
|
|
ENDFOREACH()
|
|
|
|
|
2012-08-03 06:56:57 +08:00
|
|
|
ADD_LIBRARY(netcdf stub.c ${LARGS} )
|
2012-07-21 05:16:27 +08:00
|
|
|
|
2012-07-26 06:09:19 +08:00
|
|
|
#####
|
|
|
|
# Add dependencies required for linking.
|
|
|
|
#####
|
2012-08-11 05:44:00 +08:00
|
|
|
SET(TLL_LIBS ${HAVE_LIBM})
|
|
|
|
#TARGET_LINK_LIBRARIES(netcdf ${HAVE_LIBM})
|
2012-07-26 06:09:19 +08:00
|
|
|
|
2012-08-11 05:44:00 +08:00
|
|
|
#TARGET_LINK_LIBRARIES(netcdf ${MMATH})
|
2012-08-07 01:27:08 +08:00
|
|
|
|
2012-07-26 06:09:19 +08:00
|
|
|
IF(USE_DAP)
|
2012-08-11 05:44:00 +08:00
|
|
|
SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES})
|
|
|
|
# TARGET_LINK_LIBRARIES(netcdf ${CURL_LIBRARIES})
|
2012-07-26 06:09:19 +08:00
|
|
|
ENDIF()
|
2012-07-21 05:16:27 +08:00
|
|
|
|
|
|
|
IF(USE_HDF5 OR USE_NETCDF4)
|
2012-08-11 05:44:00 +08:00
|
|
|
#TARGET_LINK_LIBRARIES(netcdf ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARY} ${SZIP_LIBRARY} ${ZLIB_LIBRARY})
|
|
|
|
SET(TLL_LIBS ${TLL_LIBS} ${SZIP_LIBRARY} ${ZLIB_LIBRARY} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARY})
|
2012-07-21 05:16:27 +08:00
|
|
|
ENDIF()
|
2012-07-25 06:53:58 +08:00
|
|
|
|
2012-07-26 06:09:19 +08:00
|
|
|
IF(ENABLE_PNETCDF AND PNETCDF)
|
2012-08-11 05:44:00 +08:00
|
|
|
SET(TLL_LIBS ${TLL_LIBS} ${PNETCDF})
|
|
|
|
#TARGET_LINK_LIBRARIES(netcdf ${PNETCDF})
|
2012-07-25 06:53:58 +08:00
|
|
|
ENDIF()
|
2012-08-11 05:44:00 +08:00
|
|
|
TARGET_LINK_LIBRARIES(netcdf ${TLL_LIBS})
|
2012-08-03 06:56:57 +08:00
|
|
|
INSTALL(TARGETS netcdf DESTINATION lib)
|
2012-08-04 06:24:29 +08:00
|
|
|
#include(CPack)
|
2012-08-11 05:44:00 +08:00
|
|
|
SET(ALL_TLL_LIBS ${TLL_LIBS} PARENT_SCOPE)
|