CMakeLists.txt 1.35 KB
Newer Older
1
cmake_minimum_required(VERSION 3.8)
2
3
4
5
6
7
8

project(PAPYRUS)

set(PAPYRUS_VERSION_MAJOR 1)
set(PAPYRUS_VERSION_MINOR 0)
set(PAPYRUS_VERSION_PATCH 0)

9
10
11
12
13
14
15
set(PAPYRUS_USE_FORTRAN ON CACHE BOOL "Enable support for Fortran 90")
MESSAGE (STATUS "PAPYRUS_USE_FORTRAN ${PAPYRUS_USE_FORTRAN}")

if(PAPYRUS_USE_FORTRAN)
    enable_language(Fortran)
endif()

16
find_package(MPI REQUIRED)
Kim, Jungwon's avatar
Kim, Jungwon committed
17
18
MESSAGE (STATUS "MPI_CXX_COMPILER ${MPI_CXX_COMPILER}")
MESSAGE (STATUS "MPI_C_COMPILER ${MPI_C_COMPILER}")
Kim, Jungwon's avatar
Kim, Jungwon committed
19
MESSAGE (STATUS "MPI_Fortran_COMPILER ${MPI_Fortran_COMPILER}")
20

Kim, Jungwon's avatar
Kim, Jungwon committed
21
if ("${MPI_C_COMPILER}" STREQUAL "MPI_C_COMPILER-NOTFOUND")
Kim, Jungwon's avatar
Kim, Jungwon committed
22
    MESSAGE (STATUS "NO COMPILE WITH $ENV{SPACK_CC}")
Kim, Jungwon's avatar
Kim, Jungwon committed
23
    set(CMAKE_C_COMPILER "$ENV{SPACK_CC}")
Kim, Jungwon's avatar
Kim, Jungwon committed
24
else()
Kim, Jungwon's avatar
Kim, Jungwon committed
25
    MESSAGE (STATUS "YES COMPILE WITH ${MPI_C_COMPILER}")
26
27
    set(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
endif()
Kim, Jungwon's avatar
Kim, Jungwon committed
28
29
30

MESSAGE (STATUS "COMPILE WITH CMAKE_C_COMPILER ${CMAKE_C_COMPILER}")

Kim, Jungwon's avatar
Kim, Jungwon committed
31
if ("${MPI_CXX_COMPILER}" STREQUAL "MPI_CXX_COMPILER-NOTFOUND")
Kim, Jungwon's avatar
Kim, Jungwon committed
32
    set(CMAKE_CXX_COMPILER "$ENV{SPACK_CXX}")
Kim, Jungwon's avatar
Kim, Jungwon committed
33
else()
34
35
    set(CMAKE_CXX_COMPILER "${MPI_CXX_COMPILER}")
endif()
36
if ("${MPI_Fortran_COMPILER}" STREQUAL "MPI_Fortran_COMPILER-NOTFOUND")
Kim, Jungwon's avatar
Kim, Jungwon committed
37
    set(CMAKE_Fortran_COMPILER "$ENV{SPACK_FC}")
38
39
40
else()
    set(CMAKE_Fortran_COMPILER "${MPI_Fortran_COMPILER}")
endif()
41
42
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
43
44
45
46
47

include(CTest)

add_subdirectory(include)
add_subdirectory(kv)