浏览代码

ExternalData: Attach download rules to content links in IDEs

Each data file to be created in the build tree corresponds one-to-one with
a raw file or content link in the source tree.  Use the MAIN_DEPENDENCY of
add_custom_command to attach the build rule to the source tree file.  This
looks much nicer in the IDE project file browser and avoids ".rule" files.
Brad King 13 年之前
父节点
当前提交
1fd8d017e6
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Modules/ExternalData.cmake

+ 2 - 2
Modules/ExternalData.cmake

@@ -191,7 +191,7 @@ function(ExternalData_add_target target)
                                  -DExternalData_ACTION=local
                                  -DExternalData_ACTION=local
                                  -DExternalData_CONFIG=${config}
                                  -DExternalData_CONFIG=${config}
                                  -P ${_ExternalData_SELF}
                                  -P ${_ExternalData_SELF}
-        DEPENDS "${name}"
+        MAIN_DEPENDENCY "${name}"
         )
         )
       list(APPEND files "${file}")
       list(APPEND files "${file}")
     endif()
     endif()
@@ -222,7 +222,7 @@ function(ExternalData_add_target target)
                                  -DExternalData_CONFIG=${config}
                                  -DExternalData_CONFIG=${config}
                                  -P ${_ExternalData_SELF}
                                  -P ${_ExternalData_SELF}
         # Update whenever the object hash changes.
         # Update whenever the object hash changes.
-        DEPENDS "${name}${ext}"
+        MAIN_DEPENDENCY "${name}${ext}"
         )
         )
       list(APPEND files "${file}${stamp}")
       list(APPEND files "${file}${stamp}")
     endif()
     endif()