From 8646cd51ea9781a22a3fdfac0a18565279d401c7 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Tue, 4 May 2021 23:07:39 -0400 Subject: [PATCH] Add CMakeLists for algorithms subdirectories --- cpp/CMakeLists.txt | 1 + cpp/algorithms/CMakeLists.txt | 17 +++++++++++++++++ cpp/algorithms/sorting/CMakeLists.txt | 12 ++++++++++++ cpp/algorithms/sorting/merge/CMakeLists.txt | 16 ++++++++++++++++ cpp/algorithms/sorting/selection/CMakeLists.txt | 2 +- 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 cpp/algorithms/CMakeLists.txt create mode 100644 cpp/algorithms/sorting/CMakeLists.txt create mode 100644 cpp/algorithms/sorting/merge/CMakeLists.txt diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d9d58f3..e65379d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -17,6 +17,7 @@ project( LANGUAGES CXX ) +add_subdirectory(algorithms) add_subdirectory(cmake) add_subdirectory(datastructs) add_subdirectory(sdl-cmake) diff --git a/cpp/algorithms/CMakeLists.txt b/cpp/algorithms/CMakeLists.txt new file mode 100644 index 0000000..1614365 --- /dev/null +++ b/cpp/algorithms/CMakeLists.txt @@ -0,0 +1,17 @@ +############################################################################### +## Author: Shaun Reed ## +## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ## +## About: A root project for practicing algorithms in C++ ## +## ## +## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ## +############################################################################## +# +cmake_minimum_required(VERSION 3.15) + +project ( + #[[NAME]] Algorithms + VERSION 1.0 + DESCRIPTION "A project for practicing various algorithms in C++" + LANGUAGES CXX +) +add_subdirectory(sorting) diff --git a/cpp/algorithms/sorting/CMakeLists.txt b/cpp/algorithms/sorting/CMakeLists.txt new file mode 100644 index 0000000..c921db0 --- /dev/null +++ b/cpp/algorithms/sorting/CMakeLists.txt @@ -0,0 +1,12 @@ +############################################################################### +## Author: Shaun Reed ## +## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ## +## About: A root project for practicing sorting algorithms in C++ ## +## ## +## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ## +############################################################################## +# +cmake_minimum_required(VERSION 3.15) + + +add_subdirectory(selection) diff --git a/cpp/algorithms/sorting/merge/CMakeLists.txt b/cpp/algorithms/sorting/merge/CMakeLists.txt new file mode 100644 index 0000000..d717ef6 --- /dev/null +++ b/cpp/algorithms/sorting/merge/CMakeLists.txt @@ -0,0 +1,16 @@ +############################################################################### +## Author: Shaun Reed ## +## Legal: All Content (c) 2020 Shaun Reed, all rights reserved ## +## About: A basic CMakeLists configuration to practice merge sort ## +## ## +## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ## +############################################################################### + +cmake_minimum_required(VERSION 3.17) +project(MergeSort LANGUAGES CXX) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +add_executable(merge-sort "merge-sort.cpp") + +add_library(lib-merge "lib-merge.cpp") +target_link_libraries(merge-sort lib-merge) diff --git a/cpp/algorithms/sorting/selection/CMakeLists.txt b/cpp/algorithms/sorting/selection/CMakeLists.txt index 4a9fab2..eeabcac 100644 --- a/cpp/algorithms/sorting/selection/CMakeLists.txt +++ b/cpp/algorithms/sorting/selection/CMakeLists.txt @@ -6,7 +6,7 @@ ## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ## ############################################################################### -cmake_minimum_required(VERSION 3.17) +cmake_minimum_required(VERSION 3.16) project(SelectionSort LANGUAGES CXX) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)