-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
48 lines (36 loc) · 1.17 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 3.5)
project(lunas)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
file(GLOB SOURCES src/*.cpp)
set(CMAKE_CXX_STANDARD 23)
add_compile_options(-Wall -Wextra -pedantic -O1)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-D__cpp_concepts=202002L -Wno-builtin-macro-redefined -Wno-macro-redefined)
endif()
add_executable(${PROJECT_NAME} ${SOURCES})
if(DISABLE_REMOTE)
message("Compiling without remote support")
target_compile_definitions(${PROJECT_NAME} PRIVATE DISABLE_REMOTE)
else()
find_package(libssh 0.11.0 REQUIRED)
target_link_libraries(${PROJECT_NAME} ssh)
endif()
target_link_libraries(${PROJECT_NAME} pthread)
add_custom_target(local
COMMAND ${CMAKE_COMMAND} -D DISABLE_REMOTE=1 .
COMMAND ${CMAKE_COMMAND} --build .
COMMENT "Compiling without remote support"
)
install(
TARGETS lunas DESTINATION bin
)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/${PROJECT_NAME}.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1
)
add_custom_target("uninstall"
COMMENT ":: Uninstalling" ${PROJECT_NAME}
)
add_custom_command(TARGET "uninstall"
COMMAND xargs rm -v < install_manifest.txt
POST_BUILD COMMENT ":: Uninstalling"
)