From 33e76233a9dfa2707ed22effb1814a752d52aca5 Mon Sep 17 00:00:00 2001 From: Trumeet Date: Thu, 21 Jul 2022 21:50:25 -0700 Subject: build(libacron): add install target Signed-off-by: Trumeet --- client/libacron/CMakeLists.txt | 10 ++++++++++ client/libacron/README.md | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/libacron/CMakeLists.txt b/client/libacron/CMakeLists.txt index c1bbe66..d683416 100644 --- a/client/libacron/CMakeLists.txt +++ b/client/libacron/CMakeLists.txt @@ -92,3 +92,13 @@ add_executable(acronc ) target_link_libraries(acronc ac) target_include_directories(acronc PUBLIC "${PROJECT_BINARY_DIR}" include/) + +install(TARGETS ac ac-static acronc + EXPORT ${PROJECT_NAME}-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/libac +) + +install(FILES ${LIBAC_PUBLIC_HEADERS} DESTINATION include/libac) diff --git a/client/libacron/README.md b/client/libacron/README.md index 5e0f989..240d671 100644 --- a/client/libacron/README.md +++ b/client/libacron/README.md @@ -24,11 +24,12 @@ mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. cmake --build . +DESTDIR=$(pwd)/install cmake --install . ``` The shared library will be at `libac.so` (`ac.dll` on Windows). The static library will be at `libac-static.a` (`ac-static.lib` on Windows). -The distributable headers are at `client/libacron/include/`. +The distributable headers are at `install/usr/local/include/libac/`. To make debug builds, use the Debug build type. Debug builds will have ASAN enabled. -- cgit v1.2.3