GDCM vtk msvc2013 - cmake

I have successfully built VTK 7.1.1 and Qt 5.3.2 with MSVC2013. I have downloaded GCDM and configured with Cmake with no shared_lib. I can build the ALL_BUILD project in GDCM solution configured with CMake, but the INSTALL project can not be built and it gives me this error:
1>------ Build started: Project: vtkgdcm, Configuration: Debug x64 ------
1> vtkImageMapToColors16.cxx
1>c:\vtk\gdcm-2.6.7\utilities\vtk\vtkImageMapToColors16.h(116): error C2555: 'vtkImageMapToColors16::GetMTime': overriding virtual function return type differs and is not covariant from 'vtkObject::GetMTime'
1> C:\VTK\VTK-7.1.1\Common\Core\vtkObject.h(107) : see declaration of 'vtkObject::GetMTime'
2>------ Build started: Project: INSTALL, Configuration: Debug x64 ------
2> -- Install configuration: "Debug"
2> CMake Error at cmake_install.cmake:31 (file):
2> file INSTALL cannot find "C:/VTK/bin/../../../bin/vtkCommonCore-7.1.dll".
2>
2>
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: The command "setlocal
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmErrorLevel
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: exit /b %1
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmDone
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :VCEnd" exited with code 1.
========== Build: 0 succeeded, 2 failed, 17 up-to-date, 0 skipped ==========
It says it can not find vtkCommonCore-7.1.dll ,and that file does not exist on my vtk, but the .lib version of the file exists.
Can anybody save me?

I solved my problem this way:
First, I built the .dll missing files by building VTK using shared_libs option ON.
Secondly, as Jamey mentioned I fixed the error C2555 by changing the definition of GetMTime in vtkImageMapToColors16, apparently VTK version 7.1.1 was not compatible with GDCM 2.6. So I changed the output type of GetMTime function from long int to output of the virtual function in vtkObject::GetMTime.

Related

how can i solve FreeRTOS error on atmega128?

------ Build started: Project: freertos, Configuration: Debug AVR ------
Build started.
Project "freertos.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\AVR\freertos\freertos\freertos.cproj" (target "Build" depends on it):
Task "RunCompilerTask"
Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync
Building target: freertos.elf
Invoking: AVR/GNU Linker : 5.4.0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o freertos.elf heap_1.o list.o main.o port.o queue.o tasks.o -Wl,-Map="freertos.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\gcc\dev\atmega128"
D:\AVR\freertos\freertos\Debug\Makefile(166,1): error: recipe for target 'freertos.elf' failed
tasks.o: In function `prvIdleTask':
D:\AVR\freertos\freertos\Debug\tasks.c(1,1): error: undefined reference to `vApplicationIdleHook'
collect2.exe(0,0): error: ld returned 1 exit status
make: *** [freertos.elf] Error 1
The command exited with code 2.
Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "freertos.cproj" -- FAILED.
Done building project "freertos.cproj" -- FAILED.
Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
You have to options to solve this error:
1- set configUSE_IDLE_HOOK to 0 in FreeRTOSConfig.h.
2- Define a function that has the following name and prototype:
void vApplicationIdleHook( void );
Anything that starts 'Application' is expected to be provided by the application writer, rather than be part of the kernel - and in all cases the features are options - so as per the above you can either provide the hook function or tern the feature off.

CMake "RUN_TESTS" or "test" target

