Commit 6fd7189a authored by Dave Moxey's avatar Dave Moxey

Convert other third-party stuff to use new macros

parent c52b8783
MACRO(CONSTRUCT_LIBNAME name)
MACRO(THIRDPARTY_SHARED_LIBNAME name)
SET(${name} "${TPDIST}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${${name}}${CMAKE_SHARED_LIBRARY_SUFFIX}")
ENDMACRO()
MACRO(THIRDPARTY_STATIC_LIBNAME name)
SET(${name} "${TPDIST}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${${name}}${CMAKE_STATIC_LIBRARY_SUFFIX}")
ENDMACRO()
MACRO(CHANGE_EXTENSION output var new_ext)
GET_FILENAME_COMPONENT(FileName ${var} NAME_WE)
GET_FILENAME_COMPONENT(Path ${var} PATH)
......
......@@ -65,9 +65,8 @@ IF (THIRDPARTY_BUILD_BOOST)
INCLUDE(ExternalProject)
# Only build the libraries we need
SET(BOOST_LIB_LIST --with-system --with-iostreams --with-filesystem
--with-program_options --with-date_time --with-thread
--with-regex --with-timer)
STRING(REPLACE ";" " --with-" BOOST_LIB_LIST "${NEEDED_BOOST_LIBS}")
SET(BOOST_LIB_LIST "--with-${BOOST_LIB_LIST}")
IF (NOT WIN32)
# We need -fPIC for 64-bit builds
......@@ -160,36 +159,24 @@ IF (THIRDPARTY_BUILD_BOOST)
ENDIF(THIRDPARTY_BUILD_ZLIB)
# Set up CMake variables
SET(Boost_DATE_TIME_LIBRARY boost_date_time)
SET(Boost_DATE_TIME_LIBRARY_DEBUG boost_date_time)
SET(Boost_DATE_TIME_LIBRARY_RELEASE boost_date_time)
SET(Boost_FILESYSTEM_LIBRARY boost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_DEBUG boost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_RELEASE boost_filesystem)
SET(Boost_IOSTREAMS_LIBRARY boost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_DEBUG boost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_RELEASE boost_iostreams)
SET(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE boost_program_options)
SET(Boost_REGEX_LIBRARY boost_regex)
SET(Boost_REGEX_LIBRARY_DEBUG boost_regex)
SET(Boost_REGEX_LIBRARY_RELEASE boost_regex)
SET(Boost_SYSTEM_LIBRARY boost_system)
SET(Boost_SYSTEM_LIBRARY_DEBUG boost_system)
SET(Boost_SYSTEM_LIBRARY_RELEASE boost_system)
SET(Boost_THREAD_LIBRARY boost_thread)
SET(Boost_THREAD_LIBRARY_DEBUG boost_thread)
SET(Boost_THREAD_LIBRARY_RELEASE boost_thread)
SET(Boost_TIMER_LIBRARY boost_timer)
SET(Boost_TIMER_LIBRARY_DEBUG boost_timer)
SET(Boost_TIMER_LIBRARY_RELEASE boost_timer)
FOREACH(BOOSTLIB ${NEEDED_BOOST_LIBS})
STRING(TOUPPER ${BOOSTLIB} BOOSTLIB_UPPER)
SET(Boost_${BOOSTLIB_UPPER}_LIBRARY boost_${BOOSTLIB})
SET(Boost_${BOOSTLIB_UPPER}_LIBRARY_DEBUG boost_${BOOSTLIB})
SET(Boost_${BOOSTLIB_UPPER}_LIBRARY_RELEASE boost_${BOOSTLIB})
THIRDPARTY_SHARED_LIBNAME(Boost_${BOOSTLIB_UPPER}_LIBRARY)
THIRDPARTY_SHARED_LIBNAME(Boost_${BOOSTLIB_UPPER}_LIBRARY_DEBUG)
THIRDPARTY_SHARED_LIBNAME(Boost_${BOOSTLIB_UPPER}_LIBRARY_RELEASE)
ENDFOREACH()
SET(Boost_INCLUDE_DIRS ${TPSRC}/dist/include)
SET(Boost_CONFIG_INCLUDE_DIR ${TPINC})
SET(Boost_LIBRARY_DIRS ${TPSRC}/dist/lib)
SET(Boost_CONFIG_LIBRARY_DIR ${TPLIB})
SET(Boost_LIBRARIES boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_system boost_thread boost_timer)
STRING(REPLACE ";" " boost_" Boost_LIBRARIES "${NEEDED_BOOST_LIBS}")
SET(Boost_LIBRARIES "boost_${Boost_LIBRARIES}")
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
STRING(REPLACE ";" ", " NEEDED_BOOST_LIBS_STRING "${NEEDED_BOOST_LIBS}")
......
......@@ -46,9 +46,10 @@ IF (NEKTAR_USE_FFTW)
SET(FFTW_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"FFTW include" FORCE)
THIRDPARTY_SHARED_LIBNAME(FFTW_LIBRARY)
LINK_DIRECTORIES(${TPDIST}/lib)
MESSAGE(STATUS "Build FFTW: ${TPDIST}/lib/lib${FFTW_LIBRARY}.so")
MESSAGE(STATUS "Build FFTW: ${FFTW_LIBRARY}")
SET(FFTW_CONFIG_INCLUDE_DIR ${TPINC})
ELSE ()
ADD_CUSTOM_TARGET(fftw-3.2.2 ALL)
......
......@@ -10,12 +10,13 @@ OPTION(NEKTAR_USE_HDF5
"Enable HDF5 I/O support." OFF)
IF (NEKTAR_USE_HDF5)
INCLUDE(FindHDF5)
IF (NOT NEKTAR_USE_MPI)
MESSAGE(FATAL_ERROR "HDF5 requires Nektar++ to be compiled using NEKTAR_USE_MPI.")
ENDIF()
SET(HDF5_PREFER_PARALLEL ON)
FIND_PACKAGE(HDF5 QUIET)
IF (HDF5_FOUND)
IF (NOT HDF5_IS_PARALLEL)
MESSAGE(FATAL_ERROR "HDF5 detected but is not compiled in parallel.")
......@@ -57,7 +58,7 @@ IF (NEKTAR_USE_HDF5)
"HDF5 libraries" FORCE)
SET(HDF5_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"HDF5 include directory" FORCE)
CONSTRUCT_LIBNAME(HDF5_LIBRARIES)
THIRDPARTY_SHARED_LIBNAME(HDF5_LIBRARIES)
MARK_AS_ADVANCED(HDF5_LIBRARIES)
MARK_AS_ADVANCED(HDF5_INCLUDE_DIR)
......
......@@ -75,8 +75,10 @@ IF( NEKTAR_USE_MPI )
SET(XXT_LIBRARY xxt CACHE FILEPATH
"XXT path" FORCE)
MARK_AS_ADVANCED(XXT_LIBRARY)
MESSAGE(STATUS "Build GSMPI: ${TPDIST}/lib/lib${GSMPI_LIBRARY}.a")
MESSAGE(STATUS "Build XXT: ${TPDIST}/lib/lib${XXT_LIBRARY}.a")
THIRDPARTY_STATIC_LIBNAME(GSMPI_LIBRARY)
THIRDPARTY_STATIC_LIBNAME(XXT_LIBRARY)
MESSAGE(STATUS "Build GSMPI: ${GSMPI_LIBRARY}")
MESSAGE(STATUS "Build XXT: ${XXT_LIBRARY}")
ELSE (THIRDPARTY_BUILD_GSMPI)
ADD_CUSTOM_TARGET(gsmpi-1.2 ALL)
INCLUDE (FindGSMPI)
......
......@@ -41,13 +41,9 @@ IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
ENDIF()
SET(METIS_LIB metis CACHE FILEPATH "METIS library" FORCE)
THIRDPARTY_STATIC_LIBNAME(METIS_LIB)
MARK_AS_ADVANCED(METIS_LIB)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(${TPDIST}/include)
IF (WIN32)
MESSAGE(STATUS "Build Metis: ${TPDIST}/${LIB_DIR}/${METIS_LIB}.dll")
ELSE ()
MESSAGE(STATUS "Build Metis: ${TPDIST}/${LIB_DIR}/lib${METIS_LIB}.a")
ENDIF()
MESSAGE(STATUS "Build Metis: ${METIS_LIB}")
......@@ -70,8 +70,9 @@ IF (NEKTAR_USE_PETSC)
SET(PETSC_INCLUDES ${TPDIST}/include CACHE FILEPATH
"PETSc includes" FORCE)
THIRDPARTY_STATIC_LIBNAME(PETSC_LIBRARIES)
LINK_DIRECTORIES(${TPDIST}/lib)
MESSAGE(STATUS "Build PETSc: ${TPDIST}/${LIB_DIR}/lib${PETSC_LIBRARIES}.a")
MESSAGE(STATUS "Build PETSc: ${PETSC_LIBRARIES}")
SET(PETSC_CONFIG_INCLUDE_DIR ${TPINC})
ELSE (THIRDPARTY_BUILD_PETSC)
INCLUDE(FindPETSc)
......
......@@ -19,8 +19,9 @@ IF (THIRDPARTY_BUILD_SMV)
SET(SMV smv CACHE FILEPATH "Path to LibSMV." FORCE)
MARK_AS_ADVANCED(SMV)
THIRDPARTY_STATIC_LIBNAME(SMV)
LINK_DIRECTORIES(${TPDIST}/lib)
MESSAGE(STATUS "Build LibSMV: ${TPDIST}/lib/lib${SMV}.a")
MESSAGE(STATUS "Build LibSMV: ${SMV}")
SET(NEKTAR_USING_SMV TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_SMV)
ELSE (THIRDPARTY_BUILD_SMV)
......
......@@ -88,7 +88,8 @@ IF (NEKTAR_USE_SCOTCH)
LINK_DIRECTORIES(${TPDIST}/lib)
MESSAGE(STATUS "Build Scotch: ${TPDIST}/lib/lib${SCOTCH_LIBRARY}.a")
THIRDPARTY_STATIC_LIBNAME(SCOTCH_LIBRARY)
MESSAGE(STATUS "Build Scotch: ${SCOTCH_LIBRARY}")
SET(SCOTCH_CONFIG_INCLUDE_DIR ${TPINC})
ELSE (THIRDPARTY_BUILD_SCOTCH)
ADD_CUSTOM_TARGET(scotch-6.0.0 ALL)
......
......@@ -49,16 +49,10 @@ IF (THIRDPARTY_BUILD_TINYXML)
SET(TINYXML_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"TinyXML include" FORCE)
THIRDPARTY_STATIC_LIBNAME(TINYXML_LIBRARY)
LINK_DIRECTORIES(${TPDIST}/lib)
IF (WIN32)
MESSAGE(STATUS
"Build TinyXML: ${TPDIST}/${LIB_DIR}/${TINYXML_LIBRARY}.dll")
ELSE ()
MESSAGE(STATUS
"Build TinyXML: ${TPDIST}/${LIB_DIR}/lib${TINYXML_LIBRARY}.a")
ENDIF ()
MESSAGE(STATUS "Build TinyXML: ${TINYXML_LIBRARY}")
SET(TINYXML_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(tinyxml-2.6.2 ALL)
......
......@@ -68,7 +68,10 @@ IF (THIRDPARTY_BUILD_ZLIB)
"Zlib library" FORCE)
SET(ZLIB_LIBRARY_RELEASE zlib CACHE FILEPATH
"Zlib library" FORCE)
MESSAGE(STATUS "Build Zlib: ${TPDIST}/${LIB_DIR}/${ZLIB_LIBRARY}.dll")
THIRDPARTY_STATIC_LIBNAME(ZLIB_LIBRARY)
THIRDPARTY_STATIC_LIBNAME(ZLIB_LIBRARY_DEBUG)
THIRDPARTY_STATIC_LIBNAME(ZLIB_LIBRARY_RELEASE)
MESSAGE(STATUS "Build Zlib: ${ZLIB_LIBRARY}")
ELSE ()
SET(ZLIB_LIBRARY z CACHE FILEPATH
"Zlib library" FORCE)
......@@ -76,7 +79,10 @@ IF (THIRDPARTY_BUILD_ZLIB)
"Zlib library" FORCE)
SET(ZLIB_LIBRARY_RELEASE z CACHE FILEPATH
"Zlib library" FORCE)
MESSAGE(STATUS "Build Zlib: ${TPDIST}/${LIB_DIR}/lib${ZLIB_LIBRARY}.a")
THIRDPARTY_STATIC_LIBNAME(ZLIB_LIBRARY)
THIRDPARTY_STATIC_LIBNAME(ZLIB_LIBRARY_DEBUG)
THIRDPARTY_STATIC_LIBNAME(ZLIB_LIBRARY_RELEASE)
MESSAGE(STATUS "Build Zlib: ${ZLIB_LIBRARY}")
ENDIF ()
SET(ZLIB_INCLUDE_DIR ${TPDIST}/include CACHE PATH "Zlib include" FORCE)
......
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