🎉 c++ cmake project.

main
bog 2024-01-29 11:59:55 +01:00
parent 4d84725ba0
commit 2c8df5e493
23 changed files with 3818 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.cache
build
*~*
*\#*

9
CMakeLists.txt Normal file
View File

@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.2)
project(MuzGen)
set(MUZ_VERSION 0.0.0)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(tests)

33
Makefile Normal file
View File

@ -0,0 +1,33 @@
.PHONY: build tests install doc cov run-doc run-cov
build:
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D CMAKE_BUILD_TYPE=Debug \
-B build
cmake --build build
tests: build
build/tests/muz-test
cov: tests
cd build && make cov
install: tests
sudo cmake --install build
check:
@cppcheck --language=c++ --enable=all -q lib src tests \
--suppress=missingIncludeSystem
doc:
mkdir -p build/doc/doxygen
mkdir -p build/doc/guide
doxygen doc/doxygen/Doxyfile
sphinx-build doc/guide build/doc/guide
run-doc: doc
firefox build/doc/doxygen/html/index.html
firefox build/doc/guide/index.html
run-cov: cov
firefox build/lib/cov_html/index.html

2733
doc/doxygen/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

338
doc/doxygen/custom.css Normal file
View File

@ -0,0 +1,338 @@
div.fragment, pre.fragment {
margin: 0;
padding: 4px;
}
/*********************************************/
/** Main content **/
/*********************************************/
.contents {
margin: 10px auto !important;
padding: 0 10px;
max-width: 1200px;
}
/*********************************************/
/** Inline code **/
/*********************************************/
p code,
li code,
td code,
dd code {
display: inline;
padding: 0px 6px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #CCCCCC;
border: 1px solid #333333;
color: #333333;
}
/*********************************************/
/** Table of Contents (ToC) **/
/*********************************************/
div.toc {
margin: 0 !important;
border-radius: 4px !important;
}
div.toc h3 {
font-size: 150%;
color: inherit;
}
/*********************************************/
/** Content table **/
/*********************************************/
.contents table.doxtable {
margin: 0 auto;
}
/*********************************************/
/** Field table **/
/*********************************************/
.fieldtable {
box-shadow: none !important;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
/*********************************************/
/** Memitem and memtitle **/
/*********************************************/
.memitem,
.memproto,
.memdoc {
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
background-image: none;
}
/*********************************************/
/** TOP navigation **/
/*********************************************/
.tablist a:hover,
.tablist li.current a {
text-shadow: none;
-moz-text-shadow: none;
-webkit-text-shadow: none;
}
/*********************************************/
/** H1 in textblocks **/
/*********************************************/
.textblock h1 {
border-bottom: 1px solid #32363d;
border-left: 3px solid #32363d;
margin: 40px 0px 10px 0px;
padding-bottom: 10px;
padding-top: 10px;
padding-left: 5px;
}
.textblock h1:first-child {
margin-top: 10px;
}
/*********************************************/
/** Note, warning **/
/*********************************************/
dl.note,
dl.warning,
dl.todo,
dl.deprecated,
dl.reflist {
border: 0;
padding: 0px;
margin: 4px 0px 4px 0px;
border-radius: 4px;
}
dl.note dt,
dl.warning dt,
dl.todo dt,
dl.deprecated dt,
dl.reflist dt {
margin: 0;
font-size: 14px;
padding: 2px 4px;
border: none;
border-top-left-radius: 0px;
border-top-right-radius:0px;
font-weight: bold;
text-transform: uppercase;
color: #FFFFFF !important;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
text-shadow: none;
}
dl.note dd,
dl.warning dd,
dl.todo dd,
dl.deprecated dd,
dl.reflist dd {
margin: 0;
padding: 4px;
background: none;
color: #222222;
border: 1px solid;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
border-top: none;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
text-shadow: none;
}
dl.reflist dd {
margin-bottom: 15px;
}
/* Background colors */
dl.note {}
dl.warning {}
dl.todo {}
dl.deprecated {}
dl.reflist {}
/* Header */
dl.note dt {
background-color: #cbc693;
}
dl.warning dt {
background-color: #bf5f82;
}
dl.todo dt {
background-color: #82b3c9;
}
dl.deprecated dt {
background-color: #af8eb5;
}
dl.reflist dt {
background-color: #cbae82;
}
/* Content */
dl.note dd {
background-color: #fff9c4;
border-color: #cbc693;
}
dl.warning dd {
background-color: #f48fb1;
border-color: #bf5f82;
}
dl.todo dd {
background-color: #b3e5fc;
border-color: #82b3c9;
}
dl.deprecated dd {
background-color: #e1bee7;
border-color: #af8eb5;
}
dl.reflist dd {
background-color: #ffe0b2;
border-color: #cbae82;
}
/*********************************************/
/** Reference list **/
/**Similar to warning/note/todo/... messages**/
/*********************************************/
dl.reflist {
}
/*********************************************/
/** Note, warning **/
/*********************************************/
#docs_list {
padding: 0 10px;
}
#docs_list ul {
margin: 0;
padding: 0;
list-style: none;
}
#docs_list ul li {
display: inline-block;
border-right: 1px solid #BFBFBF;
}
#docs_list ul li:last-child {
border-right: none;
}
#docs_list ul li a {
display: block;
padding: 8px 13px;
font-weight: bold;
font-size: 15px;
}
#docs_list ul li a:hover,
#docs_list ul li a.docs_current {
text-decoration: underline;
}
/*********************************************/
/** Resizable UI **/
/*********************************************/
.ui-resizable-e {
width: 3px;
}
/*********************************************/
/** Download url **/
/*********************************************/
.download_url {
font-weight: bold;
font-size: 150%;
line-height: 150%;
}
/*********************************************/
/** Syntax folor **/
/*********************************************/
div.line a {
text-decoration: underline;
}
span.lineno a {
text-decoration: none;
}
/*********************************************/
/** Modules/Directory table **/
/*********************************************/
.directory .arrow {
height: initial;
}
.directory td.entry {
padding: 3px 6px;
}
/*********************************************/
/** Mem items **/
/*********************************************/
.memproto table td {
font-family: monospace, fixed !important;
}
td.memItemLeft, td.memItemRight {
font-family: monospace, fixed;
}
.paramname, .paramname em {
font-style: italic;
}
.memdoc {
text-shadow: none;
}
.memItem {
font-family: monospace, fixed;
}
.memItem table {
font-family: inherit;
}
/*********************************************/
/** Footer **/
/*********************************************/
img.footer {
height: 22px;
}
/*********************************************/
/** Custom scrollbar **/
/*********************************************/
/*********************************************/
/** Custom scrollbar **/
/*********************************************/

