Skip to content

Commit

Permalink
build: Add cmake install command (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
hparzych authored Sep 26, 2023
1 parent e6e10b5 commit b9b635e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ endif(NOT TARGET fmt)

find_package(Protobuf REQUIRED)

set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of googletest" FORCE)
if(BUILD_TESTS)
include(FetchContent)
FetchContent_Declare(googletest URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip)
Expand All @@ -81,6 +82,7 @@ if(BUILD_TESTS)
include(CTest)
include(GoogleTest)
enable_testing()

add_custom_target(run-tests COMMAND ${CMAKE_CTEST_COMMAND} -T Test --no-compress-output --output-on-failure USES_TERMINAL)
endif()

Expand All @@ -102,4 +104,6 @@ add_subdirectory(libebpfdiscoveryshared)
add_subdirectory(libebpfdiscoveryskel)
add_subdirectory(libhttpparser)

include(GNUInstallDirs)
add_subdirectory(ebpfdiscoverysrv)
install(TARGETS ebpfdiscoverysrv ebpfdiscoverysrv DESTINATION ${CMAKE_INSTALL_BINDIR})
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ clang
## Setup

Build release:

```
conan install . --build=missing -s build_type=Release
cmake --preset conan-release -DBUILD_TESTS=OFF
cmake --build --preset conan-release
```

Install release:

```
DESTDIR=/ cmake --install <build dir> --prefix /usr/local
```

Build debug:

```
conan install . --build=missing -s build_type=Debug
cmake --preset conan-debug -DTHIRDPARTY_MAKE_JOBS_COUNT=$((`nproc` / 2))
Expand Down

0 comments on commit b9b635e

Please sign in to comment.