diff --git a/cmake/Modules/OpmFiles.cmake b/cmake/Modules/OpmFiles.cmake index 40460c84..eda2598f 100644 --- a/cmake/Modules/OpmFiles.cmake +++ b/cmake/Modules/OpmFiles.cmake @@ -32,6 +32,7 @@ macro (opm_sources opm) set (TEST_SOURCE_FILES) set (TEST_DATA_FILES) set (PUBLIC_HEADER_FILES) + set (PROGRAM_SOURCE_FILES) # read the list of components from this file; it should set the above # lists (which are generic names) @@ -55,6 +56,9 @@ macro (opm_sources opm) foreach (_file IN LISTS EXAMPLE_SOURCE_FILES) list (APPEND examples_SOURCES ${PROJECT_SOURCE_DIR}/${_file}) endforeach (_file) + foreach (_file IN LISTS PROGRAM_SOURCE_FILES) + list (APPEND examples_SOURCES_DIST ${PROJECT_SOURCE_DIR}/${_file}) + endforeach (_file) # identify pre-compile header; if the project is called opm-foobar, # then it should be in opm/foobar/opm-foobar-pch.hpp diff --git a/cmake/Modules/OpmSatellites.cmake b/cmake/Modules/OpmSatellites.cmake index fdc2b328..9b0d0c8f 100644 --- a/cmake/Modules/OpmSatellites.cmake +++ b/cmake/Modules/OpmSatellites.cmake @@ -95,6 +95,15 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp) ) endif (CMAKE_VERSION VERSION_LESS "2.8.4") endif(NOT "${test_regexp}" STREQUAL "") + + # if this program on the list of files that should be distributed? + # we check by the name of the source file + list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util) + if (NOT (_is_util EQUAL -1)) + install (TARGETS ${_sat_NAME} RUNTIME + DESTINATION bin/ + ) + endif (NOT (_is_util EQUAL -1)) endforeach (_sat_FILE) endmacro (opm_compile_satellites opm prefix)