You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
928 B
37 lines
928 B
cmake_minimum_required(VERSION 3.14...3.25)
|
|
|
|
project(
|
|
qr
|
|
VERSION 1.1.0
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
if (DEFINED ENV{ARCH})
|
|
set(ARCH $ENV{ARCH})
|
|
else()
|
|
set(ARCH ${CMAKE_SYSTEM_PROCESSOR})
|
|
endif()
|
|
|
|
set(EXE_NAME "qr_${CMAKE_PROJECT_VERSION}-${ARCH}")
|
|
|
|
message(STATUS "ARCH:: ${ARCH}")
|
|
|
|
configure_file(main.cpp main_substitute.cpp)
|
|
|
|
file(GLOB_RECURSE sources main_substitute.cpp src/*.hpp src/*.cpp lib/*.hpp lib/*.cpp)
|
|
add_executable(qr ${sources})
|
|
|
|
set_target_properties(qr PROPERTIES OUTPUT_NAME ${EXE_NAME})
|
|
target_compile_options(qr PUBLIC -Wall -std=c++20 -arch ${ARCH})
|
|
target_include_directories(qr PRIVATE src lib)
|
|
|
|
add_custom_target(man ALL)
|
|
add_custom_command(
|
|
TARGET man
|
|
COMMAND help2man -h "-h" -v "-v" -o qr.7 ./${EXE_NAME}
|
|
COMMAND gzip -f qr.7
|
|
)
|
|
|
|
install(TARGETS qr RUNTIME DESTINATION bin)
|
|
install(PROGRAMS build/${EXE_NAME} DESTINATION bin RENAME qr)
|
|
install(FILES build/qr.7.gz DESTINATION /usr/local/share/man/man7/)
|
|
|