MantisBT - CMake
View Issue Details
0007108CMakeCMakepublic2008-05-28 04:182016-06-10 14:30
axel.roebel 
Bill Hoffman 
normalmajoralways
closedmoved 
 
 
0007108: to_native_path/to_cmake_path completely broken on cygwin
Hello

I am running cmake under cygwin on windows with some Platform files adapted to
be able to use the intel compiler. I am trying to find the include files (and libraries) of Intels mkl libraries with the following
cmake code

 IF(WIN32)
    IF(MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_COMPILER_IS_MINGW )
      IF(CMAKE_GENERATOR MATCHES "^Unix Makefiles")
        FILE(GLOB MKL_INCLUDE_PATH_LIST_TMP "/cygdrive/c/Program Files/Intel/MKL/*/include")
        FILE(GLOB MKL_LIB_PATH_LIST_TMP "/cygdrive/c/Program Files/Intel/MKL/*/ia32/lib")
      ELSE(CMAKE_GENERATOR MATCHES "^Unix Makefiles")
        FILE(GLOB MKL_INCLUDE_PATH_LIST_TMP "C:/Program Files/Intel/MKL/*/include")
        FILE(GLOB MKL_LIB_PATH_LIST_TMP "C:/Program Files/Intel/MKL/*/ia32/lib")
      ENDIF(CMAKE_GENERATOR MATCHES "^Unix Makefiles")
    ENDIF(MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_COMPILER_IS_MINGW)
  ELSE(WIN32)
    FILE(GLOB MKL_INCLUDE_PATH_LIST_TMP /opt/intel/mkl/*/include )
    FILE(GLOB MKL_LIB_PATH_LIST_TMP /opt/intel/mkl/*/lib/${MKL_BITDIRSUF_TMP})
  ENDIF(WIN32)
  FIND_PATH(MKL_INCLUDE_PATH_TMP mkl_dfti.h PATHS /usr/include /usr/local/include /u/formes/share/include ${MKL_INCLUDE_PATH_LIST_TMP} )

Now in cmake 2.4.8 this returned

/cygdrive/c/Program Files/Intel/MKL/10.0.1.014/include

while in cmake 2.6.0 it creates

c:\Program Files\Intel\MKL\10.0.1.014\include

a path that it found in the environment variable INCLUDE

I would have expected that in a unix makefile generator the variable should be automatically converted to unix path style.

Then I thought to use the to_cmake_path/to_native_path facilities to convert the path to unix flavor. (BTW I am not quite sure what native means in cygwin compiled cmake on windows).
Neither of these two did anything useful though. Both ended up with something like

"c" "/Program Files/Intel/MKL/10.0.1.014/include"

which after looking in the source code is obviously due to the fact that
the fist thing the TO_*_PATH commands do is

 #if defined(_WIN32) && !defined(__CYGWIN__)
  char pathSep = ';';
#else
  char pathSep = ':';
#endif
  std::vector<cmsys::String> path = cmSystemTools::SplitString(i->c_str(), pathSep);

this means for CYGWIN it will always use ":" as path separator splitting the c from the rest and then converting to unix style path. So in short the path conversion for cygwin is working only in one (completely useless) case:

unix style path -> unix style path
No tags attached.
Issue History
2008-05-28 04:18axel.roebelNew Issue
2008-08-19 16:01Bill HoffmanStatusnew => assigned
2008-08-19 16:01Bill HoffmanAssigned To => Bill Hoffman
2016-06-10 14:27Kitware RobotNote Added: 0041429
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0041429)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.