From dba5f06c1037d6d6f3fcbb9c704bf11afbf8952e Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sat, 15 Jul 2023 13:43:33 +0200 Subject: [PATCH] install target --- CMakeLists.txt | 9 +++++++-- src/CMakeLists.txt | 4 +++- tests/CMakeLists.txt | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d66f81..40aa2fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.22) +project(backup) + if (SANITIZE STREQUAL "YES") message(WARNING "Enabling sanitizers!") add_compile_options(-Wall -Wextra -pedantic -Wshadow -Wformat=2 -Wfloat-equal -D_GLIBCXX_DEBUG -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2) @@ -12,11 +14,14 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release") add_link_options(-flto) endif () +if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-O3) + add_link_options(-O3) +endif () + add_compile_options(-rdynamic) add_link_options(-rdynamic) -project(backup) - enable_testing() add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 75710cc..abe2d9c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,4 +13,6 @@ add_subdirectory(utils) add_subdirectory(fuse) add_executable(backup main.cpp) -target_link_libraries(backup PRIVATE change_detectors chunkers commands crypto filters repo utils) \ No newline at end of file +target_link_libraries(backup PRIVATE change_detectors chunkers commands crypto filters repo utils) + +install(TARGETS backup DESTINATION bin) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8a75b17..3a9ce88 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,6 +16,7 @@ FetchContent_Declare( ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +set(INSTALL_GTEST OFF) FetchContent_MakeAvailable(googletest) include(GoogleTest)