[cmake-developers] [CMake 0016053]: $<SHELL_PATH:...> should return a short path on Windows when containing spaces

Mantis Bug Tracker mantis at public.kitware.com
Thu Apr 7 11:26:22 EDT 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=16053 
====================================================================== 
Reported By:                Guillaume Dumont
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16053
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-04-07 11:26 EDT
Last Modified:              2016-04-07 11:26 EDT
====================================================================== 
Summary:                    $<SHELL_PATH:...> should return a short path on
Windows when containing spaces
Description: 
I am trying to build OpenCV from sources using MSVC and the Ninja Generator and
I have a failing build because of linker flags added to the
target_link_libraries. OpenCV's CMakeLists.txt uses this line of CMake code:

set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} -L${p})

OPENCV_LINKER_LIBS is passed to target_link_libraries afterwards. The problem
with this line is that it does not work on Windows with the Ninja generator. I
tried:

set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS}
${CMAKE_LIBRARY_PATH_FLAG}$<SHELL_PATH:${p}>)

but that does not work either because the even though we end up using /LIBPATH:
instead of /L and backslashes instead of forward slashes the path contains
spaces and ninja throws a link error. 

Shouldn't SHELL_PATH return a short path, or a path between quotes when the path
contains spaces on Windows?


Steps to Reproduce: 
Try to build OpenCV 3.1.0 on Windows with Ninja.

Additional Information: 
See OpenCV issue: https://github.com/Itseez/opencv/issues/6372
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-04-07 11:26 Guillaume DumontNew Issue                                    
======================================================================



More information about the cmake-developers mailing list