I have a VS 12 solution with my own project, which depends on some dependencies (project files created using cmake). I created these VS12 projects using cmake and added these projects to my solution (using the relative path). Then I had to configure the output directories of these projects to create a goal somewhere else where my own project can find them (so just running cmake again after changing the path does not solve my problem, because I have to edit all the projects again then).
If now the absolute path for the solution changes, the solution can still find projects, but when building, I get errors from cmake that the "old path" does not exist.
Steps to reproduce my problem:
- Download the cmake project from here .
- Directory extraction
C:\cmake - Create inside a directory called
C:\cmake\build - Open a command prompt and go to
C:\cmake\build - execute
cmake .. - rename the directory
C:\cmaketoC:\cmake2 - Open solution
C:\cmake2\build\CMake.sln
A long list of errors will appear (too long to be included here completely) - everything is caused by the fact that the old path "C: \ cmake" is still used somewhere. 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 only once - again, if the folder location changes. Any ideas on how cmake can use relative paths instead?
source
share