2022-08-03 05:56:57 -07:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2023-02-26 05:32:37 -07:00
|
|
|
project(libvterm C)
|
2016-07-29 05:53:44 -07:00
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
|
|
if(MSVC)
|
2019-06-29 11:37:48 -07:00
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
2016-07-29 05:53:44 -07:00
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
|
2023-01-25 16:06:52 -07:00
|
|
|
add_library(vterm ${VTERM_SOURCES})
|
2016-07-29 05:53:44 -07:00
|
|
|
install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
|
|
|
|
|
|
install(FILES include/vterm.h include/vterm_keycodes.h
|
|
|
|
DESTINATION include)
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c)
|
|
|
|
foreach(EXE_C ${BIN_SOURCES})
|
|
|
|
get_filename_component(target_name ${EXE_C} NAME_WE)
|
|
|
|
add_executable(${target_name} ${EXE_C})
|
|
|
|
target_link_libraries(${target_name} vterm)
|
|
|
|
install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2022-10-21 02:47:27 -07:00
|
|
|
# vim: set ft=cmake:
|