Clean up CMakeLists in all C++ examples

+ Rename output executables to match directory structure
+ Remove libraries for small examples
+ Supress -Wreturn-type warnings for singleton that is intentionally not copyable
This commit is contained in:
2022-03-31 16:01:08 -04:00
parent 573fc4e1e8
commit a97dfbe34b
98 changed files with 695 additions and 598 deletions

View File

@@ -1,19 +1,27 @@
###############################################################################
## 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 ##
##############################################################################
#
################################################################################
## 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)
# CMake options
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Compiler options
add_compile_options("-Wall")
# Define the your project name
project(cmake-template)
project (
#[[NAME]] CMakeTemplate
VERSION 1.0
DESCRIPTION "A basic CMake template for C++ projects"
LANGUAGES CXX
)
# Include any directories the compiler may need
include_directories(./include)

View File

@@ -1,17 +1,16 @@
###############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################
################################################################################
## 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})
add_executable(cmake-example-template ${APP_SRC})
# Link to our custom library, defined in c-cmake/src/
target_link_libraries(say-hello lib-klips)
target_link_libraries(cmake-example-template cmake-example-lib)

View File

@@ -6,7 +6,7 @@
################################################################################
*/
#include <lib-klips.hpp>
#include <lib-example.hpp>
#include <iostream>
int main () {

View File

@@ -1,14 +1,13 @@
###############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################
################################################################################
## 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)
set(LIB_SRC lib-example.cpp)
# Define our library within CMake and link to the source code
add_library(lib-klips ${LIB_SRC})
add_library(cmake-example-lib ${LIB_SRC})

View File

@@ -6,7 +6,7 @@
################################################################################
*/
#include <lib-klips.hpp>
#include <lib-example.hpp>
#include <iostream>
void PrintHello(int n) {