From fb712e17973f68c23d3437a18d80e028adee8822 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 16 Jun 2018 19:40:10 +0900 Subject: [PATCH 1/1] Init commit with skeleton project --- .gitignore | 2 ++ .gitmodules | 3 +++ AnotherDangParser | 1 + CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++ src/Main.cpp | 5 +++++ 5 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 AnotherDangParser create mode 100644 CMakeLists.txt create mode 100644 src/Main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19cc2c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build*/ +compile_commands.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0e55935 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "AnotherDangParser"] + path = AnotherDangParser + url = https://github.com/Stephen-Seo/AnotherDangParser.git diff --git a/AnotherDangParser b/AnotherDangParser new file mode 160000 index 0000000..c3dad62 --- /dev/null +++ b/AnotherDangParser @@ -0,0 +1 @@ +Subproject commit c3dad6273a6b80cb35174e3bd217ee92fd762c07 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8fdc328 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.0) + +project(MeterForPulseAudio VERSION 1.0) + +set(MeterForPulseAudio_SOURCES + src/Main.cpp +) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -D NDEBUG") + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Debug', none was specified.") + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") +endif() + +add_executable(MeterForPulseAudio ${MeterForPulseAudio_SOURCES}) + +if(APPEND_VERSION_TO_EXECUTABLE) + set_target_properties(MeterForPulseAudio + PROPERTIES + VERSION ${MeterForPulseAudio_VERSION} + ) +endif() + +target_compile_features(MeterForPulseAudio PUBLIC cxx_std_14) + +find_package(PulseAudio 11 REQUIRED) +message(STATUS "Found PulseAudio ${PulseAudio_VERSION}") + +target_include_directories(MeterForPulseAudio PUBLIC ${PULSEAUDIO_INCLUDE_DIR}) +target_link_libraries(MeterForPulseAudio PUBLIC ${PULSEAUDIO_LIBRARY}) + +# add sub-project AnotherDangParser +if(NOT EXISTS "${CMAKE_SOURCE_DIR}/AnotherDangParser/src") + message(FATAL_ERROR "AnotherDangParser submodule not loaded! Please run " + "'git submodule update --init --recursive'!") +endif() +add_subdirectory(AnotherDangParser) +target_include_directories(MeterForPulseAudio PUBLIC AnotherDangParser/src) +target_link_libraries(MeterForPulseAudio PUBLIC AnotherDangParser) + +install(TARGETS MeterForPulseAudio + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) diff --git a/src/Main.cpp b/src/Main.cpp new file mode 100644 index 0000000..5549c30 --- /dev/null +++ b/src/Main.cpp @@ -0,0 +1,5 @@ + +int main(int argc, char** argv) +{ + return 0; +} -- 2.49.0