donn / nudelta

Open source NuPhy Console alternative
GNU General Public License v3.0
503 stars 22 forks source link

Error: could not find CMAKE_PROJECT_NAME in Cache #64

Open peterotool opened 11 months ago

peterotool commented 11 months ago

Version

0.7.4

Operating System

I am using Ubuntu distribution:

Description

When i execute any of the following commands: yarn build-native or yarn build

I get the following error:

info TOOL Using Unix Makefiles generator. info CMD BUILD info RUN [ info RUN 'cmake', info RUN '--build', info RUN '/home/jcordero/nudelta/build', info RUN '--config', info RUN 'Release' info RUN ] Error: could not find CMAKE_PROJECT_NAME in Cache ERR! OMG Error: Process terminated: 1 ERR! OMG at ChildProcess. (/home/jcordero/nudelta/node_modules/cmake-js/lib/processHelpers.js:32:32) ERR! OMG at ChildProcess.emit (events.js:400:28) ERR! OMG at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12) Error: Cmake-js exited with a non-zero code at main (file:///home/jcordero/nudelta/util/build-native.js:24:15) at processTicksAndRejections (internal/process/task_queues.js:95:5) error Command failed with exit code 255. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any clues?

Thanks in advance

donn commented 11 months ago

Can you try this modification and report back?

Screenshot at 2023-09-04 14:33:24

peterotool commented 11 months ago

I add the modification:

# Get version from package.json
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/package.json PACKAGE_JSON)
string(JSON NUDELTA_VERSION GET ${PACKAGE_JSON} "version")
set(CMAKE_PROJECT_NAME nudelta)
set(PROJECT_VERSION ${NUDELTA_VERSION})

to CMakeLists.txt file

but now i got the following error:

verb CFG Build system options:
verb CFG {"directory":"/home/jcordero/nudelta","cmakePath":null,"runtime":"electron","runtimeVersion":"21.2.1","cMakeOptions":{},"out":"/home/jcordero/nudelta/build","extraCMakeArgs":[],"isNodeApi":false}
info TOOL Using Unix Makefiles generator.
info CMD BUILD
info RUN [
info RUN   'cmake',
info RUN   '--build',
info RUN   '/home/jcordero/nudelta/build',
info RUN   '--config',
info RUN   'Release'
info RUN ]
make: Makefile: No such file or directory
make: *** No rule to make target 'Makefile'.  Stop.
ERR! OMG Error: Process terminated: 2
ERR! OMG     at ChildProcess.<anonymous> (/home/jcordero/nudelta/node_modules/cmake-js/lib/processHelpers.js:32:32)
ERR! OMG     at ChildProcess.emit (events.js:400:28)
ERR! OMG     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
Error: Cmake-js exited with a non-zero code
    at main (file:///home/jcordero/nudelta/util/build-native.js:24:15)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

the only Makafile in my local repo is in : submodules/ssco/Makefile

# cat submodules/ssco/Makefile
test: example.cpp include/SSCO/StupidSimpleCPPOpts.h
    c++ -std=c++17 -I include -o $@ example.cpp

I have the following setup

$ uname -a
Linux tatooine 5.15.0-79-generic #86~20.04.2-Ubuntu SMP Mon Jul 17 23:27:17 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
$ cmake --version
cmake version 3.27.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ node --version
v14.21.3
$ yarn --version
1.22.19

What can be the error root cause ?