From 79cd0cbe9fc3cee836a0d169a2fafd34894acc9b Mon Sep 17 00:00:00 2001 From: Jules Fouchy Date: Fri, 5 Jul 2024 15:13:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20[Launcher]=20Basic=20project=20s?= =?UTF-8?q?etup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 7 ++++++- Launcher/CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++++++++ Launcher/src/main.cpp | 7 +++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Launcher/CMakeLists.txt create mode 100644 Launcher/src/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 99fce7d9..13d2ce82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,4 +189,9 @@ set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/app-resources/Info.plist") set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/app-resources/icon.icns") # -include(CPack) \ No newline at end of file +include(CPack) + +# --------------------- +# ---Launcher--- +# --------------------- +add_subdirectory(Launcher) \ No newline at end of file diff --git a/Launcher/CMakeLists.txt b/Launcher/CMakeLists.txt new file mode 100644 index 00000000..8efdc1b8 --- /dev/null +++ b/Launcher/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.20) + +project(Coollab-Launcher) +add_executable(${PROJECT_NAME}) + +# Choose C++ version +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +# Set the folder where the executable is created +set_target_properties(${PROJECT_NAME} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/Launcher/${CMAKE_BUILD_TYPE}) + +# Set warning level +if(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /W4) +else() + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -pedantic-errors -Wconversion -Wsign-conversion -Wimplicit-fallthrough) +endif() + +# Maybe enable warnings as errors +set(WARNINGS_AS_ERRORS_FOR_COOLLAB_LAUNCHER OFF CACHE BOOL "ON iff you want to treat warnings as errors") # Might be overriden in the CMake cache + +if(WARNINGS_AS_ERRORS_FOR_COOLLAB_LAUNCHER) + if(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /WX) + else() + target_compile_options(${PROJECT_NAME} PRIVATE -Werror) + endif() +endif() + +# Set app icon +Cool__set_app_icon(${PROJECT_NAME} "../res/logo.png" "${CMAKE_SOURCE_DIR}/app-resources/icon.rc") + +# Grab all the source files +file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*) +target_sources(${PROJECT_NAME} PRIVATE ${SOURCES}) + +# Set include directories +target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE src) \ No newline at end of file diff --git a/Launcher/src/main.cpp b/Launcher/src/main.cpp new file mode 100644 index 00000000..9f604124 --- /dev/null +++ b/Launcher/src/main.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + std::cout << "Hello\n"; + std::cin.get(); +} \ No newline at end of file