added: option to install benchmarks

defaults to off. used for packaging
This commit is contained in:
Arne Morten Kvarving 2015-10-20 09:51:08 +02:00
parent e337895692
commit 127ea79494
2 changed files with 10 additions and 1 deletions

View File

@ -18,6 +18,7 @@ cmake_minimum_required (VERSION 2.8)
set( OPM_COMMON_ROOT "" CACHE PATH "Root directory containing OPM related cmake modules")
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
option(INSTALL_BENCHMARKS "Install benchmark applications?" OFF)
if(NOT OPM_COMMON_ROOT)
find_package(opm-common QUIET)
@ -176,4 +177,7 @@ foreach(benchmark ${OPM_BENCHMARKS})
add_custom_command(TARGET benchmarks-static POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/static/benchmarks/src/benchmarks-static-build/bin/${benchmark}
${CMAKE_BINARY_DIR}/bin/${benchmark}-static)
if(INSTALL_BENCHMARKS)
install(TARGETS ${benchmark} DESTINATION bin)
endif()
endforeach()

View File

@ -50,4 +50,9 @@ endmacro (opm_pack_stone)
opm_pack_stone (upscale_relperm_benchmark)
opm_pack_case (upscale_relperm_benchmark benchmark20)
add_custom_target(benchmarks DEPENDS upscale_relperm_benchmark)
if(INSTALL_BENCHMARKS)
add_custom_target(benchmarks ALL DEPENDS upscale_relperm_benchmark)
set_target_properties(upscale_relperm_benchmark PROPERTIES EXCLUDE_FROM_ALL 0)
else()
add_custom_target(benchmarks DEPENDS upscale_relperm_benchmark)
endif()