Skip to content

Commit

Permalink
🎉 [Launcher] Basic project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Jul 5, 2024
1 parent b143f0f commit 79cd0cb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
include(CPack)

# ---------------------
# ---Launcher---
# ---------------------
add_subdirectory(Launcher)
39 changes: 39 additions & 0 deletions Launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions Launcher/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>

int main()
{
std::cout << "Hello\n";
std::cin.get();
}

0 comments on commit 79cd0cb

Please sign in to comment.