| 1 |
# Require CMake 2.8 |
| 2 |
cmake_minimum_required(VERSION 3.5) |
| 3 |
|
| 4 |
# Find DOLFIN config file (not used here, but check that benchmarks will be |
| 5 |
# able to find it |
| 6 |
find_package(DOLFIN REQUIRED) |
| 7 |
|
| 8 |
# If config file is found, add all demo sub-directories, else print helper |
| 9 |
# message |
| 10 |
if (DOLFIN_FOUND) |
| 11 |
|
| 12 |
# Build list of all cpp directories |
| 13 |
file( GLOB_RECURSE list "main.cpp") |
| 14 |
list( SORT list ) |
| 15 |
string(REGEX REPLACE "/main.cpp" "" list "${list}") |
| 16 |
|
| 17 |
# Add each C++ code directory |
| 18 |
foreach (cpp_dir ${list}) |
| 19 |
#message(STATUS "Add C++ benchmark: ${cpp_dir}") |
| 20 |
add_subdirectory(${cpp_dir}) |
| 21 |
endforeach() |
| 22 |
|
| 23 |
# Add fem/speedup/cpp manually (no main.cpp so not picked up automatically) |
| 24 |
add_subdirectory(fem/speedup/cpp) |
| 25 |
|
| 26 |
else() |
| 27 |
|
| 28 |
message(STATUS "Could not locate DOLFINConfig.cmake file. Did you do 'make install' for the DOLFIN library and set the appropriate paths (source <build_dir>/dolfin.conf)?") |
| 29 |
|
| 30 |
endif() |