[CMake] Windows CMake under cygwin

Fernando Cacciola fernando.cacciola at gmail.com
Thu Mar 27 13:32:23 EDT 2008


Hi Bill,

> Fernando Cacciola wrote:
>> Hi People,
>>
>> Due to some project specific constrains, I need to use cmake within
>> cygwin but to compile using Visual C++ via nmake.
>> Since the cygwin cmake doesn't support nmake I must use the windows
>> cmake binary, but naturally knowing that I am running under cygwin.
>>
>
> Can you explain better what you are trying to do?
>
> If you are going to use visual C++, then you can run cmake from a cygwin
> shell and create nmake files no problem.
>  I do this all the time.  What
> is it that you want to do with cygwin from visual stuido C++?
>

We have a testing system that I haven't yet ported to CTest, etc... which is 
heavily based on shell scripts.
To test against Visual C++  I run the testing script under cygwin, but then 
I need to use the windows cmake binary since the cygwin version of cmake 
doesn't generate NMakefiles (just ordinary makefiles)


It all works out of the box provided the enviroment is properly set for the 
command line Visual C++, but I stumble upon a problem yesterday: one of my 
users wanted to do "nmake install" and get the results under /usr/local 
within cygwin (as the previous non-cmake build system was doing).

It turned out that "/usr/local" is not a valid path for the windows cmake 
binary (which runs outside cygwin) so I needed to add some code to "fix" 
that path, but of course, only in that specific condition: windows cmake 
under cygwin (so I added the posted code that defines 
WIN32_CMAKE_ON_CYGWIN).

As I said in a couple of occasions I am porting an existing build system so 
I have lots of requirements that are perhaps unnatural for CMake, but which 
I need to satisfy nonetheless.

Best


-- 
Fernando Cacciola
SciSoft
http://fcacciola.50webs.com
http://groups.google.com/group/cppba






More information about the CMake mailing list