[CMake] installation directory not created on MSYS

Brandon J. Van Every bvanevery at gmail.com
Tue Nov 22 10:42:48 EST 2005


I am using the following for my install.  In PreLoad.cmake I have:

IF(WIN32)
  IF("$ENV{OSTYPE}" STREQUAL "msys")
     SET(MSYS 1 CACHE INTERNAL "Presence of MSYS environment.")
     SET(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH
         "MSYS default install path")
  ENDIF("$ENV{OSTYPE}" STREQUAL "msys")
ENDIF(WIN32)

and in CMakeLists.txt I have:

SET(BINPATH /)
IF(UNIX OR CYGWIN OR MSYS)
  SET(BINPATH /bin)
ENDIF(UNIX OR CYGWIN OR MSYS)
INSTALL_TARGETS(${BINPATH}
  chicken chicken_profile chicken_setup csc csi)

Now, for both "Unix Makefiles" and "NMake Makefiles" generators, all 
paths are being set correctly.  I get /usr/local/bin under a MSYS shell, 
and I get C:/Program Files/Chicken under a normal Windows command prompt 
using VC++.  This is what the installation echoes say, at any rate.  So 
far so good.

Here's what surprises me.  Under the Windows command prompt, C:/Program 
Files/Chicken is created if it doesn't exist already.  But under MSYS, 
/usr/local/bin is *not* created if it doesn't exist already.  Moreover, 
the failure is silent, no error is given.  The install says it's 
installing, with pathnames echoed and so forth, and it doesn't actually 
do what it says it's doing.  The output:

$ make install
Running cmake script file cmake_install.cmake
-- Installing /usr/local/bin/chicken.exe
-- Installing /usr/local/bin/chicken_profile.exe
-- Installing /usr/local/bin/chicken_setup.exe
-- Installing /usr/local/bin/csc.exe
-- Installing /usr/local/bin/csi.exe

I find that when I type "mkdir /usr/local" on the MSYS command line, it 
works.  However, "mkdir /usr/local/bin" does not work.  I deduce that 
"mkdir" is too stupid to create anything more than one directory level 
deep?  Is this generally true of Unix?  And, in this event, shouldn't 
CMake deal with it?  Or is that not Unix culture, i.e. Unixen expect to 
write tedious scripts to do the obvious every time?  I am thinking a 
cross-platform tool should implement a uniform policy.  In any event, 
I'm thinking it should report a failure... although again I'm vaguely 
aware of a Unix "silent failure" culture... which I've heard Pythonistas 
don't care for... and Pythonistas annoy the Perl guys.........


Cheers,
Brandon Van Every
"The pioneer is the one with the arrows in his back."
                          - anonymous entrepreneur


More information about the CMake mailing list