X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/4d1416455c49f0ba19954ca80a72b72f9dfcd33e..c819c7a5996c18a6b1c5501c1984245840ddc8ca:/o815/CMakeLists.txt?ds=sidebyside diff --git a/o815/CMakeLists.txt b/o815/CMakeLists.txt index 49fa081..60daa3b 100644 --- a/o815/CMakeLists.txt +++ b/o815/CMakeLists.txt @@ -2,12 +2,19 @@ cmake_minimum_required(VERSION 2.8) project(o815) -find_package(MPI REQUIRED) -set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS}) -set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS}) -include_directories(${MPI_INCLUDE_PATH} ../) +if(NOT DEFINED ENV{MPI_DISABLED}) + find_package(MPI REQUIRED) + set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS}) + set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS}) + include_directories(${MPI_INCLUDE_PATH}) +else() + message("O815: MPI support is disabled!") +endif() SET(CMAKE_BUILD_TYPE Release) add_library(o815 o815.cpp obs.cpp sim.cpp) -target_link_libraries(o815 ${MPI_LIBRARIES} lat_paraq lat_writeout lat_hypercache lat_progress) +target_link_libraries(o815 ${MPI_LIBRARIES} lat_paraq lat_writeout lat_hypercache lat_progress lat_datread) +if(DEFINED ENV{MPI_DISABLED}) + set_target_properties(o815 PROPERTIES COMPILE_DEFINITIONS "MPI_DISABLED") +endif()