From 43726885746740d5cb36def8b7bd704d4f56f309 Mon Sep 17 00:00:00 2001 From: Ron Hough Date: Sat, 4 Mar 2023 12:38:01 -0600 Subject: [PATCH] Build a basic "hello world" with CMake --- .gitignore | 12 ++++++++++++ CMakeLists.txt | 7 +++++++ src/cppchallenge.cpp | 8 ++++++++ 3 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 src/cppchallenge.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce5b7ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..498500f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.24.2) +set (CMAKE_CXX_STANDARD 11) + +project (cppchallenge) +set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "build") +file(GLOB SOURCES "src/*.cpp") +add_executable(cppchallenge ${SOURCES}) diff --git a/src/cppchallenge.cpp b/src/cppchallenge.cpp new file mode 100644 index 0000000..2804dbd --- /dev/null +++ b/src/cppchallenge.cpp @@ -0,0 +1,8 @@ +#include + +int main(int argc, char *argv[]){ + std::cout << "Hello World!" << std::endl; + return 0; +} + +// vim: set ts=4 expandtab :