CMakeLists.txt 2.06 KB
Newer Older
1 2 3
# A minimum version for cmake command is required.
cmake_minimum_required(VERSION 3.8)

4
project( "MoReFEM_CMAKE")
5

6
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
7

8 9 10
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
11 12 13

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

14
MESSAGE("Module path: ${CMAKE_MODULE_PATH}")
15 16 17 18

include(CustomCommands)
include(Paths)

19 20
MESSAGE("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")

21
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --my-debug-flags")
22

23
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
24
                    ${CMAKE_CURRENT_SOURCE_DIR}/Sources/ThirdParty/Source/Tclap/include /
25 26 27 28 29 30 31 32 33 34
                    ${OPS_DIR} /
                    ${SELDON_DIR} /
                    ${OPEN_MPI_INCL_DIR} /
                    ${PETSC_GENERAL_INCL_DIR} /
                    ${PETSC_DEBUG_INCL_DIR} /
                    ${PARMETIS_INCL_DIR} /
                    ${LUA_INCL_DIR} /
                    ${BOOST_INCL_DIR}                    
                    )

35 36 37
# TO complete for release mode! (see SCons)
add_definitions(-DOPS_WITH_EXCEPTION)
add_definitions(-DSELDON_WITH_LAPACK -DSELDON_WITH_LAPACK  -DSELDON_WITH_BLAS -DSELDON_WITH_COMPILED_LIBRARY -DSELDON_CHECK_BOUNDS -DSELDON_CHECK_DIMENSIONS)
38

39 40 41 42 43 44 45 46

morefem_find_library(LIB_OPEN_MPI "mpi" ${OPEN_MPI_LIB_DIR} "Openmpi")
morefem_find_library(LIB_OPEN_MPI_CXX "mpi_cxx" ${OPEN_MPI_LIB_DIR} "Openmpi (C++)")
morefem_find_library(LIB_PETSC "petsc" ${PETSC_DEBUG_LIB_DIR} "Petsc")
morefem_find_library(LIB_PARMETIS "parmetis" ${PARMETIS_LIB_DIR} "Parmetis")
morefem_find_library(LIB_LUA "lua" ${LUA_LIB_DIR} "Lua")
morefem_find_library(LIB_BOOST_FILESYSTEM "boost_filesystem" ${BOOST_LIB_DIR} "Boost filesystem")
morefem_find_library(LIB_BOOST_SYSTEM "boost_system" ${BOOST_LIB_DIR} "Boost system")
47 48 49 50 51 52 53 54 55 56 57 58 59

set(MOREFEM_COMMON_DEP
    ${LIB_OPEN_MPI}
    ${LIB_OPEN_MPI_CXX}
    ${LIB_PETSC} 
    ${LIB_PARMETIS} 
    ${LIB_LUA} 
    ${LIB_BOOST_FILESYSTEM} 
    ${LIB_BOOST_SYSTEM}                      
    "-framework Accelerate" 
)


60 61
add_subdirectory(Sources)
      
62 63