UseSWIG: Do not use MAIN_DEPENDENCY on custom commands (#15480)

Add the dependency on the main swig input source file as a normal
DEPENDS option.  We cannot use MAIN_DEPENDENCY because if there are
multiple target languages then multiple custom commands would want to
use the same MAIN_DEPENDENCY, but at most one custom command may specify
a given source file as its MAIN_DEPENDENCY.  Exposed by a CMP0057
warning.
This commit is contained in:
Felix Schwitzer 2015-03-26 21:03:20 +01:00 committed by Brad King
parent c1f8c6cdf9
commit b372a99a13
1 changed files with 1 additions and 2 deletions

View File

@ -204,8 +204,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
${swig_include_dirs}
-o "${swig_generated_file_fullname}"
"${swig_source_file_fullname}"
MAIN_DEPENDENCY "${swig_source_file_fullname}"
DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
DEPENDS "${swig_source_file_fullname}" ${SWIG_MODULE_${name}_EXTRA_DEPS}
COMMENT "Swig source")
set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files}
PROPERTIES GENERATED 1)