From f00e38611c2bdf71e071b611422c7b27ea227822 Mon Sep 17 00:00:00 2001 From: swang251-MB Date: Sat, 18 Sep 2021 13:40:34 -0400 Subject: [PATCH] include add_subdirectory for STK projects --- CMakeLists.txt | 9 +++++++++ projects/demo/CMakeLists.txt | 9 +++++++++ projects/effects/CMakeLists.txt | 9 +++++++++ projects/eguitar/CMakeLists.txt | 9 +++++++++ projects/examples/CMakeLists.txt | 11 +++++++++++ projects/ragamatic/CMakeLists.txt | 9 +++++++++ 6 files changed, 56 insertions(+) create mode 100644 projects/demo/CMakeLists.txt create mode 100644 projects/effects/CMakeLists.txt create mode 100644 projects/eguitar/CMakeLists.txt create mode 100644 projects/examples/CMakeLists.txt create mode 100644 projects/ragamatic/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 151ac5b..0135028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ option(ENABLE_ASIO "Enable ASIO API support (windows only)" ON) option(ENABLE_DS "Enable DirectSound API support (windows only)" ON) option(ENABLE_WASAPI "Enable Windows Audio Session API support (windows only)" ON) option(ENABLE_CORE "Enable CoreAudio API support (mac only)" ON) +option(COMPILE_PROJECTS "Compile all the example projects" OFF) include_directories("./include") file(GLOB STK_SRC "./src/*.cpp") # GLOB instead of GLOB_RECURSE as the asio depends on system @@ -97,3 +98,11 @@ endif() # if(CMAKE_CXX_BYTE_ORDER STREQUAL LITTLE_ENDIAN) # target_compile_definitions(stk PUBLIC __LITTLE_ENDIAN__) # endif() + +if(COMPILE_PROJECTS) + add_subdirectory(projects/examples) + add_subdirectory(projects/eguitar) + add_subdirectory(projects/demo) + add_subdirectory(projects/effects) + add_subdirectory(projects/ragamatic) +endif() \ No newline at end of file diff --git a/projects/demo/CMakeLists.txt b/projects/demo/CMakeLists.txt new file mode 100644 index 0000000..1fc70f1 --- /dev/null +++ b/projects/demo/CMakeLists.txt @@ -0,0 +1,9 @@ +project(demo) + +file(GLOB DEMO_SRC "./*.cpp") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") + +add_executable(stk-demo "demo.cpp" "utilities.cpp") +target_include_directories(stk-demo PRIVATE "./") +target_link_libraries(stk-demo PUBLIC stk) \ No newline at end of file diff --git a/projects/effects/CMakeLists.txt b/projects/effects/CMakeLists.txt new file mode 100644 index 0000000..c401c42 --- /dev/null +++ b/projects/effects/CMakeLists.txt @@ -0,0 +1,9 @@ +project(effects) + +file(GLOB EFFECTS_SRC "./*.cpp") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") + +add_executable(${PROJECT_NAME} ${EFFECTS_SRC}) +target_include_directories(${PROJECT_NAME} PRIVATE "./") +target_link_libraries(${PROJECT_NAME} PUBLIC stk) \ No newline at end of file diff --git a/projects/eguitar/CMakeLists.txt b/projects/eguitar/CMakeLists.txt new file mode 100644 index 0000000..87817f7 --- /dev/null +++ b/projects/eguitar/CMakeLists.txt @@ -0,0 +1,9 @@ +project(eguitar) + +file(GLOB EGUITAR_SRC "./*.cpp") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") + +add_executable(${PROJECT_NAME} ${EGUITAR_SRC}) +target_include_directories(${PROJECT_NAME} PRIVATE "./") +target_link_libraries(${PROJECT_NAME} PUBLIC stk) \ No newline at end of file diff --git a/projects/examples/CMakeLists.txt b/projects/examples/CMakeLists.txt new file mode 100644 index 0000000..6836806 --- /dev/null +++ b/projects/examples/CMakeLists.txt @@ -0,0 +1,11 @@ +project(examples) + +file(GLOB EXAMPLE_SRC "./*.cpp") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") + +foreach(src ${EXAMPLE_SRC}) + get_filename_component(src_bin ${src} NAME_WE) + add_executable(${src_bin} ${src}) + target_link_libraries(${src_bin} PUBLIC stk) +endforeach() diff --git a/projects/ragamatic/CMakeLists.txt b/projects/ragamatic/CMakeLists.txt new file mode 100644 index 0000000..9b8c191 --- /dev/null +++ b/projects/ragamatic/CMakeLists.txt @@ -0,0 +1,9 @@ +project(ragamat) + +file(GLOB RAGMATIC_SRC "./*.cpp") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") + +add_executable(${PROJECT_NAME} ${RAGMATIC_SRC}) +target_include_directories(${PROJECT_NAME} PRIVATE "./") +target_link_libraries(${PROJECT_NAME} PUBLIC stk) \ No newline at end of file