summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..49f6dd1
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+project(heatkernel_mpi)
+
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_definitions(-DDEBUG)
+ remove_definitions(-DNDEBUG)
+endif()
+
+include(TestBigEndian)
+test_big_endian(BIG_ENDIAN)
+if(BIG_ENDIAN)
+ add_definitions(-DBIGENDIAN)
+endif()
+
+find_package(MPI REQUIRED)
+include_directories(include ${MPI_INCLUDE_PATH})
+link_directories(${MPI_LIBRARIES})
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_COMPILE_FLAGS} -Wall -pedantic -Wextra -std=c++14")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_LINK_FLAGS}")
+
+add_executable(heatkernel-mpi
+ src/main.cpp
+ include/misc.hpp
+ include/pd.hpp)
+
+target_link_libraries(heatkernel-mpi ${MPI_LIBRARIES} ${Boost_LIBRARIES})