cmake_minimum_required(VERSION 3.16) project(getch C) set(CMAKE_C_STANDARD 11) add_library(getch SHARED getch.c getch.h) add_executable(example example.c ) target_link_libraries(example -L./build getch)