0

我需要在我的项目中为不同的 python 文件组创建不同的目标。任何目标都可以依赖于一组或多组目标。

在 make install 期间,与特定目标关联的文件,应复制到某个构建文件夹路径。我知道我们可以使用以下命令显式复制 python 文件。

install(FILES file1.py DESTINATION ${BUILD_FILES_INSTALL_PATH}

但是,我不能根据我的要求明确给出文件列表。有没有办法在安装(或任何其他 CMake)命令中安装带有目标(用于一组 python 文件)名称的 python 文件?

例如:如果有 2 个目标 - target1、target2(都用于不同的 python 文件集)

我使用以下命令为特定的 python 文件创建了目标:

add_custom_target(target1 DEPENDS file1.py file2.py)

add_custom_target(target2 DEPENDS file3.py)

target1 依赖于 target2

那么,在 make install 期间,是否有任何方法可以复制与 target1 关联的 python 文件(并且 target2 因为 target1 依赖于 target2),只需在 install 命令中给出 target1 ?

谢谢你。

4

0 回答 0