Skip to content

Commit c33382b

Browse files
authored
Cmake: improve ncurses detection (spack#25776)
* Optionally enable ccmake in cmake Renames ncurses variant to `ccmake` since that's how users know it, and explicitly enable/disable `BUILD_CursesDialog`. * Make cmake locate its dependencies with CMAKE_PREFIX_PATH, and set rpath flags too * Undo variant name & defaults change
1 parent 47b16b3 commit c33382b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

var/spack/repos/builtin/packages/cmake/package.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import re
77

8+
import spack.build_environment
9+
810

911
class Cmake(Package):
1012
"""A cross-platform, open-source build system. CMake is a family of
@@ -277,6 +279,17 @@ def bootstrap_args(self):
277279
if '+ownlibs' in spec:
278280
args.append('-DCMAKE_USE_OPENSSL=%s' % str('+openssl' in spec))
279281

282+
args.append('-DBUILD_CursesDialog=%s' % str('+ncurses' in spec))
283+
284+
# Make CMake find its own dependencies.
285+
rpaths = spack.build_environment.get_rpaths(self)
286+
prefixes = spack.build_environment.get_cmake_prefix_path(self)
287+
args.extend([
288+
'-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF',
289+
'-DCMAKE_INSTALL_RPATH={0}'.format(";".join(str(v) for v in rpaths)),
290+
'-DCMAKE_PREFIX_PATH={0}'.format(";".join(str(v) for v in prefixes))
291+
])
292+
280293
return args
281294

282295
def bootstrap(self, spec, prefix):

0 commit comments

Comments
 (0)