CMake: Add necessary install rules for 'make install'

This commit is contained in:
osamu-kj 2023-05-14 14:22:27 +02:00
parent 87bb21be58
commit 417f9fcbf2
5 changed files with 11 additions and 1 deletions

View File

@ -20,9 +20,13 @@ project(vis
DESCRIPTION "Vi Scheduler (vis) is a simple TUI program built for managing your schedules in a calendar-like grid." DESCRIPTION "Vi Scheduler (vis) is a simple TUI program built for managing your schedules in a calendar-like grid."
LANGUAGES CXX C) LANGUAGES CXX C)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_subdirectory(src) add_subdirectory(src)
find_library(NCURSES_LIB NAMES ncurses) find_library(NCURSES_LIB NAMES ncurses)
target_link_libraries(vis ncurses) target_link_libraries(vis ncurses)
install(TARGETS vis DESTINATION bin)

View File

@ -7,3 +7,6 @@ add_executable(vis main.cpp)
target_link_libraries(vis engine) target_link_libraries(vis engine)
target_link_libraries(vis calendar) target_link_libraries(vis calendar)
target_link_libraries(vis base64) target_link_libraries(vis base64)
set(installable_libs engine calendar base64)
install(TARGETS ${installable_libs} DESTINATION lib)

View File

@ -1 +1,2 @@
add_library(base64 SHARED base64.c) add_library(base64 SHARED base64.c)
install(FILES base64.h DESTINATION include)

View File

@ -1 +1,2 @@
add_library(calendar SHARED calendar.cpp) add_library(calendar SHARED calendar.cpp)
install(FILES calendar.hpp DESTINATION include)

View File

@ -1 +1,2 @@
add_library(engine SHARED engine.cpp) add_library(engine SHARED engine.cpp)
install(FILES engine.hpp DESTINATION include)