From 711ebec4c2d54428418642a09f3f30b53160c34c Mon Sep 17 00:00:00 2001 From: Patryk Wychowaniec Date: Sat, 1 Jul 2023 18:30:32 +0200 Subject: [PATCH] readme: Add a section on CMake usage --- README.md | 25 +++++++++++++++++++++++++ README.tpl.md | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/README.md b/README.md index 6a97906..766edc3 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,31 @@ naersk.buildPackage { } ``` +### Using CMake + +If your application uses CMake, the build process might fail, saying: + +``` +CMake Error: The current CMakeCache.txt directory ... is different than the directory ... where CMakeCache.txt was created. +``` + +You can fix this problem by removing stale `CMakeCache.txt` files before the +build: + +``` nix +naersk.buildPackage { + # ... + + preBuild = '' + find \ + -name CMakeCache.txt \ + -exec rm {} \; + ''; +} +``` + +([context](https://github.com/nix-community/naersk/pull/288)) + ### Using OpenSSL If your application uses OpenSSL (making the build process fail), try: diff --git a/README.tpl.md b/README.tpl.md index fb232c8..907e870 100644 --- a/README.tpl.md +++ b/README.tpl.md @@ -249,6 +249,31 @@ naersk.buildPackage { } ``` +### Using CMake + +If your application uses CMake, the build process might fail, saying: + +``` +CMake Error: The current CMakeCache.txt directory ... is different than the directory ... where CMakeCache.txt was created. +``` + +You can fix this problem by removing stale `CMakeCache.txt` files before the +build: + +``` nix +naersk.buildPackage { + # ... + + preBuild = '' + find \ + -name CMakeCache.txt \ + -exec rm {} \; + ''; +} +``` + +([context](https://github.com/nix-community/naersk/pull/288)) + ### Using OpenSSL If your application uses OpenSSL (making the build process fail), try: