jwalk
jwalk

Reputation: 1147

Detach CMake references from the generated solution/project files?

I have a CMake project which generates a Visual Studio solution and its associated project files. I've noticed that there are a lot of "CustomBuild" rules generated in the projects which seem to re-run CMake if for some reason the projects are not up-to-date:

  <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>

Is there a way to tell CMake to disable generating these custom build rules? My goal is to have CMake generate solution/project files without still being attached to CMake.

Thanks!

Upvotes: 1

Views: 745

Answers (1)

Guillaume
Guillaume

Reputation: 10971

No, that can't be done.

Moreover, those rules are not only for re-generating project files if they're not up-to-date anymore. For instance, there's also the CMake command mode that provides portability for copying files, directories, md5 sums and many other nice things.

The bakefile project tried to do that (generating independent project files), but it seems it's pretty much dead now.

Upvotes: 2

Related Questions