From d20e5d8c2fd0c37e4bb74449ab388fc9284478d1 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 12 Jan 2017 09:06:48 -0600 Subject: [PATCH] CMake: let *_cuda targets depend on *.inst targets --- cmake/macros/macro_expand_instantiations.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/macros/macro_expand_instantiations.cmake b/cmake/macros/macro_expand_instantiations.cmake index 775f1da261..02ec5019b1 100644 --- a/cmake/macros/macro_expand_instantiations.cmake +++ b/cmake/macros/macro_expand_instantiations.cmake @@ -23,9 +23,9 @@ # # target # -# where target.${build_type} will depend on the generation of all .inst -# files, to ensure that all .inst files are generated prior to -# compiling. +# where target.${build_type} (and if present) target.${build_type}_cuda +# will depend on the generation of all .inst files, to ensure that all +# .inst files are generated prior to compiling. # # inst_in_files # @@ -58,7 +58,7 @@ MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files) < ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} > ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}.tmp COMMAND ${CMAKE_COMMAND} - ARGS -E rename + ARGS -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}.tmp ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} ) @@ -78,7 +78,12 @@ MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files) # FOREACH(_build ${DEAL_II_BUILD_TYPES}) STRING(TOLOWER ${_build} _build_lowercase) + ADD_DEPENDENCIES(${_target}.${_build_lowercase} ${_target}.inst) + + IF(TARGET ${_target}.${_build_lowercase}_cuda) + ADD_DEPENDENCIES(${_target}.${_build_lowercase}_cuda ${_target}.inst) + ENDIF() ENDFOREACH() ENDMACRO() -- 2.39.5