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: