56 lines
1.1 KiB
CMake
56 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.23)
|
|
|
|
project(editor)
|
|
|
|
include(FetchContent)
|
|
include(FindPkgConfig)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
FetchContent_Declare(
|
|
raylib
|
|
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
|
GIT_TAG 5.5
|
|
)
|
|
|
|
FetchContent_Declare(
|
|
sds
|
|
GIT_REPOSITORY https://github.com/antirez/sds.git
|
|
GIT_TAG 2.0.0
|
|
)
|
|
|
|
FetchContent_MakeAvailable(raylib)
|
|
|
|
FetchContent_MakeAvailable(sds)
|
|
if(NOT TARGET sds)
|
|
add_library(sds STATIC "${sds_SOURCE_DIR}/sds.c")
|
|
target_include_directories(sds PUBLIC "${sds_SOURCE_DIR}")
|
|
endif()
|
|
|
|
find_package(Freetype REQUIRED)
|
|
pkg_check_modules(HARFBUZZ REQUIRED harfbuzz)
|
|
|
|
add_executable(editor)
|
|
|
|
target_compile_features(editor PRIVATE c_std_11)
|
|
set_property(TARGET editor PROPERTY C_EXTENSIONS OFF)
|
|
|
|
target_sources(editor
|
|
PRIVATE
|
|
main.c
|
|
editor.c
|
|
)
|
|
|
|
target_compile_options(editor PRIVATE -Wall -Werror)
|
|
target_compile_options(editor PRIVATE ${HARFBUZZ_CFLAGS_OTHER})
|
|
|
|
target_include_directories(editor PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(editor
|
|
PRIVATE
|
|
raylib
|
|
sds
|
|
Freetype::Freetype
|
|
${HARFBUZZ_LIBRARIES}
|
|
)
|