Nektar++Config.cmake.in 2.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# - Nektar++ Config File
#
# Use this module by invoking find_package with the form:
#  FIND_PACKAGE(Nektar++
#    [version] [EXACT]      # Minimum or EXACT version e.g. 1.36.0
#    [REQUIRED]             # Fail with error if Nektar++ is not found
#    )                      #
#
# This sets the following variables:
#  Nektar++_FOUND             - True if headers and requested libraries were found
#  Nektar++_VERSION           - Nektar++_VERSION
#  Nektar++_INCLUDE_DIRS      - Nektar++ include directories
#  Nektar++_LIBRARY_DIRS      - Link directories for Nektar++ libraries
#  Nektar++_DEFINITIONS       - Nektar++ build flags
#  Nektar++_LIBRARIES         - Nektar++ component libraries to be linked
#
#  Nektar++_TP_INCLUDE_DIRS   - Nektar++ ThirdParty include directories
#  Nektar++_TP_LIBRARY_DIRS   - Link directories for Nektar++ ThirdParty libraries
#  Nektar++_TP_LIBRARIES      - Nektar++ ThirdParty libraries to be linked
#
# Example Use:
#  FIND_PACKAGE(Nektar++ REQUIRED)
#  ADD_DEFINITIONS(${NEKTAR++_DEFINITIONS})
#  INCLUDE_DIRECTORIES(${NEKTAR++_INCLUDE_DIRS} ${NEKTAR++_TP_INCLUDE_DIRS})
#  LINK_DIRECTORIES(${NEKTAR++_LIBRARY_DIRS} ${NEKTAR++_TP_LIBRARY_DIRS})
#  TARGET_LINK_LIBRARIES(${ProjectName} ${NEKTAR++_LIBRARIES} ${NEKTAR++_TP_LIBRARIES})
#

# set basic variables
30
SET(NEKTAR++_FOUND "ON")
31
SET(NEKTAR++_VERSION "@NEKTAR_VERSION@")
32
SET(NEKTAR++_ROOT_DIR "@CMAKE_INSTALL_PREFIX@")
33
SET(NEKTAR++_INCLUDE_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_INCLUDE_DIR@")
34
SET(NEKTAR++_LIBRARY_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_LIB_DIR@")
35 36
SET(NEKTAR++_DEFINITIONS @NEKTAR_DEFINITIONS@)
SET(NEKTAR++_LIBRARIES @NEKTAR++_LIBRARIES@)
37

38 39 40 41 42 43 44 45 46 47
SET(NEKTAR++_TP_INCLUDE_DIRS
    "${NEKTAR++_ROOT_DIR}/@NEKTAR_INCLUDE_DIR@/ThirdParty"
    "@TINYXML_CONFIG_INCLUDE_DIR@"
    "@LOKI_CONFIG_INCLUDE_DIR@"
    # Metis is in main TP include directory
    "@SCOTCH_CONFIG_INCLUDE_DIR@"
    "@Boost_CONFIG_INCLUDE_DIR@"
    "@ZLIB_CONFIG_INCLUDE_DIR@"
    "@FFTW_CONFIG_INCLUDE_DIR@"
    "@ARPACK_INCLUDE_DIR@"
Dave Moxey's avatar
Dave Moxey committed
48 49
    "@MPI_INCLUDE_PATH@"
    "@PETSC_CONFIG_INCLUDE_DIR@"
50 51 52 53
    "@VTK_INCLUDE_DIRS@"
    )
SET(NEKTAR++_TP_LIBRARIES @Boost_LIBRARIES@ "@MPI_LIBRARY@" "@MPI_EXTRA_LIBRARY@")
SET(NEKTAR++_TP_LIBRARY_DIRS "@Boost_CONFIG_LIBRARY_DIR@")
54

55
SET(NEKTAR_USE_MPI "@NEKTAR_USE_MPI@")
56 57 58
IF (NEKTAR_USE_MPI)
    LIST(APPEND NEKTAR++_DEFINITIONS -DNEKTAR_USE_MPI)
ENDIF ()
59

60
# find and add Nektar++ libraries
61
INCLUDE(${NEKTAR++_LIBRARY_DIRS}/cmake/Nektar++Libraries.cmake)
62

63
# platform dependent options
64
if(${CMAKE_SYSTEM} MATCHES "Linux.*")
65
    set(NEKTAR++_TP_LIBRARIES ${NEKTAR++_TP_LIBRARIES} rt)
66
    SET(NEKTAR++_DEFINITIONS "${NEKTAR++_DEFINITIONS} -pthread")
67
endif(${CMAKE_SYSTEM} MATCHES "Linux.*")