[CMake] Problem with recognising the MSYS environment

Arjen Markus arjen.markus at deltares.nl
Thu Apr 16 03:32:39 EDT 2009


Hello,

in the PLplot project I have run into a few problems with the MSYS
environment under Windows XP. The first one is that the CMake variable
MSYS does not get set properly - or else I am doing something wrong.

Here is what I do to work under MSYS:
- Start the rxvt console (via a shortcut created during the installation
   of MSYS)

- I start CMake (version 2.6.2, IIRC) with:
   cmake -G "Unix makefiles" .

- My CMakeLists.txt file is this:

# Check for MSYS
#
project(check)
message("MSYS: >${MSYS}<")
message("Mingw: >${MINGW}<")

- The output is this:

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: C:/msys/1.0/mingw/bin/gcc.exe
-- Check for working C compiler: C:/msys/1.0/mingw/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/msys/1.0/mingw/bin/c++.exe
-- Check for working CXX compiler: C:/msys/1.0/mingw/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
MSYS: ><
Mingw: >1<
-- Configuring done
-- Generating done
-- Build files have been written to: C:/arjen/plplot-svn/test-mingw

As you can see, the MSYS variable does not get set.

I have found a workaround: if the environment variable OSTYPE has the
value "msys", then set MSYS explicitly to 1. But I do not know how
universal that workaround is.

The other problem (the one that triggered this investigation in the
first place) is that the find_library command does not find the
import libraries for gdi32.dll and comdlg32.dll specific to gcc under
MSYS, despite the hint given, but the MSVC import libraries instead.
(These are unuseable though with gcc)

I can workaround that problem as well, but again: I can not be sure
this will work on any other system but mine.

What is a better solution for this?

Regards,

Arjen



Delft Hydraulics, GeoDelft, the Subsurface and Groundwater unit of TNO and parts of Rijkswaterstaat have joined forces in a new independent institute for delta technology, Deltares. Deltares combines knowledge and experience in the field of water, soil and the subsurface. We provide innovative solutions to make living in deltas, coastal areas and river basins safe, clean and sustainable. 

 

DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail.






More information about the CMake mailing list