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:
@@ -1,24 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(libinput CXX)
|
||||
|
||||
set(LIBINPUT_SOURCES
|
||||
KeyEvent.cpp
|
||||
KeyboardLayout.cpp
|
||||
)
|
||||
|
||||
add_custom_target(libinput-headers
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
||||
DEPENDS sysroot
|
||||
)
|
||||
|
||||
add_library(libinput ${LIBINPUT_SOURCES})
|
||||
target_link_libraries(libinput PUBLIC libc ban)
|
||||
banan_include_headers(libinput ban)
|
||||
banan_link_library(libinput libc)
|
||||
|
||||
add_custom_target(libinput-install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libinput.a ${BANAN_LIB}/
|
||||
DEPENDS libinput
|
||||
BYPRODUCTS ${BANAN_LIB}/libinput.a
|
||||
)
|
||||
banan_install_headers(libinput)
|
||||
install(TARGETS libinput)
|
||||
|
||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||
|
||||
Reference in New Issue
Block a user