[cmake-example] Update cmake project example

+ Rename `cmake` -> `cmake-example`
This commit is contained in:
2022-01-31 08:51:50 -05:00
parent 2845b020ae
commit bbbf404340
7 changed files with 24 additions and 24 deletions

View File

@@ -0,0 +1,23 @@
###############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## About: A template project for getting started working with CMake ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################
#
# Define the version of CMake
cmake_minimum_required(VERSION 3.15)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Define the your project name
project(cmake-template)
# Include any directories the compiler may need
include_directories(./include)
# Point CMake to look for more CMakeLists within the following directories
add_subdirectory(src)
add_subdirectory(apps)

View File

@@ -0,0 +1,17 @@
###############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################
## This directory is for storing / compiling our executable code
# Create a reference / variable to refer to our source code
set(APP_SRC say-hello.cpp)
# Add our executable, naming it and linking it to our source code
add_executable(say-hello ${APP_SRC})
# Link to our custom library, defined in c-cmake/src/
target_link_libraries(say-hello lib-klips)

View File

@@ -0,0 +1,19 @@
/*##############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
################################################################################
*/
#include <lib-klips.hpp>
#include <iostream>
int main () {
PrintHello(5);
std::cout << "Press enter to exit the application. \n";
std::cin.ignore();
return 0;
}

View File

@@ -0,0 +1,14 @@
/*##############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
################################################################################
*/
/**
* Prints "Hello World!" \p n times to console.
* @param n The number of times to print "Hello World!"
*/
void PrintHello(int n);

View File

@@ -0,0 +1,14 @@
###############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################
## This directory is for storing source code
# Create any links we might need
set(LIB_SRC lib-klips.cpp)
# Define our library within CMake and link to the source code
add_library(lib-klips ${LIB_SRC})

View File

@@ -0,0 +1,18 @@
/*##############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
################################################################################
*/
#include <lib-klips.hpp>
#include <iostream>
void PrintHello(int n) {
while (n) {
std::cout << n << ". " << "Hello World!" << std::endl;
--n;
};
}