Files
neovim/cmake.deps/cmake/libtermkeyCMakeLists.txt
Justin M. Keyes f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00

35 lines
953 B
Plaintext

cmake_minimum_required(VERSION 2.8.12)
project(libtermkey)
add_definitions(-D _CRT_SECURE_NO_WARNINGS)
add_definitions(-DHAVE_UNIBILIUM)
if(NOT MSVC)
add_compile_options(-std=c99)
endif()
include_directories(${PROJECT_BINARY_DIR}/t)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
add_library(termkey termkey.c driver-csi.c driver-ti.c)
set_target_properties(termkey PROPERTIES
PUBLIC_HEADER ${PROJECT_SOURCE_DIR}/termkey.h)
target_link_libraries(termkey ${UNIBILIUM_LIBRARIES})
include(GNUInstallDirs)
install(TARGETS termkey
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
enable_testing()
file(GLOB TESTSOURCES "t/[0-9]*.c")
foreach(f ${TESTSOURCES})
get_filename_component(t ${f} NAME_WE)
if(${t} STREQUAL 05read)
continue()
endif()
add_executable("test_${t}" ${f} t/taplib.c)
target_link_libraries("test_${t}" termkey)
add_test("${t}" "test_${t}")
endforeach()