-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from roocell/raspizerow_options
raspizerow main to accept args and CMake
- Loading branch information
Showing
4 changed files
with
133 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(adeus_raspizerow) | ||
|
||
# Include FetchContent module | ||
include(FetchContent) | ||
|
||
# Fetch cxxopts | ||
FetchContent_Declare( | ||
cxxopts | ||
GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git | ||
GIT_TAG v3.2.0 | ||
) | ||
FetchContent_MakeAvailable(cxxopts) | ||
|
||
# Add your source files here | ||
set(SOURCES | ||
main.cpp | ||
) | ||
# Add executable target | ||
add_executable(main ${SOURCES}) | ||
|
||
# Set C++ standard | ||
set_target_properties(main PROPERTIES | ||
CXX_STANDARD 17 | ||
CXX_STANDARD_REQUIRED ON | ||
) | ||
|
||
# Link against required libraries | ||
find_package(ALSA REQUIRED) | ||
find_package(CURL REQUIRED) | ||
find_package(Threads REQUIRED) | ||
|
||
target_link_libraries(main PRIVATE | ||
${ALSA_LIBRARIES} | ||
${CURL_LIBRARIES} | ||
Threads::Threads | ||
cxxopts | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
#!/bin/bash | ||
sudo g++ -std=c++17 main.cpp -g -o main -lasound -lcurl -lpthread | ||
|
||
# Create a build directory | ||
mkdir -p build | ||
cd build | ||
|
||
# Generate build files using CMake | ||
cmake .. | ||
|
||
# Build the project using make | ||
make | ||
|
||
cp -f main .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters