-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
82 lines (61 loc) · 2.4 KB
/
CMakeLists.txt
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
IF (TRIBITS_PROCESSING_PACKAGE)
#
# Processing TriBITS package!
#
#
# A) Define the package
#
TRIBITS_PACKAGE(xSDKTrilinos)
#
# B) Set up package-specific options
#
# ToDo: Add options when needed
#
# C) Add the libraries, tests, and examples
#
TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.hpp)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_PETSC)
IF (${PACKAGE_NAME}_ENABLE_PETSC)
ADD_SUBDIRECTORY(petsc)
ENDIF()
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_HYPRE)
IF (${PACKAGE_NAME}_ENABLE_HYPRE)
ADD_SUBDIRECTORY(hypre)
ENDIF()
TRIBITS_EXCLUDE_AUTOTOOLS_FILES()
#
# D) Do standard postprocessing
#
TRIBITS_PACKAGE_POSTPROCESS()
ELSE(TRIBITS_PROCESSING_PACKAGE)
#
# Processing as a TriBITS project
#
# This CMakeLists.txt file is being processed as the TriBITS projects's base
# CMakeLists.txt file! (See comments at bottom of this file.)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake")
PROJECT(${PROJECT_NAME} NONE)
SET(Trilinos_INSTALL_DIR "" CACHE PATH "Path to base Trilinos installation")
IF ("${Trilinos_INSTALL_DIR}" STREQUAL "")
MESSAGE(FATAL_ERROR "Must set Trilinos_INSTALL_DIR!")
ENDIF()
SET(CMAKE_PREFIX_PATH ${Trilinos_INSTALL_DIR} ${CMAKE_PREFIX_PATH})
FIND_PACKAGE(TriBITS REQUIRED)
SET(${PROJECT_NAME}_TRIBITS_DIR "${TRIBITS_DIR}"
CACHE PATH "By default, use TriBITS in Trilinos install tree")
INCLUDE("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")
SET(TEUCHOS_STD_UNIT_TEST_MAIN
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Teuchos_StandardParallelUnitTestMain.cpp")
FIND_PACKAGE(Trilinos CONFIG REQUIRED)
SET(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER} CACHE STRING "From TrilinosConfig.cmake")
SET(CMAKE_C_COMPILER ${Trilinos_C_COMPILER} CACHE STRING "From TrilinosConfig.cmake")
SET(CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER} CACHE STRING "From TrilinosConfig.cmake")
SET(CMAKE_CXX_COMPILER_FLAGS ${Trilinos_CXX_COMPILER_FLAGS} CACHE STRING "From TrilinosConfig.cmake")
SET(CMAKE_C_COMPILER_FLAGS ${Trilinos_C_COMPILER_FLAGS} CACHE STRING "From TrilinosConfig.cmake")
SET(CMAKE_Fortran_COMPILER_FLAGS ${Trilinos_Fortran_COMPILER_FLAGS} CACHE STRING "From TrilinosConfig.cmake")
SET(xSDKTrilinos_EXTRA_LINK_FLAGS ${Trilinos_EXTRA_LD_FLAGS} CACHE STRING "From TrilinosConfig.cmake")
SET(CMAKE_AR ${Trilinos_AR} CACHE FILEPATH "From TrilinosConfig.cmake")
TRIBITS_PROJECT()
ENDIF(TRIBITS_PROCESSING_PACKAGE)