<div dir="ltr">And the solution is to remove quotes from the environment variable.<div><br></div><div><a href="http://stackoverflow.com/a/21842586/13136">http://stackoverflow.com/a/21842586/13136</a><br></div><div><br></div>
<div><br></div><div>Iulian</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 11:47 PM, Iulian-Nicu Şerbănoiu <span dir="ltr"><<a href="mailto:undergraver@gmail.com" target="_blank">undergraver@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,<br><br>I'm using cmake 2.8.12 on Windows XP. I have an issue when calling find_path command if an environment variable contains spaces.<br>
<br><br></div>Here is my CMakeLists.txt file:<br>
<br><pre><code>CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (CodeTrainerPlugins)
MESSAGE("$ENV{CODETRAINER_PATH}")
FIND_PATH (CODETRAINER_FRAMEWORK_PATH
NAMES include/common/ExportApi.h
PATHS
ENV CODETRAINER_PATH
)
if (CODETRAINER_FRAMEWORK_PATH)
MESSAGE(STATUS "CodeTrainer Framework found at: ${CODETRAINER_FRAMEWORK_PATH}")
else()
MESSAGE(FATAL_ERROR "CodeTrainer Framework not found")
endif()
ADD_SUBDIRECTORY(function)
ADD_SUBDIRECTORY(test)</code></pre><br></div><div>The above script is ok when CODETRAINER_PATH variable doesn't contain any spaces. But when this variable has spaces in it the script exits with the above fatal error.<br>
<br></div><div>Is there a problem with cmake (at least on Windows) with spaces in environment variable path?<br><br></div><div>For a complete example you can check the question I addressed on stackoverflow: <a href="http://stackoverflow.com/questions/21838695/find-path-doesnt-work-if-environment-variable-has-spaces" target="_blank">http://stackoverflow.com/questions/21838695/find-path-doesnt-work-if-environment-variable-has-spaces</a><br>
<br></div><div>Thank you,<br>Iulian<br></div></div>
</blockquote></div><br></div>