Skip to content

Commit

Permalink
Add initial project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
bytebat committed Dec 29, 2022
1 parent 5b135cb commit 963138b
Show file tree
Hide file tree
Showing 5 changed files with 663 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.20)

# Project settings

project("traceit")

set(CMAKE_CXX_STANDARD 17)

# components

add_subdirectory(TraceIt)
41 changes: 41 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"version": 3
}
55 changes: 55 additions & 0 deletions TraceIt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# TraceIt Studio cmake project

# Dependencies -------------------------------------------------------

## ImGui

set(imgui_SRC_DIR "3rdparty/imgui-1.89.1")

add_library(imgui)

target_include_directories(imgui PUBLIC
${imgui_SRC_DIR}/
${imgui_SRC_DIR}/backends
)

target_sources(imgui PRIVATE
${imgui_SRC_DIR}/imgui.h
${imgui_SRC_DIR}/imgui_internal.h
${imgui_SRC_DIR}/imgui.cpp
${imgui_SRC_DIR}/imgui_demo.cpp
${imgui_SRC_DIR}/imgui_draw.cpp
${imgui_SRC_DIR}/imgui_tables.cpp
${imgui_SRC_DIR}/imgui_widgets.cpp
)

## glfw

set(glfw_SRC_DIR "3rdparty/glfw-3.3.8")

add_library(glfw SHARED IMPORTED)

target_include_directories(glfw INTERFACE "${glfw_SRC_DIR}/include")

set_target_properties(glfw PROPERTIES
IMPORTED_LOCATION "${glfw_SRC_DIR}/lib-vc2022/glfw3.dll"
IMPORTED_IMPLIB "${glfw_SRC_DIR}/lib-vc2022/glfw3.lib"
)

## Vulkan

find_package(Vulkan REQUIRED)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES")

# Build --------------------------------------------------------------

add_executable(studio "src/app.cpp" "src/app.h")

target_link_libraries(studio
PRIVATE
glfw
imgui
Vulkan::Vulkan
)
Loading

0 comments on commit 963138b

Please sign in to comment.