Commit 5d198985 authored by Dave Moxey's avatar Dave Moxey

Fix to install only shared 3rd party libraries and their symlinks

parent 1e346400
......@@ -115,17 +115,29 @@ SET(NEKTAR_SHARE_DIR share/nektar++)
SET(NEKTAR_DOC_DIR share/doc/nektar++)
SET(NEKTAR_CMAKE_DIR ${LIB_DIR}/nektar++/cmake)
# Set ThirdParty locations.
SET(TPSRC ${CMAKE_SOURCE_DIR}/ThirdParty)
SET(TPBUILD ${CMAKE_BINARY_DIR}/ThirdParty)
SET(TPDIST ${CMAKE_BINARY_DIR}/ThirdParty/dist)
SET(TPINC ${CMAKE_INSTALL_PREFIX}/include/ThirdParty)
SET(TPLIB ${CMAKE_INSTALL_PREFIX}/${NEKTAR_LIB_DIR}/nektar++/thirdparty)
# Create ThirdParty source directory if it doesn't exist already.
IF (NOT EXISTS ${TPSRC})
FILE(MAKE_DIRECTORY ${TPSRC})
ENDIF ()
# Build shared libraries.
SET(NEKTAR_LIBRARY_TYPE "SHARED")
# Set up RPATH
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${TPLIB}")
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}" "${TPLIB}")
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${TPLIB}")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}" "${TPLIB}/")
ELSE()
SET(CMAKE_INSTALL_RPATH "${TPLIB}")
ENDIF()
......@@ -206,17 +218,6 @@ ELSE()
SET(TPURL http://www.nektar.info/thirdparty)
ENDIF()
SET(TPSRC ${CMAKE_SOURCE_DIR}/ThirdParty)
SET(TPBUILD ${CMAKE_BINARY_DIR}/ThirdParty)
SET(TPDIST ${CMAKE_BINARY_DIR}/ThirdParty/dist)
SET(TPINC ${CMAKE_INSTALL_PREFIX}/include/ThirdParty)
SET(TPLIB ${CMAKE_INSTALL_PREFIX}/${NEKTAR_LIB_DIR}/nektar++/thirdparty)
# Create ThirdParty source directory if it doesn't exist already.
IF (NOT EXISTS ${TPSRC})
FILE(MAKE_DIRECTORY ${TPSRC})
ENDIF ()
# Find ThirdParty libraries and headers.
# --------------------------------------
......@@ -321,6 +322,10 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
DESTINATION ${NEKTAR_CMAKE_DIR}
COMPONENT dev)
INSTALL(CODE "FILE(GLOB tplibs ${TPDIST}/lib/*${CMAKE_SHARED_LIBRARY_SUFFIX}*)
FILE(INSTALL \${tplibs} DESTINATION ${TPLIB})
")
# Install ThirdParty headers to subdirectory of ${NEKTAR_INCLUDE_DIR}
INSTALL(DIRECTORY ${TPDIST}/include/
DESTINATION ${NEKTAR_INCLUDE_DIR}/ThirdParty
......
......@@ -32,18 +32,11 @@ MACRO(THIRDPARTY_LIBRARY varname)
ENDIF()
FOREACH (lib ${TPLIBS})
SET(tmplib "${TPDIST}/lib/${CMAKE_${LIBTYPE}_LIBRARY_PREFIX}${lib}${CMAKE_${LIBTYPE}_LIBRARY_SUFFIX}")
LIST(APPEND tmplist ${tmplib})
# Install shared libraries to Nektar++ library directory.
IF (TPLIB_SHARED)
INSTALL(FILES ${tmplib} DESTINATION ${TPLIB})
ENDIF()
LIST(APPEND tmplist "${TPDIST}/lib/${CMAKE_${LIBTYPE}_LIBRARY_PREFIX}${lib}${CMAKE_${LIBTYPE}_LIBRARY_SUFFIX}")
ENDFOREACH()
SET(${varname} ${tmplist} CACHE FILEPATH ${TPLIB_DESCRIPTION} FORCE)
UNSET(tmplist)
UNSET(tmplib)
UNSET(LIBTYPE)
UNSET(TPLIBS)
UNSET(TPLIB_SHARED)
......
......@@ -176,6 +176,8 @@ IF (THIRDPARTY_BUILD_BOOST)
SET(Boost_LIBRARY_DIRS ${TPSRC}/dist/lib)
SET(Boost_CONFIG_LIBRARY_DIR ${TPLIB})
INCLUDE_DIRECTORIES(${TPDIST}/include)
STRING(REPLACE ";" ", " NEEDED_BOOST_LIBS_STRING "${NEEDED_BOOST_LIBS}")
MESSAGE(STATUS "Build boost libs: ${NEEDED_BOOST_LIBS_STRING}")
ELSE (THIRDPARTY_BUILD_BOOST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment