2021-02-22 15:17:06 -08:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(getch C)
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
2021-02-24 20:46:16 -08:00
|
|
|
set(CMAKE_COLOR_MAKEFILE ON)
|
2021-02-22 15:17:06 -08:00
|
|
|
|
|
|
|
add_library(getch SHARED getch.c getch.h)
|
2021-02-22 15:33:01 -08:00
|
|
|
add_executable(example example.c )
|
2021-02-24 20:46:16 -08:00
|
|
|
add_executable(getchTest tests/test.c tests/getchTests.c)
|
|
|
|
add_test(NAME getchTests
|
|
|
|
COMMAND getchTest
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
target_link_libraries(getchTest -L./build getch)
|
|
|
|
target_link_libraries(example -L./build getch)
|
|
|
|
if (ENABLE_TESTS EQUAL 1)
|
|
|
|
enable_testing()
|
|
|
|
endif ()
|
2021-02-22 15:17:06 -08:00
|
|
|
|