<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1115439917;
        mso-list-type:hybrid;
        mso-list-template-ids:-1396657542 -1 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>So, it seems it is not possible to have CMake NOT to use absolute paths</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Quote</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>“CMake does always use absolute paths. It's part of the concept.”<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://stackoverflow.com/questions/45856955/how-to-tell-cmake-to-use-relative-paths">https://stackoverflow.com/questions/45856955/how-to-tell-cmake-to-use-relative-paths</a></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>One use case:</p><p class=MsoNormal><o:p> </o:p></p><ol style='margin-top:0in' start=1 type=1><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>I have a Cmake script and I generate a Visual Studio project on machine 1</li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>I have another high security computer, machine 2,  where I don’t have administrator privileges</li></ol><p class=MsoListParagraph>To install software and CMake is on the list of “not approved” software.</p><ol style='margin-top:0in' start=3 type=1><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>I can copy the generated Visual Studio project from machine 1 to machine 2…</li></ol><p class=MsoListParagraph>But …alas, all miserably fails to compile because the paths are all wrong</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>One solution I have used in the past for small projects, like</p><p class=MsoListParagraph>1 project file, was to manually edit the .vcxproj Visual Studio file</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>For example replace this</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><AdditionalIncludeDirectories>F:\wt.leaflet\wt-4.0.1\src\3rdparty\gason\src;</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>With a relative path</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><AdditionalIncludeDirectories>..\..\..\3rdparty\gason\src;</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>Which works perfectly (also remove all the CMake generated things, it’s really not needed after the project is made), but for projects where the number of generated projects</p><p class=MsoListParagraph>Is more than 40, this is not a good way to spend our time</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>Of course , doing a dedicated program that does this replacement for us</p><p class=MsoListParagraph>Would be ideal</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>So, question, does anyone know of the existence of this program?</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>Also, this post circa 2008 says there was a “CMAKE_USE_RELATIVE_PATHS”</p><p class=MsoListParagraph>That seems to have been deprecated</p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoNormal>“If you set CMAKE_SUPPRESS_REGENERATION </p><p class=MsoNormal>to true, and CMAKE_USE_RELATIVE_PATHS to true, you might get things to </p><p class=MsoNormal>work for a small project. “<span style='font-size:10.0pt'><o:p></o:p></span></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph>would this work? Of course I would have to travel back in time to 2008, but that’s another problem</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://cmake.org/pipermail/cmake/2008-March/020629.html">https://cmake.org/pipermail/cmake/2008-March/020629.html</a></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I quote here the original post on this thread,</p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>“I cant help but comment that this is unnecessarily complicated when</p><p class=MsoNormal>all that is desired is simply compiling without the Cmake dependency.</p><p class=MsoNormal>Conceptually it should not be this hard.<span style='font-size:10.0pt'><o:p></o:p></span></p></div><p class=MsoNormal>“</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Yes, it should not be this hard for Cmake to have an *<b>OPTION</b>* to use relative paths, maybe ?</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal style='border:none;padding:0in'><o:p> </o:p></p></div><p class=MsoNormal><a href="http://pedro-vicente.net/">http://pedro-vicente.net/</a></p></div></body></html>