Commit c3edfdfd authored by Dave Moxey's avatar Dave Moxey

Refactor Loki installation for Nektar++Config.cmake

parent a393eb3e
......@@ -149,14 +149,18 @@ CMAKE_DEPENDENT_OPTION(NEKTAR_USE_WIN32_LAPACK
# Include Nektar++ common macros
INCLUDE (NektarCommon)
# Find Libraries
SET(TPURL http://www.nektar.info/thirdparty)
SET(TPSRC ${CMAKE_SOURCE_DIR}/ThirdParty)
# Set various ThirdParty locations
SET(TPURL http://www.nektar.info/thirdparty)
SET(TPSRC ${CMAKE_SOURCE_DIR}/ThirdParty)
SET(TPBUILD ${CMAKE_BINARY_DIR}/ThirdParty)
SET(TPDIST ${CMAKE_BINARY_DIR}/ThirdParty/dist)
SET(TPDIST ${CMAKE_BINARY_DIR}/ThirdParty/dist)
# Create ThirdParty source directory if it doesn't exist already.
IF (NOT EXISTS ${TPSRC})
FILE(MAKE_DIRECTORY ${TPSRC})
ENDIF ()
# Find Libraries
INCLUDE (ThirdPartyTinyxml)
INCLUDE (ThirdPartyLoki)
INCLUDE (ThirdPartyMetis)
......@@ -288,6 +292,13 @@ IF (NEKTAR_BUILD_TESTS)
ENDIF (NEKTAR_USE_MPI)
ENDIF (NEKTAR_BUILD_TESTS)
SET(NEKTAR_DEFINITIONS "")
GET_DIRECTORY_PROPERTY(
NEKTAR_DEFINITIONS_LIST DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
FOREACH(def ${NEKTAR_DEFINITIONS_LIST})
SET(NEKTAR_DEFINITIONS "${NEKTAR_DEFINITIONS} -D${def}")
ENDFOREACH()
# Write out Nektar++ build configuration
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/Nektar++Config.cmake.in
${CMAKE_BINARY_DIR}/Nektar++Config.cmake @ONLY)
......
#
# FindLoki.cmake: Find Loki headers
#
# Use LOKI_ADDITIONAL_INCLUDE_DIRS to add additional search directories.
# Try to find system Loki headers
FIND_PATH(LOKI_INCLUDE_DIR loki/Typelist.h)
FIND_PATH(LOKI_INCLUDE_DIR loki/Typelist.h
${LOKI_ADDITIONAL_INCLUDE_DIRS}
/usr/include
/usr/local/include
${CMAKE_SOURCE_DIR}/ThirdParty/loki/include/
${CMAKE_SOURCE_DIR}/ThirdParty/loki-0.1.3/include
${CMAKE_SOURCE_DIR}/ThirdParty/loki-0.1.3/loki-0.1.3/include
${CMAKE_SOURCE_DIR}/../ThirdParty/loki/include/
${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/include/
${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/loki-0.1.3/include
"C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include"
"C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include"
)
IF (LOKI_INCLUDE_DIR)
SET(LOKI_FOUND TRUE)
SET(LOKI_SYSTEM TRUE)
ENDIF ()
IF (NOT LOKI_FOUND)
FIND_PATH(LOKI_INCLUDE_DIR loki/Typelist.h
PATHS ${TPSRC}/loki-0.1.3/include NO_DEFAULT_PATH)
IF (LOKI_INCLUDE_DIR)
SET(LOKI_FOUND TRUE)
ENDIF (LOKI_INCLUDE_DIR)
IF (LOKI_INCLUDE_DIR)
SET(LOKI_FOUND TRUE)
SET (LOKI_LIB_DIR ${LOKI_INCLUDE_DIR}../lib )
# Copy from source to TPDIST
MESSAGE(STATUS ${LOKI_INCLUDE_DIR})
FILE(COPY ${LOKI_INCLUDE_DIR}/loki/ DESTINATION ${TPDIST}/include/loki/)
SET(LOKI_INCLUDE_DIR ${TPDIST}/include CACHE PATH "" FORCE)
ENDIF()
ENDIF()
IF (LOKI_FOUND)
IF (NOT Loki_FIND_QUIETLY)
MESSAGE(STATUS "Found Loki: ${LOKI_INCLUDE_DIR}")
ENDIF (NOT Loki_FIND_QUIETLY)
ELSE(LOKI_FOUND)
IF (Loki_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Loki")
ENDIF (Loki_FIND_REQUIRED)
ENDIF (LOKI_FOUND)
MESSAGE(STATUS "Found Loki: ${LOKI_INCLUDE_DIR}")
ELSE()
MESSAGE(FATAL_ERROR "Could not find Loki")
ENDIF()
MARK_AS_ADVANCED(LOKI_INCLUDE_DIR)
MARK_AS_ADVANCED(LOKI_LIB_DIR)
......@@ -32,50 +32,18 @@ SET(NEKTAR++_VERSION "@NEKTAR_VERSION@")
SET(NEKTAR++_ROOT_DIR "@CMAKE_INSTALL_PREFIX@")
SET(NEKTAR++_INCLUDE_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_INCLUDE_DIR@")
SET(NEKTAR++_LIBRARY_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_LIB_DIR@")
SET(NEKTAR++_DEFINITIONS "")
SET(NEKTAR++_LIBRARIES SolverUtils MultiRegions LocalRegions SpatialDomains StdRegions LibUtilities)
SET(NEKTAR++_DEFINITIONS @NEKTAR_DEFINITIONS@)
SET(NEKTAR++_LIBRARIES @NEKTAR++_LIBRARIES@)
SET(NEKTAR++_TP_INCLUDE_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_INCLUDE_DIR@/ThirdParty")
SET(NEKTAR++_TP_LIBRARIES "")
SET(NEKTAR++_TP_LIBRARY_DIRS "")
# add Nektar++_ROOT_DIR to the cmake search path, so Nektars custom FindXXX modules can be used
# add Nektar++_ROOT_DIR to the cmake search path, so Nektars custom FindXXX
# modules can be used
SET(CMAKE_MODULE_PATH ${NEKTAR++_ROOT_DIR} ${CMAKE_MODULE_PATH})
# set nektars config variables
SET(NEKTAR_USE_MEMORY_POOLS "@NEKTAR_USE_MEMORY_POOLS@")
IF( NEKTAR_USE_MEMORY_POOLS )
SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -DNEKTAR_MEMORY_POOL_ENABLED")
ENDIF( NEKTAR_USE_MEMORY_POOLS )
SET(NEKTAR_USE_SMV "@NEKTAR_USE_SMV@")
IF( NEKTAR_USE_SMV )
SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -DNEKTAR_USING_SMV")
ENDIF( NEKTAR_USE_SMV )
SET(NEKTAR_USE_ACML "@NEKTAR_USE_ACML@")
SET(NEKTAR_USE_ACML "@NEKTAR_USE_EXPRESSION_TEMPLATES@")
IF( NEKTAR_USE_EXPRESSION_TEMPLATES )
SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -DNEKTAR_USE_EXPRESSION_TEMPLATES")
ENDIF( NEKTAR_USE_EXPRESSION_TEMPLATES )
SET(NEKTAR_USE_WIN32_LAPACK "@NEKTAR_USE_WIN32_LAPACK@")
IF( NEKTAR_USE_WIN32_LAPACK )
GET_FILENAME_COMPONENT(WIN32_BLAS_PATH "@WIN32_BLAS@" PATH)
GET_FILENAME_COMPONENT(WIN32_LAPACK_PATH "@WIN32_LAPACK@" PATH)
ENDIF( NEKTAR_USE_WIN32_LAPACK )
SET(NEKTAR_USE_BLAS_LAPACK "@NEKTAR_USE_BLAS_LAPACK@")
IF( NEKTAR_USE_BLAS_LAPACK )
SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS")
ENDIF( NEKTAR_USE_BLAS_LAPACK )
SET(NEKTAR_FULL_DEBUG "@NEKTAR_FULL_DEBUG@")
IF ( NEKTAR_FULL_DEBUG )
SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -DNEKTAR_FULLDEBUG")
ENDIF( NEKTAR_FULL_DEBUG)
# Set up Boost and other ThirdParty include directories.
SET(Boost_INCLUDE_DIRS "@Boost_INCLUDE_DIRS@")
SET(Boost_LIBRARIES "@Boost_LIBRARIES@")
SET(Boost_LIBRARY_DIRS "@Boost_LIBRARY_DIRS@")
......@@ -92,10 +60,10 @@ IF( NEKTAR_USE_MPI )
SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -DNEKTAR_USE_MPI")
ENDIF( NEKTAR_USE_MPI )
SET(LOKI_ADDITIONAL_INCLUDE_DIRS "@LOKI_INCLUDE_DIR@")
SET(NEKTAR++_TP_INCLUDE_DIRS ${NEKTAR++_TP_INCLUDE_DIRS} ${LOKI_ADDITIONAL_INCLUDE_DIRS})
SET(LOKI_INCLUDE_DIRS "@LOKI_CONFIG_INCLUDE_DIR@")
SET(NEKTAR++_TP_INCLUDE_DIRS ${NEKTAR++_TP_INCLUDE_DIRS} ${LOKI_INCLUDE_DIRS})
SET(TINYXML_ADDITIONAL_INCLUDE_DIRS "@TINYXML_BASE@")
SET(TINYXML_INCLUDE_DIRS "@TINYXML_BASE@")
SET(NEKTAR++_TP_INCLUDE_DIRS ${NEKTAR++_TP_INCLUDE_DIRS} ${TINYXML_ADDITIONAL_INCLUDE_DIRS})
SET(FFTW_INCLUDE_DIR "@FFTW_INCLUDE_DIR@")
......
# Loki
OPTION(THIRDPARTY_BUILD_LOKI
"Build TinyXML library from ThirdParty." ON)
OPTION(THIRDPARTY_BUILD_LOKI
"Build Loki library from ThirdParty." ON)
IF (THIRDPARTY_BUILD_LOKI)
IF (NOT EXISTS ${TPSRC}/loki-0.1.3.tar.bz2)
file(DOWNLOAD ${TPURL}/loki-0.1.3.tar.bz2 ${TPSRC}/loki-0.1.3.tar.bz2)
FILE(DOWNLOAD ${TPURL}/loki-0.1.3.tar.bz2 ${TPSRC}/loki-0.1.3.tar.bz2)
ENDIF()
execute_process(
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${TPSRC}/loki-0.1.3.tar.bz2
WORKING_DIRECTORY ${TPSRC}
)
)
ENDIF()
INCLUDE (FindLoki)
INCLUDE_DIRECTORIES(SYSTEM ${LOKI_INCLUDE_DIR})
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