Menu

#80 streamline CMakeList.txt for use in Win32 builds

Unstable (example)
closed
None
5
2018-04-17
2015-04-03
GregJung
No

The full text of the proposed new CMakeLists is attached. Diffs are below.

I've just run this through mingw/msys and mingw/msys2 and they built without interventions.
(msys2 runs need an additional #include <time.h> in some files).
readline and ncurses or pdcurses do little or nothing for running from a windows CMD.exe
session. graphicsmagick isn't working and wxwidgets is also unlikely to run;
enthusiasts who wish to try the extras can edit the .txt file or set the variables as they run.

17c17
< set(VERSION "0.9.5+  CVS 2015/04/02+ {gvj/}f/tarball")
---
> set(VERSION "0.9.5 CVS")
41,43d40
< set(WXWIDGETS ON CACHE BOOL "GDL: Enable WxWidgets ?")
< set(WXWIDGETSDIR "" CACHE PATH "GDL: Specify WxWidgets directory tree")
<
50a48,49
> set(WXWIDGETS ON CACHE BOOL "GDL: Enable WxWidgets ?")
> set(WXWIDGETSDIR "" CACHE PATH "GDL: Specify WxWidgets directory tree")
55c54
< set(EIGEN3 OFF CACHE BOOL "GDL: Enable Eigen3 ?")
---
> set(EIGEN3 ON CACHE BOOL "GDL: Enable Eigen3 ?")
58c57
< set(PSLIB OFF CACHE BOOL "GDL: Enable pslib ?")
---
> set(PSLIB ON CACHE BOOL "GDL: Enable pslib ?")
75,84c74
< # None of these work well on windows
< if(WIN32)
<     set(READLINE OFF) # CACHE BOOL "GDL: Enable GNU Readline ?")
<     set(WXWIDGETS OFF) # CACHE BOOL "GDL: Enable WxWidgets ?")
<     set(X11 OFF) # CACHE BOOL "GDL: Enable X11 ?")
<     set(GRAPHICSMAGICK OFF) # CACHE BOOL "GDL: Enable GraphicsMagick ?")
<     set(MAGICK OFF) # CACHE BOOL "GDL: Enable ImageMagick ?")
< endif(WIN32)
<
< set(NETCDF OFF CACHE BOOL "GDL: Enable NetCDF ?")
---
> set(NETCDF ON CACHE BOOL "GDL: Enable NetCDF ?")
87c77
< set(HDF OFF CACHE BOOL "GDL: Enable Hdf ?")
---
> set(HDF ON CACHE BOOL "GDL: Enable Hdf ?")
90c80
< set(HDF5 OFF CACHE BOOL "GDL: Enable Hdf5 ?")
---
> set(HDF5 ON CACHE BOOL "GDL: Enable Hdf5 ?")
102c92
< set(PYTHON OFF CACHE BOOL "GDL: Enable Python ?")
---
> set(PYTHON ON CACHE BOOL "GDL: Enable Python ?")
186,189d175
< # Readline
< # -DREADLINE=ON|OFF
< # -DREADLINEDIR=DIR
< if(READLINE)
231a218,221
> # Readline
> # -DREADLINE=ON|OFF
> # -DREADLINEDIR=DIR
> if(READLINE)
253,254d242
< else(READLINE)
<    set(LIBRARIES ${LIBRARIES} gnurx)
298c286
<               if(MSVC)
---
>               if(WIN32 AND NOT CYGWIN)
300,302c288
<               elseif(WIN32)
<                       set(LIBRARIES ${LIBRARIES} gomp pthread)
<               else()
---
>               else(WIN32 AND NOT CYGWIN)
304c290
<               endif()
---
>               endif(WIN32 AND NOT CYGWIN)
306d291
<
361d345
< # gnurx termcap)
409c393
<         message(STATUS " Using a plplot library without private functions - workarounds will be used.")
---
>         message(STATUS "Using a plplot library without private functions - workarounds will be used.")
412d395
<
467c450
<       find_package(wxWidgets QUIET REQUIRED base core adv)
---
>       find_package(wxWidgets REQUIRED base core adv)
892d874
<
895,896c877
< #     add_subdirectory(testsuite)
<         message(STATUS "add_subdirectory(testsuite) is toxic to CMAKE")
---
>       add_subdirectory(testsuite)
932d912
< list(REMOVE_DUPLICATES LIBRARIES)
952c932
<
---
> #
964a945
>
1008c989
< #set(READLINE ON)
---
> set(READLINE ON)
1011c992
< #set(CURSES ON)
---
> set(CURSES ON)
1 Attachments

Discussion

  • Jeongbin Park

    Jeongbin Park - 2015-04-03

    Thanks. I will investigate the proposed packages to be removed, however, it looks like some packages are actually needed on Windows too. At least GraphicsMagick works very well with GDL in my environments, and it is very needed for image writing functions, such as WRITE_PNG.

    Anyway, the 'gomp' patch is applied in the CVS now.

    PS: 'diff' generates better output with -u option.

     
  • GregJung

    GregJung - 2015-04-09

    UPDATE:

    I have discovered that taking readline out can make GDL sick in other unrelated ways.
    (HOWEVER My build may have been sick anyways, I just discovered, due to EIGEN)

    I agree GraphicsMagick is fine, uncheck or check the box is a matter of taste.
    wxwidgets and X11 are bleeding edge options; I may have the libraries to be found, but
    bringing them into the build is a mistake easy to make. So when setting up the options I suggest:

    if(WIN32)
        set(X11 OFF CACHE BOOL "GDL: Enable X11 ?") 
        set(WXWIDGETS OFF CACHE BOOL "GDL: Enable WxWidgets ?")
    else(WIN32)
        set(X11 ON CACHE BOOL "GDL: Enable X11 ?") 
        set(WXWIDGETS ON CACHE BOOL "GDL: Enable WxWidgets ?")
    endif(WIN32)
    

    readline/Ncurses or readline/pdcurses you can have either pdcurses or ncurses but they
    can't live together. msys2 provides precompiled readline/ncurses. Most of those
    libraries are dormant in GDL, but as I said, somehow it makes my GDL sick to not have it.

    I keep all CMake logic related to these in CMakeModules/gdl_curses.cmake. It allows for PDCURSES (and should default to that for MSVC) or for NCURSES, which is case for linux and msys. I can't use the CVS CMakeLists as it is currently written.

     
  • GregJung

    GregJung - 2017-10-19

    ** recent status: October 2017.

    Using Msys2 I have built GDL on windows using the CVS CMakeLists.txt with one caveat:

    at lin 381
    endif(PCRE_FOUND)
    LINK_LIBRARIES(shlwapi gnurx)
    endif(WIN32 AND NOT CYGWIN)

    My msys2 system is frozen at an earlier level (June 2016?) so because msys2 is a rolling-update system, building a make-it machine may still require a bit of work. I had problems with PSLIB and with HDF (version 4) although HDF5 and NETCDF worked out ok.

    Although I have a python installation that would work, I don't use python and its inclusion would add a lot of time to the build.

    Widgets is another rabbit hole you may want to side-step, if possible - I've made it work for windows
    but there are a few extra steps to get it functional.

    In summary, my build script for a CVS

    cmake -DPLPLOTDIR=/opt32/plplot-gvjwingdi/ -G"MSYS Makefiles"  /f/test/gdl \
    -DNETCDF=ON -DHDF=OFF -DPSLIB=OFF \
    -DWXWIDGETS=ON  -DPYTHON=OFF \
    -DMAGICK=ON -DGRAPHICSMAGICK=ON \
    -DGRAPHICSMAGICKDIR=/d/bld/mingw-w64-i686/GM-1.3.20-Q32 \
      >& cmake.out
    
     
  • Sylwester Arabas

    Shall we close this issue?

     
  • Jeongbin Park

    Jeongbin Park - 2018-04-17

    No objections from my side.

     
  • Sylwester Arabas

    • status: open --> closed
     

Log in to post a comment.