In my "plange_superbuild" CMakeLists.txt, I have:
add_test(plange_test ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/prefix/src/plange-build --target test)
which should invoke the "plange" sub-project's test target, and works fine when using the Makefile generator. However, the CMake Testing documentation explains:
[ enable_testing() ] adds another build target, which is test for Makefile generators,
or RUN_TESTS for integrated development environments (like Visual
Studio).
So, my snippet doesn't work on builds with an IDE because I'm just saying "test". How can I make the command also work in IDE builds?
I've thought of some possible workaround options. One is to use an existing CMake variable, should it exist, to get the name of the test target. That is a variable (lets call it CMAKE_TEST_TARGET) that would be equal to test except in IDE builds where it would be equal to RUN_TESTS, allowing the following:
add_test(plange_test ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/prefix/src/plange-build --target ${CMAKE_TEST_TARGET})
I'm not aware of such a variable though. Perhaps I could detect IDE based builds via the CMAKE_GENERATOR variable (or MSVC and similar) and manually set the so-called CMAKE_TEST_TARGET variable. That would require knowing (and maintaining) the exact logic that CMake uses to determine "test" or "RUN_TESTS" in my CMakeLists.txt, which would be unreliable.
My other thought is to invoke ctest directly using a variable (let's call is CTEST_COMMAND) that's similar to CMAKE_COMMAND, but points to the ctest executable. Again, I'm not aware of such a variable.
Edit: There is CMAKE_CTEST_COMMAND See https://stackoverflow.com/a/736838/395029 and my comment therein
I derived this variable from CMAKE_COMMAND, using get_filename_component() to extract the bin directory, but this depends on CMAKE_COMMAND not having any embedded arguments. Is that a safe assumption? This works with the Makefile generator, but not with VC++2017 generator. The error message in VC++ is not clear, but here's what I tried:
get_filename_component(CMAKE_EXECUTABLES_DIR ${CMAKE_COMMAND} DIRECTORY)
set(CTEST_COMMAND "${CMAKE_EXECUTABLES_DIR}/ctest${CMAKE_EXECUTABLE_SUFFIX}")
add_test(NAME plange_test COMMAND ${CTEST_COMMAND} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/prefix/src/plange-build)
The error message in VC++2017 in the superbuild project:
1>The following tests FAILED:
1> 1 - plange_test (Failed)
1>Errors while running CTest
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "setlocal
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: "C:\Program Files\CMake\bin\ctest.exe" --force-new-ctest-process -C Debug
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 8.
1>Done building project "RUN_TESTS.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
I was able to run the command from that error output successully:
C:\...\plange.build\prefix\src\plange-build>ctest --force-new-ctest-process -C Debug
but:
C:\...\plange.build>ctest --force-new-ctest-process -C Debug
fails, so that makes the failure even more confusing. Are one of these common practice? Is there some superior (working) approach that I haven't considered?
Edit: with CMAKE_CTEST_COMMAND I learned that "-C Debug" isn't passed, which makes it fail in IDE. See my comments
In cmake source you can find a variable that is undocummented but may serve your purpose if you are using include(CTest) instead of enable_testing()
Check out this commit: https://github.com/Kitware/CMake/commit/816c9d1aa1f2b42d40c81a991b68c96eb12b6d26#diff-73eaa76f278a4e8afe41a9ffb838ccc4:
# If requested, add an alias that is the equivalent of the built-in "test"
# or "RUN_TESTS" target:
if(CTEST_TEST_TARGET_ALIAS)
add_custom_target(${CTEST_TEST_TARGET_ALIAS}
${CMAKE_CTEST_COMMAND} ${__conf_types}
USES_TERMINAL
)
endif()
endif()
Meaning that if in your Cmakelist.txt you call set(CTEST_TEST_TARGET_ALIAS my_name_for_target_test) and then include(CTest), you can use reliably the my_name_for_target_test acording to this comment (I did not check myself if this really does the trick). Since this alias is created via add_custom_target, this is not a builtins target and you dont have the (really annoying) limitations of thoses, including not being able to add a dependency on it / from it.

MSBuild: error MSB3073 The command 'setlocal VCEnd' exited with code 1

I am trying to build an opensource project on my machine using Visual Studio 2015 and CMake. I have followed all the steps and the prebuild checks were running properly. But when I am building the INSTALL to install the software in the folder that I have specified in the CMAKE gui, I am getting the MSB3073 error. A full description of the error is as below.
Severity Code Description Project File Line Suppression State Error
MSB3073 The command "setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=RelWithDebInfo -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1.
INSTALL C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets 133
I have searched for the same error and found that some people who tried to install the build in a directory without write privileges encountered this, but I have made sure that I have write access. I have even tried do this with admin rights and still not able to fix this issue.
Any help in this would be highly appreciated.
While running Visual Studio 2022, trying to build VST plug-in with code generated by cmake.
For me it showed permission access denied when creating a symbolic link.
All I had to do was run Visual Studio "As Administrator" and it worked.
Of course, you have to have Admin privileges to your machine, or you belong to a group that is allowed to "Create symbolic links" in the Local Group Policy Editor (https://developer.steinberg.help/display/VST/Preparation+on+Windows)
Sorry for being a necro but I just encountered and fixed the exact same issue, and I think it can save someone some time if I share my solution.
By looking a bit in the log before the error message, I found the last element that CMake was trying to install :
-- Installing: path-to-anaconda/anaconda3/Lib/site-packages/cv2.cp37-win_amd64.pyd
CMake Error at modules/python3/cmake_install.cmake:45 (file):
file INSTALL cannot copy file
"path-to-repo/opencv/build/lib/python3/Release/cv2.cp37-win_amd64.pyd" to
"path-to-anaconda/anaconda3/Lib/site-packages/cv2.cp37-win_amd64.pyd":
Permission denied.
Call Stack (most recent call first):
modules/cmake_install.cmake:183 (include)
cmake_install.cmake:124 (include)
Permission denied...
It was simply because I left a console with cv2 imported, so the pyd was still being used and blocked the install. This can probably extend to any other file (DLLs, .hpp) being installed, just look a bit above this obscure error message ! Nothing to do with cmake_install.cmake, at least for me.
There was an error in one of the cmake_install.cmake files and it was causing the issue. Once I fixed the issue, it worked.

Chromium build failed

I'm trying to build Chromium 40.0.2214.111
ninja -C out/Release chrome
But it failed with the error:
FAILED: ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC #obj\device
bluetooth\device_bluetooth.bluetooth_low_energy_defs_win.obj.rsp /c ..\..\device\bluetooth\bluetooth_low_energy_defs_win.cc /Foobj\device\bluetooth\device_blue
ooth.bluetooth_low_energy_defs_win.obj /Fdobj\device\bluetooth\device_bluetooth.cc.pdb
c:\program files (x86)\windows kits\8.1\include\um\bluetoothleapis.h(685) : error C2061: syntax error : identifier 'PFNBLUETOOTH_GATT_EVENT_CALLBACK'
c:\program files (x86)\windows kits\8.1\include\um\bluetoothleapis.h(711) : error C2065: 'BLUETOOTH_GATT_EVENT_HANDLE' : undeclared identifier
c:\program files (x86)\windows kits\8.1\include\um\bluetoothleapis.h(711) : error C2146: syntax error : missing ')' before identifier 'EventHandle'
c:\program files (x86)\windows kits\8.1\include\um\bluetoothleapis.h(711) : warning C4229: anachronism used : modifiers on data are ignored
c:\program files (x86)\windows kits\8.1\include\um\bluetoothleapis.h(713) : error C2059: syntax error : ')'
[8/6758] ACTION Generating C++ API bundle code for function registration
ninja: build stopped: subcommand failed.
I have tried to solve the issue with the google, but I did not succeed

Relative path on cmake / errors if path is changed afterwards

I have a VS 12 solution with my own project, which depends on some dependencies (project files generated using cmake). I generated these VS12 projects using cmake and added these projects to my solution (using a relative path). Then I had to adjust the output directories of these projects, to build the target somewhere else where my own project can find them (so just running cmake again after the path changes doesn't solve my problem, because I would have to edit all projects again then).
If now the absolute path for the solution changes, the solution can still find the projects - but at building I receive errors from cmake, that the "old path" didn't exists.
Steps to reproduce my problem:
Download the cmake Project from here.
Extract into a Directory on C:\cmake
Create inside a Directory called C:\cmake\build
Open a command-line and go to C:\cmake\build
execute cmake ..
rename the C:\cmake Directory to C:\cmake2
Open the solution C:\cmake2\build\CMake.sln
There will occur a long list with errors (too long to include here completly) - all caused because the old path "C:\cmake\" ist still used from somewhere. An example:
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration
1> Checking Build System
1> CMake is re-running because C:/cmake/build/CMakeFiles/generate.stamp dependency file is missing.
1>CUSTOMBUILD : CMake error : The source directory "C:/cmake" does not appear to contain CMakeLists.txt.
1> Specify --help for usage, or press the help button on the CMake GUI.
3>------ Build started: Project: cmbzip2, Configuration: Debug Win32 ------
4>------ Build started: Project: cmzlib, Configuration: Debug Win32 ------
5>------ Build started: Project: cmexpat, Configuration: Debug Win32 ------
6>------ Build started: Project: cmsys, Configuration: Debug Win32 ------
3>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1422,5): warning : The referenced project 'C:/cmake/build/ZERO_CHECK.vcxproj' does not exist.
I want to generate VS Project files just one time - not again, if the Location of the folder changes. Any ideas how cmake can make use of relative paths instead?
Even that the question is downvoted I will provide an answer here for people that are facing the same problem (and depending on their environment it can be real a problem in my opinion).
I removed from all project files that are referenced from my solution at least the following part:
<ItemGroup>
<CustomBuild Include="..\..\Source\CMakeLists.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Building Custom Rule C:/cmake/Source/CMakeLists.txt</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">setlocal
"C:\Program Files\CMake 2.8\bin\cmake.exe" -HC:/cmake -BC:/cmake/build --check-stamp-file C:\cmake\build\Source\CMakeFiles\generate.stamp
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:/cmake/Source/CMakeLists.txt;C:\cmake\Source\CMakeLists.txt;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\cmake\Source\cmConfigure.cmake.h.in;C:\cmake\Source\cmVersionConfig.h.in;C:\cmake\Source\CPack\cmCPackConfigure.h.in;C:\cmake\Source\CMakeLists.txt;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\cmake\build\Source\CMakeFiles\generate.stamp</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Building Custom Rule C:/cmake/Source/CMakeLists.txt</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">setlocal
"C:\Program Files\CMake 2.8\bin\cmake.exe" -HC:/cmake -BC:/cmake/build --check-stamp-file C:\cmake\build\Source\CMakeFiles\generate.stamp
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:/cmake/Source/CMakeLists.txt;C:\cmake\Source\CMakeLists.txt;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\cmake\Source\cmConfigure.cmake.h.in;C:\cmake\Source\cmVersionConfig.h.in;C:\cmake\Source\CPack\cmCPackConfigure.h.in;C:\cmake\Source\CMakeLists.txt;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\cmake\build\Source\CMakeFiles\generate.stamp</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">Building Custom Rule C:/cmake/Source/CMakeLists.txt</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">setlocal
"C:\Program Files\CMake 2.8\bin\cmake.exe" -HC:/cmake -BC:/cmake/build --check-stamp-file C:\cmake\build\Source\CMakeFiles\generate.stamp
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">C:/cmake/Source/CMakeLists.txt;C:\cmake\Source\CMakeLists.txt;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\cmake\Source\cmConfigure.cmake.h.in;C:\cmake\Source\cmVersionConfig.h.in;C:\cmake\Source\CPack\cmCPackConfigure.h.in;C:\cmake\Source\CMakeLists.txt;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">C:\cmake\build\Source\CMakeFiles\generate.stamp</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">Building Custom Rule C:/cmake/Source/CMakeLists.txt</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">setlocal
"C:\Program Files\CMake 2.8\bin\cmake.exe" -HC:/cmake -BC:/cmake/build --check-stamp-file C:\cmake\build\Source\CMakeFiles\generate.stamp
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">C:/cmake/Source/CMakeLists.txt;C:\cmake\Source\CMakeLists.txt;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\cmake\Source\cmConfigure.cmake.h.in;C:\cmake\Source\cmVersionConfig.h.in;C:\cmake\Source\CPack\cmCPackConfigure.h.in;C:\cmake\Source\CMakeLists.txt;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">C:\cmake\build\Source\CMakeFiles\generate.stamp</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">false</LinkObjects>
</CustomBuild>
</ItemGroup>
And:
<ItemGroup>
<ProjectReference Include="C:/cmake/build/ZERO_CHECK.vcxproj">
<Project>FE0DC35D-28F6-4786-A563-DFE14862A57F</Project>
</ProjectReference>
</ItemGroup>
That prevents the behaviour that CMakeLists.txt is checked for changes before each build. If all other paths in the project file are relative the cmake project is free moveable on the harddisk now.
The Problem with this custom build step is: It isn't displayed in Visual Studios Project Settings, so the plain .vcxproj must be edited manually.