View File

@ -0,0 +1,424 @@
/* Light background: #3 5 3 6 2 9; */
/* New light dark background #3 2 3 6 3 d */
/* Dark background: #d f e 5 f 2; */
/* TOP MENU */
.sm-dox {
background: #dfe5f2 !important;
}
.sm-dox a {
background: none;
}
body {
background: #282923;
background-image: none;
color: #D8D8D8;
}
div.fragment, pre.fragment {
border: 1px solid #000000;
background: #32363d;
}
a, a:link, a:visited {
color: #67d8ef !important;
}
.highlighted {
background: none !important;
}
a.highlighted {
background: none !important;
}
/*********************************************/
/** Top main menu **/
/*********************************************/
#main-nav {
/* display: none; */
border-bottom: 1px solid #32363d;
}
#main-nav .sm-dox {
background: transparent !important;
}
.sm-dox a {
text-shadow: none !important;
background: transparent !important;
}
.sm-dox a:hover {
background: #282923 !important;
}
.sm-dox {
text-shadow: none !important;
box-shadow: none !important;
}
.sm-dox ul {
border: 1px solid #000000;
background: #32363d;
}
.directory tr.even {
background: #32363d;
}
/*********************************************/
/** Top search **/
/*********************************************/
#MSearchSelectWindow {
border: 1px solid #000000;
background: #32363d;
}
a.selectItem {
padding: 3px;
}
a.SelectItem:hover {
background: #282923 !important;
}
#MSearchResultsWindow {
border: 1px solid #000000;
background: #32363d;
color: #67d8ef !important;;
}
/*********************************************/
/** Main menu **/
/*********************************************/
#nav-tree {
background: transparent;
}
#nav-tree .selected {
background-image: none;
background: #32363d;
}
/*********************************************/
/** Main content **/
/*********************************************/
/*********************************************/
/** Inline code **/
/*********************************************/
p code,
li code,
td code,
dd code {
background-color: #000000;
border: 1px solid #A8B8D9;
color: #D8D8D8;
}
/*********************************************/
/** Table of Contents (ToC) **/
/*********************************************/
div.toc {
background: #32363d;
border: 1px solid #000000;
}
div.toc h3 {
font-size: 150%;
color: inherit;
}
/*********************************************/
/** Content table **/
/*********************************************/
table.doxtable tr:nth-child(even) td {
background: #32363d;
}
div.header {
background: transparent;
border-bottom: 1px solid #32363d;
}
/*********************************************/
/** Field table **/
/*********************************************/
.fieldtable th {
background: #282923;
color: inherit;
}
/*********************************************/
/** Memitem and memtitle **/
/*********************************************/
.memdoc {
border: 1px solid #A8B8D9;
}
/*********************************************/
/** TOP navigation **/
/*********************************************/
.tabs, .tabs2, .tabs3 {
background: #DDDDDD;
}
.tablist li {
background: transparent !important;
}
.tablist a {
background-image: none;
border-right: 1px solid #999999;
color: #32363d;
}
.tablist a:hover,
.tablist li.current a {
text-decoration: none;
color: #000000;
background: #CCCCCC;
background-image: none;
}
/*********************************************/
/** H1 in textblocks **/
/*********************************************/
/*********************************************/
/** Note, warning **/
/*********************************************/
/*********************************************/
/** Reference list **/
/**Similar to warning/note/todo/... messages**/
/*********************************************/
dl.reflist {
}
/*********************************************/
/** Note, warning **/
/*********************************************/
#docs_list {
background: #32363d;
}
#docs_list ul li {
border-right: 1px solid #BFBFBF;
}
#docs_list ul li a {
color: #1b1e21;
}
#docs_list ul li a:hover,
#docs_list ul li a.docs_current {
background: #282923;
}
/*********************************************/
/** Resizable UI **/
/*********************************************/
.ui-resizable-e {
background: #32363d;
}
/*********************************************/
/** Download url **/
/*********************************************/
/*********************************************/
/** Syntax folor **/
/*********************************************/
div.line {
background: transparent;
color: #d7d7d7;
}
div.line a {
color: inherit;
}
span.keyword {
color: #f92472;
font-style: italic;
}
span.keywordtype {
color: #67cfc1;
font-style: italic;
}
span.keywordflow {
color: #f92472;
font-style: italic;
}
span.comment {
color: #74705a;
}
span.preprocessor {
color: #a6e22b;
}
span.stringliteral {
color: #e7db74;
}
span.charliteral {
color: #e7db74;
}
span.vhdldigit {
color: #ff00ff;
}
span.vhdlchar {
color: #000000;
}
span.vhdlkeyword {
color: #700070;
}
span.vhdllogic {
color: #ff0000;
}
span.lineno {
background: transparent;
}
span.lineno a {
background: transparent;
}
/*********************************************/
/** Modules/Directory table **/
/*********************************************/
.mdescLeft, .mdescRight, .memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
background: #32363d;
color: inherit;
}
.memtemplate {
color: #B4CCF9;
}
.memSeparator {
border: none;
background: transparent;
}
h2.groupheader {
color: #67d8ef;
}
/*********************************************/
/** Mem items **/
/*********************************************/
.memtitle {
background: #32363d !important;
border-color: #000000;
}
.memitem {
background: #32363d !important;
color: inherit;
text-shadow: none;
}
.memproto {
background: inherit;
border-color: #000000;
color: inherit;
text-shadow: none;
}
.memproto table td {
font-family: monospace, fixed !important;
}
td.memItemLeft, td.memItemRight {
font-family: monospace, fixed;
}
.paramname, .paramname em {
color: #bf5f82;
}
.memdoc {
background: inherit;
border-color: #000000;
}
/*********************************************/
/** Footer **/
/*********************************************/
.titlearea {
border-bottom: 1px solid #32363d;
}
/*********************************************/
/** Footer **/
/*********************************************/
#nav-path {
background: transparent;
}
#nav-path ul {
background: transparent;
color: inherit;
border: none;
border-top: 1px solid #32363d;
}
.navpath li.footer {
color: inherit;
}
.navpath li.navelem a {
text-shadow: none;
}
/*********************************************/
/** Custom scrollbar **/
/*********************************************/
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
border-radius: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #234567;
border: none;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #32363d;
}
/*********************************************/
/** Custom scrollbar **/
/*********************************************/
h1.glow, h2.glow, h3.glow,
h4.glow, h5.glow, h6.glow {
text-shadow: 0 0 15px #67d8ef;
}

