[CMake] From linux to windows?

Andreas Pakulat apaku at gmx.de
Fri May 29 19:34:06 EDT 2009


On 30.05.09 00:16:21, Johannes Serup wrote:
> I have a project written on linux using cmake that I would like to
> build on Vista32. In the CMakeLists.txt file there is something like
> this:
> 
> 
> INCLUDE_DIRECTORIES(/usr/X11R6/include)
> INCLUDE_DIRECTORIES(/home/chin/Cpp_Libraries/zlib)
> LINK_DIRECTORIES(/usr/X11R6/lib)
> LINK_DIRECTORIES(/home/chin/Cpp_Libraries/zlib)
> 
> But how do I find the corresponding libs for windows vista? I know
> that zlib is avaliable for windows:
> 
> http://gnuwin32.sourceforge.net/packages/zlib.htm
> 
> But what about:
> 
> /usr/X11R6/lib
> 
> ? Should I install eg. cygwin for this?
> 
> It seems a bit against the whole point of cross platform compilation
> to have linux dependent libs in a CMakeLists.txt or am I missing
> something?

Well, yes, ideally the project would use a cross-platform toolkit for
its GUI instead of using X11 directly. So in your case there are two
options:

- install cygwin, X11 for cygwin and cmake for cygwin, then build inside
  cygwin. Also all other users will then have to install cygwin to use
  this project on win32

- port the code of your project that uses X11 to Win32 API or some
  cross-platform GUI toolkit, then you won't need cygwin.

Andreas

-- 
Is that really YOU that is reading this?


More information about the CMake mailing list