2021-05-20 04:30:31 +02:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2021-05-20 10:30:36 +02:00
|
|
|
configure_file("version.hpp.in" "version.hpp" @ONLY)
|
|
|
|
configure_file("fs-compat.hpp.in" "fs-compat.hpp" @ONLY)
|
2021-05-20 04:30:31 +02:00
|
|
|
|
2021-05-21 09:23:42 +02:00
|
|
|
# The library is only here for the tests.
|
|
|
|
add_library(${PROJECT_NAME}_lib STATIC)
|
2021-05-20 04:30:31 +02:00
|
|
|
|
|
|
|
file(GLOB_RECURSE sources_src *.cpp)
|
|
|
|
file(GLOB_RECURSE headers_src *.hpp)
|
2021-05-21 09:23:42 +02:00
|
|
|
list(REMOVE_ITEM sources_src "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
|
|
|
|
|
|
|
|
target_sources(${PROJECT_NAME}_lib
|
|
|
|
PUBLIC "${sources_src}" "${headers_src}")
|
2021-05-20 04:30:31 +02:00
|
|
|
unset(sources_src)
|
|
|
|
unset(headers_src)
|
|
|
|
|
2021-05-21 09:23:42 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME}_lib
|
|
|
|
PUBLIC
|
|
|
|
Boost::locale
|
2021-05-24 15:35:49 +02:00
|
|
|
Boost::program_options
|
|
|
|
Boost::regex
|
2021-05-21 09:23:42 +02:00
|
|
|
std::filesystem
|
2021-05-25 10:55:44 +02:00
|
|
|
fmt::fmt
|
|
|
|
termcolor::termcolor)
|
2021-05-20 04:30:31 +02:00
|
|
|
|
2021-05-25 07:30:34 +02:00
|
|
|
if(${CMAKE_VERSION} VERSION_LESS 3.17)
|
|
|
|
target_link_libraries(${PROJECT_NAME}_lib
|
|
|
|
PUBLIC ${LibArchive_LIBRARIES})
|
|
|
|
target_include_directories(${PROJECT_NAME}_lib
|
|
|
|
PUBLIC ${LibArchive_INCLUDE_DIRS})
|
|
|
|
else()
|
|
|
|
target_link_libraries(${PROJECT_NAME}_lib
|
|
|
|
PUBLIC LibArchive::LibArchive)
|
|
|
|
endif()
|
|
|
|
|
2021-05-21 09:23:42 +02:00
|
|
|
target_include_directories(${PROJECT_NAME}_lib
|
|
|
|
PUBLIC
|
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} "main.cpp")
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
|
|
PRIVATE ${PROJECT_NAME}_lib)
|
2021-05-20 04:30:31 +02:00
|
|
|
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|