View File

@ -0,0 +1,19 @@
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">
Generated on $datetime for $projectname by <a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath$doxygen.png" alt="doxygen"
onerror="this.onerror=null;this.src='$relpath$doxygen.svg';"/></a> $doxygenversion.
Dark theme by <a href="http://majerle.eu" target="_new">Tilen Majerle</a>. All rights reserved.
</li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<!--END !GENERATE_TREEVIEW-->
<script src="$relpath^custom.js"></script>
</body>
</html>

View File

@ -0,0 +1,55 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">$projectname
<!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td style="padding-left: 0.5em;">
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<td>$searchbox</td>
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->

3
doc/guide/conf.py Normal file
View File

@ -0,0 +1,3 @@
project = 'MuzGen'
version = '0.0.0'
html_theme = 'furo'

7
doc/guide/index.rst Normal file
View File

@ -0,0 +1,7 @@
Sound design with MuzGen
------------------------
.. toctree::
intro
install

6
doc/guide/install.rst Normal file
View File

@ -0,0 +1,6 @@
Installation
------------
.. code-block:: bash
make install

4
doc/guide/intro.rst Normal file
View File

@ -0,0 +1,4 @@
Introduction
------------
MuzGen is a programming language for sound designers.

View File

@ -0,0 +1,27 @@
alabaster==0.7.16
Babel==2.14.0
beautifulsoup4==4.12.3
certifi==2023.11.17
charset-normalizer==3.3.2
docutils==0.20.1
furo==2023.9.10
idna==3.6
imagesize==1.4.1
Jinja2==3.1.3
MarkupSafe==2.1.4
packaging==23.2
Pygments==2.17.2
python-json-logger==2.0.7
requests==2.31.0
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==7.2.6
sphinx-basic-ng==1.0.0b2
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
structlog==21.5.0
urllib3==2.1.0

