-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (35 loc) · 913 Bytes
/
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
message(STATUS "Thanks for using lpm!\n")
cmake_minimum_required(VERSION 3.9)
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/g++")
set(CMAKE_CXX_FLAGS "-std=c++2a")
if (NOT BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR bin)
endif ()
project(lpm-cli)
# Specify executable and target properties
add_executable(lpm-cli src/main.cpp)
# Add lpm-lib
include_directories(./src ./src/library)
set_target_properties(
lpm-cli
PROPERTIES
LINKER_LANGUAGE CXX
OUTPUT_NAME lpm
)
# Include source files
add_library(lpm-cli-src
./src/command.cpp
)
# Include command handlers
add_library(lpm-handlers
./src/handlers/install.cpp
)
# Include the library
add_subdirectory(src/library)
# Add install target
install(TARGETS lpm-cli
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
)
# Link the libraries to the target
target_link_libraries(lpm-cli PRIVATE lpm-cli-src lpm-handlers lpm-lib curl zip)