Skip to content

Commit

Permalink
Improve CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
floppyhammer committed May 10, 2024
1 parent 78571a8 commit e1b9eb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.16)

project(pathfinder)

set(CMAKE_CXX_STANDARD 14)
project(pathfinder
VERSION 0.1
LANGUAGES C CXX)

# Set binary output directory.
# (Using CMAKE_CURRENT_SOURCE_DIR is necessary.)
Expand Down Expand Up @@ -32,6 +32,8 @@ endif ()

add_subdirectory(pathfinder)

target_compile_features(pathfinder PUBLIC cxx_std_14)

if (PATHFINDER_VULKAN_SUPPORT)
message("[Pathfinder] Use Vulkan")

Expand Down
10 changes: 5 additions & 5 deletions pathfinder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Recursive search and automatic re-configuration on adding or deleting source files.
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS common/*.cpp core/*.cpp gpu_mem/*.cpp)
file(GLOB_RECURSE PF_SOURCE_FILES CONFIGURE_DEPENDS common/*.cpp core/*.cpp gpu_mem/*.cpp)

file(GLOB SOURCE_FILES ${SOURCE_FILES} gpu/*.cpp)
file(GLOB PF_SOURCE_FILES ${PF_SOURCE_FILES} gpu/*.cpp)

if (PATHFINDER_VULKAN_SUPPORT)
file(GLOB SOURCE_FILES ${SOURCE_FILES} gpu/vk/*.cpp)
file(GLOB PF_SOURCE_FILES ${PF_SOURCE_FILES} gpu/vk/*.cpp)
else ()
file(GLOB SOURCE_FILES ${SOURCE_FILES} gpu/gl/*.cpp)
file(GLOB PF_SOURCE_FILES ${PF_SOURCE_FILES} gpu/gl/*.cpp)
endif ()

# Compile as static library.
add_library(pathfinder ${SOURCE_FILES} ../third_party/glad/src/gl.c)
add_library(pathfinder STATIC ${PF_SOURCE_FILES} ../third_party/glad/src/gl.c)

0 comments on commit e1b9eb7

Please sign in to comment.