hashdist / hashstack

Collection of software profiles for HashDist
https://hashdist.github.io/
51 stars 60 forks source link

Build CMake with ccmake #657

Open certik opened 9 years ago

certik commented 9 years ago

To do that, we need to convince cmake to use our ncurses library, it should be something along this patch:

diff --git a/pkgs/cmake.yaml b/pkgs/cmake.yaml
index 4da3973..e808a21 100644
--- a/pkgs/cmake.yaml
+++ b/pkgs/cmake.yaml
@@ -1,12 +1,19 @@
 extends: [autotools_package]

+dependencies:
+  build: [ncurses]
+  run: []
+
 sources:
 - key: tar.gz:kcrzjtzo7wnjfxkbctv6fgmurgmezzxg
   url: http://www.cmake.org/files/v3.2/cmake-3.2.0-rc1.tar.gz

 build_stages:
 - name: configure
-  extra: ['--parallel=${HASHDIST_CPU_COUNT}']
+  extra: ['--parallel=${HASHDIST_CPU_COUNT}', '--',
+          '-D CURSES_INCLUDE_PATH:PATH=${NCURSES_DIR}/include',
+          '-D CURSES_NCURSES_LIBRARY:FILEPATH=${NCURSES_DIR}/lib/libncurses.so',
+          ]

 when_build_dependency:
 - set: CMAKE

But it doesn't work. We need to understand the CMake's cmake files and do the right thing.

ahmadia commented 9 years ago
+          '-D CURSES_NCURSES_LIBRARY:FILEPATH=${NCURSES_DIR}/lib/libncurses.so',

Just be careful about these hard-codes. Library names are not always the same across platforms/versions.

certik commented 9 years ago

I know, the best approach is to only give cmake a path to the .so (or dylib/dll) library, and it finds it itself. That's what I do for my projects. But somehow I can't figure out how to convince cmake to do this.

robertmaynard commented 9 years ago

Looking at the CMake release scripts, we set CURSES_CURSES_LIBRAR, not CURSES_NCURSES_LIBRARY