BuildSystem: Rework the whole cmake build system

Now files are installed using the install() command instead of manually
copying files to their destinations. This allows automatic recompilation
of headers that did not work previously
This commit is contained in:
2024-06-19 04:20:23 +03:00
parent 318ce5dec8
commit ad6d95ba52
90 changed files with 546 additions and 1074 deletions

View File

@@ -1,25 +1,13 @@
cmake_minimum_required(VERSION 3.26)
project(libfont CXX)
set(LIBGUI_SOURCES
Font.cpp
PSF.cpp
)
add_custom_target(libfont-headers
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
DEPENDS sysroot
)
add_library(libfont ${LIBGUI_SOURCES})
add_dependencies(libfont headers libc-install)
target_link_libraries(libfont PUBLIC libc)
banan_link_library(libfont libc)
banan_link_library(libfont ban)
add_custom_target(libfont-install
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libfont.a ${BANAN_LIB}/
DEPENDS libfont
BYPRODUCTS ${BANAN_LIB}/libfont.a
)
banan_install_headers(libfont)
install(TARGETS libfont)
set(CMAKE_STATIC_LIBRARY_PREFIX "")