And the solution is to remove quotes from the environment variable.

http://stackoverflow.com/a/21842586/13136


Iulian


On Mon, Feb 17, 2014 at 11:47 PM, Iulian-Nicu Şerbănoiu <
[email protected]> wrote:

> Hello,
>
> 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.
>
>
> Here is my CMakeLists.txt file:
>
> 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)
>
>
> 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.
>
> Is there a problem with cmake (at least on Windows) with spaces in
> environment variable path?
>
> For a complete example you can check the question I addressed on
> stackoverflow:
> http://stackoverflow.com/questions/21838695/find-path-doesnt-work-if-environment-variable-has-spaces
>
> Thank you,
> Iulian
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to