diff --git a/CMakeLists.txt b/CMakeLists.txt index 6da386e..1addb74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19.0) +cmake_minimum_required(VERSION 3.16.0) project(pipedal VERSION 0.1.0) include(CTest) diff --git a/README.md b/README.md index 8421a40..204b6ed 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,21 @@ PiPedal has only been tested on Raspbian. But we will gladly accept pull request To build PiPedal, a Raspberry Pi 4B, with at least 4GB of memory is recommended. You should be able to cross-compile PiPedal easily enough, but we do not currently provide support for this. Consult CMake documentation on how to cross-compile source. +Run the following commands to install build tools required by the PiPedal build. + + # install CMake + sudo apt update + sudo apt install cmake + + # install NodeJS lastest LTS release. + curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - + sudo apt-get install -y nodejs + + Run the following commands to install dependent components required by the PiPedal build. sudo apt update - sudo apt install liblilv-dev libboost-dev libjack-jack2-dev + sudo apt install liblilv-dev libboost-dev libjack-jackd2-dev libnl-3-dev libnl-genl-3-dev libboost-all-dev The PiPedal build process also requires version 14 or later of `node.js`. Type `node --version` to see if you have a version of `node.js` installed already. Otherwise run the following commands as root to install the v14.x lts version of `node.js`: @@ -91,6 +102,7 @@ of `node.js` installed already. Otherwise run the following commands as root to curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - apt-get install -y nodejs + ### Building PiPedal PiPedal was developed using Visual Studio Code. If you open the PiPedal project as a folder in VS Code, Code will @@ -100,7 +112,7 @@ itself, build commands should appear on the bottom line of the Visual Studio Cod To install PiPedal, run a full non-debug build using Visual Studio Code, and then run the following command in the root project directory: - sudo ./install + sudo ./init If you are using a different development environment, you can build the project by running the following command in the root project directory. diff --git a/init b/init new file mode 100755 index 0000000..140cd5e --- /dev/null +++ b/init @@ -0,0 +1,14 @@ +#!/usr/bin/bash + +# Configure cmake build. +echo Configuring cmake build... +mkdir build +cd build +cmake .. +cd .. + +# Install react dependencies +cd react +npm install +cd .. + diff --git a/mk b/mk index 96de96b..7ea41a6 100755 --- a/mk +++ b/mk @@ -1 +1,2 @@ -cmake --build /build --config RelWithDebInfo --target all +#!/usr/bin/bash +/usr/bin/cmake --build build --config RelWithDebInfo --target all diff --git a/react/CMakeLists.txt b/react/CMakeLists.txt index 543b3d9..644ba2b 100644 --- a/react/CMakeLists.txt +++ b/react/CMakeLists.txt @@ -7,7 +7,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) set(BUILD_REACT "echo") set(BUILD_REACT_ARGS Skipping react debug build) else() - set(BUILD_REACT ${NPM_COMMAND}) + set(BUILD_REACT npm) set(BUILD_REACT_ARGS run build) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8db2e64..073939b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ set(VERBOSE true) -cmake_minimum_required(VERSION 3.19.0) +cmake_minimum_required(VERSION 3.16.0) include(FindPkgConfig) @@ -16,7 +16,7 @@ include(FindPkgConfig) # nlgenl-3 library. execute_process(COMMAND ls /usr/include/libnl3/netlink/netlink.h RESULT_VARIABLE LNL3_MISSING OUTPUT_QUIET ERROR_QUIET) if(LNL3_MISSING) - message(ERROR " Need to: sudo apt get libnl-3-dev libnl-genl-3-dev ") + message(ERROR " Need to: sudo apt install libnl-3-dev libnl-genl-3-dev ") endif() set(LIBNL3_INCLUDE_DIRS /usr/include/libnl3) set(LIBNL3_LIBRARIES nl-3 nl-genl-3)