Reputation: 383
First timer on CMake. I am currently trying to create a visual studio 2013 solution (project) with CMake.
So i am facing 2 problems.
First one is that i use include_directories in my root cMakeLists.txt but instead of the directories to be included under the VC++ Directories tab they are included under C/C++ -> General -> Additional include directories .
The second problem is that i use an enviroment variable to include those directories , but instead of printing then in the Additional include directories as such : $(myVar)/lib/inc it prints it as a full path (e.g. C:/../lib/inc) and the end user won't have of course the same path as mine.
Thanks in advance for any responses.
Upvotes: 2
Views: 1153
Reputation: 9352
I'll try to answer your questions to help you gain a better understanding of how CMake works.
First one is that i use include_directories in my root cMakeLists.txt but instead of the directories to be included under the VC++ Directories tab they are included under C/C++ -> General -> Additional include directories .
This is just the way CMake generates Visual Studio Projects. I'm not aware of any way to change this.
The second problem is that i use an enviroment variable to include those directories , but instead of printing then in the Additional include directories as such : $(myVar)/lib/inc it prints it as a full path (e.g. C:/../lib/inc) and the end user won't have of course the same path as mine.
To avoid ambiguities in the generated project CMake tends to resolve all paths to fully qualified paths. This (among other things) means that CMake projects are not relocatable. Which means projects generated by CMake are not intended to be moved around after they've been generated, and are definitely not intended to sent to other users for use on other computers.
What this means for you is this: if you use CMake all of your end users also must install and use CMake. If this is not possible or practical for your end users, then CMake isn't the solution for this particular project.
Upvotes: 1