<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">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>