37
lib/CMakeLists.txt Normal file
View File

@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.2)
project(MuzGenLib)
configure_file(
conf.in.hpp
${CMAKE_SOURCE_DIR}/lib/conf.hpp
)
add_library(muz-lib OBJECT
Signal.cpp
)
set_property(TARGET muz-lib
PROPERTY CXX_STANDARD 17
)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
target_compile_options(muz-lib
PRIVATE --coverage
)
target_link_options(muz-lib
PUBLIC --coverage
)
find_program(LCOV_PATH lcov REQUIRED)
find_program(GENHTML_PATH genhtml REQUIRED)
add_custom_target(cov
COMMAND ${LCOV_PATH} -d . --zerocounters
COMMAND $<TARGET_FILE:muz-test>
COMMAND ${LCOV_PATH} -d . --capture -o cov.info
COMMAND ${LCOV_PATH} -r cov.info '/usr/include/*' -o cov.info
COMMAND ${GENHTML_PATH} --legend -o cov_html cov.info
)
endif()

12
lib/Signal.cpp Normal file
View File

@ -0,0 +1,12 @@
#include "Signal.hpp"
namespace muz
{
/*explicit*/ Signal::Signal()
{
}
/*virtual*/ Signal::~Signal()
{
}
}

16
lib/Signal.hpp Normal file
View File

@ -0,0 +1,16 @@
#ifndef muz_SIGNAL_HPP
#define muz_SIGNAL_HPP
namespace muz
{
class Signal
{
public:
explicit Signal();
virtual ~Signal();
private:
};
}
#endif

7
lib/commons.hpp Normal file
View File

@ -0,0 +1,7 @@
#ifndef muz_COMMONS_HPP
#define muz_COMMONS_HPP
#include <string>
#include "conf.hpp"
#endif

6
lib/conf.hpp Normal file
View File

@ -0,0 +1,6 @@
#ifndef muz_CONF_HPP
#define muz_CONF_HPP
#define MUZ_VERSION std::string("0.0.0")
#endif

6
lib/conf.in.hpp Normal file
View File

@ -0,0 +1,6 @@
#ifndef muz_CONF_HPP
#define muz_CONF_HPP
#cmakedefine MUZ_VERSION std::string("@MUZ_VERSION@")
#endif

23
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.2)
project(MuzGenExe)
add_executable(muz
main.cpp
)
set_property(TARGET muz
PROPERTY CXX_STANDARD 17
)
install(TARGETS muz)
add_dependencies(muz muz-lib)
target_link_libraries(muz
PRIVATE muz-lib
)
target_include_directories(muz
PRIVATE ${CMAKE_SOURCE_DIR}
)

8
src/main.cpp Normal file
View File

@ -0,0 +1,8 @@
#include <iostream>
#include <lib/commons.hpp>
int main(int argc, char** argv)
{
std::cout << "muzgen " << MUZ_VERSION << std::endl;
return 0;
}

26
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.2)
project(MuzGenTest)
find_package(Catch2 REQUIRED)
add_executable(muz-test
trivial.cpp
)
set_property(TARGET muz-test
PROPERTY CXX_STANDARD 17
)
add_dependencies(muz-test
muz-lib
)
target_link_libraries(muz-test
PRIVATE Catch2::Catch2WithMain
PRIVATE muz-lib
)
target_include_directories(muz-test
PRIVATE ${CMAKE_SOURCE_DIR}
)

15
tests/trivial.cpp Normal file
View File

@ -0,0 +1,15 @@
#include <catch2/catch.hpp>
class trivialTest
{
public:
explicit trivialTest() {}
virtual ~trivialTest() {}
protected:
};
TEST_CASE_METHOD(trivialTest, "trivial_test")
{
REQUIRE(true);
}