xref: /phasta/phastaIO/CMakeLists.txt (revision 98d6580a8ecca5add329d7adadb1985835e1e604)
1project(phastaIO)
2enable_language(CXX)
3
4
5if(NOT PHASTA_SKIP_MPI_CHECK)
6find_package(MPI REQUIRED)
7endif()
8include_directories(${MPI_C_INCLUDE_PATH})
9# collect all the source files
10include(FortranCInterface)
11FortranCInterface_VERIFY(CXX)
12FortranCInterface_Header(FCMangle.h)
13include_directories("${phastaIO_BINARY_DIR}")
14add_definitions(-DMPICH_SKIP_MPICXX)
15add_definitions(-DOMPI_SKIP_MPICXX=1)
16set(SRC_FILES phiotmrc.cc phastaIO.cc phiompi.c)
17if(NOT PHASTA_CHEF_ENABLED)
18  set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/phSolver/modules)
19  set(SRC_FILES ${SRC_FILES}
20    phiotimer_empty/phiotimer_empty.cc
21    phiotimer_empty/phiotimer_empty.f)
22  include_directories(phiotimer_empty)
23endif()
24
25ADD_LIBRARY(phastaIO ${SRC_FILES})
26target_link_libraries(phastaIO PRIVATE ${MPI_C_LIBRARIES})
27if(PHASTA_CHEF_ENABLED)
28  TARGET_LINK_LIBRARIES(phastaIO PUBLIC SCOREC::ph)
29endif()
30