我有一个 CMake 项目,它生成一个 Visual Studio 解决方案及其关联的项目文件。我注意到项目中生成了很多“CustomBuild”规则,如果由于某种原因项目不是最新的,这些规则似乎会重新运行 CMake:
<ItemGroup>
<CustomBuild Include="foo\CMakeLists.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Building Custom Rule S:/foo/CMakeLists.txt</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">setlocal
"C:\...\cmake.exe" -HS:/foo -BS:/foo/msvc-10.0 --check-stamp-file S:\foo\msvc-10.0\CMakeFiles\generate.stamp
...
</CustomBuild>
</ItemGroup>
有没有办法告诉 CMake 禁用生成这些自定义构建规则?我的目标是让 CMake 在不附加到 CMake 的情况下生成解决方案/项目文件。
谢谢!