netcdf-c/liblib/CMakeLists.txt

56 lines
1.2 KiB
CMake
Raw Normal View History

SET(CMAKE_INCLUDE_CURRENT_DIR ON)
INCLUDE_DIRECTORIES(".")
SET(liblib_LIBS dispatch netcdf3)
2012-07-26 06:09:19 +08:00
#####
# Add target objects/modules based on options.
#####
IF(USE_HDF5 OR USE_NETCDF4)
SET(liblib_LIBS ${liblib_LIBS} netcdf4)
ENDIF()
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()
FOREACH(LIBS ${liblib_LIBS})
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
ENDFOREACH()
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-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})
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)