Commit bf8c6a0f authored by Valeriu Codreanu's avatar Valeriu Codreanu
Browse files

added CMake build structure for the example in unstructured grids

parent a0f640ec
# ==================================================================================================
# This file is part of the CodeVault project. The project is licensed under Apache Version 2.0.
# CodeVault is part of the EU-project PRACE-4IP (WP7.3.C).
#
# Author(s):
# Evghenii Gaburov <evghenii.gaburov@surfsara.nl>
#
# ==================================================================================================
# CMake project
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
project("8_unstructured")
include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/common.cmake)
# ==================================================================================================
# Dwarf 8: Unstructured grids
message("--------------------")
message("Dwarf 8: Unstructured grids:")
message("--------------------")
set(DWARF_PREFIX 8_unstructured) # The prefix of the name of the binaries produced
# Add the examples
add_subdirectory(halo_exchange)
# ==================================================================================================
# Packages are optional: if they are not present, certain code samples are not compiled
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
find_package(MPI) # Built-in in CMake
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/common.cmake)
# ==================================================================================================
if ("${DWARF_PREFIX}" STREQUAL "")
set(DWARF_PREFIX 8_unstructured)
endif()
set(NAME ${DWARF_PREFIX}_halo_exchange)
# C compiler settings
find_package(Common)
if (MPI_FOUND)
cmake_policy(SET CMP0003 OLD)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
include_directories(${MPI_INCLUDE_PATH})
add_executable(${NAME} main.c configuration.c mpicomm.c mpitypes.c box.c field.c mesh.c)
target_link_libraries(${NAME} ${MPI_LIBRARIES} stdc++)
install(TARGETS ${NAME} DESTINATION bin)
message("** Enabling '${NAME}': with MPI")
else()
message("## Skipping '${NAME}': no MPI support found")
# dummy_install(${NAME} "MPI")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS}")
unset(NAME)
# ==================================================================================================
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment