Initial
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(rhistory C)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -O2 -D_POSIX_C_SOURCE=200809L")
|
||||
|
||||
# Find dependencies
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
|
||||
pkg_check_modules(NCURSES REQUIRED ncurses)
|
||||
|
||||
# Include directories
|
||||
include_directories(src)
|
||||
include_directories(${SQLITE3_INCLUDE_DIRS})
|
||||
include_directories(${NCURSES_INCLUDE_DIRS})
|
||||
|
||||
# Source files
|
||||
set(SOURCES
|
||||
src/main.c
|
||||
src/db.c
|
||||
src/history.c
|
||||
src/search.c
|
||||
src/tui.c
|
||||
src/shell_integration.c
|
||||
src/config.c
|
||||
src/utils.c
|
||||
)
|
||||
|
||||
# Main executable
|
||||
add_executable(rhistory ${SOURCES})
|
||||
|
||||
# Link libraries
|
||||
target_link_libraries(rhistory ${SQLITE3_LIBRARIES} ${NCURSES_LIBRARIES})
|
||||
|
||||
# Installation
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS rhistory DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
Reference in New Issue
Block a user