Made build system to use conditional.

This commit is contained in:
Ward Fisher 2015-10-20 10:10:55 -06:00
parent cdb0ae4baa
commit 6341067733

View File

@ -102,14 +102,30 @@ SET_TARGET_PROPERTIES(netcdf PROPERTIES
SOVERSION ${netCDF_SO_VERSION}
)
INSTALL(
TARGETS netcdf EXPORT netCDFTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
###
# The INCLUDES directive was introduced in 2.8.12.
# However, 2.8.11 is still the default on some
# popular linux distributions. See
# https://github.com/Unidata/netcdf-c/issues/135
# for more information.
###
IF(${CMAKE_VERSION} LESS 2.8.12)
INSTALL(
TARGETS netcdf EXPORT netCDFTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
ELSE()
INSTALL(
TARGETS netcdf EXPORT netCDFTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
ENDIF()
SET(ALL_TLL_LIBS ${TLL_LIBS} PARENT_SCOPE)
SET(NC_LIBS ${NC_LIBS} PARENT_SCOPE)