2022-09-04 11:15:31 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2022-09-04 10:14:42 +00:00
|
|
|
|
2022-09-04 11:15:31 +00:00
|
|
|
project(storage VERSION 0.0.1 LANGUAGES CXX)
|
2022-09-04 10:14:42 +00:00
|
|
|
|
2022-09-04 11:15:31 +00:00
|
|
|
cmake_policy(SET CMP0076 NEW)
|
|
|
|
cmake_policy(SET CMP0079 NEW)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
|
|
|
|
|
|
|
if (NOT DEFINED QT_VERSION_MAJOR)
|
|
|
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
|
|
|
endif()
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
|
|
|
|
|
|
|
qt_standard_project_setup()
|
|
|
|
|
|
|
|
find_package(LMDB REQUIRED)
|
|
|
|
|
|
|
|
# Build type
|
|
|
|
if (NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
add_executable(storage
|
|
|
|
main.cpp
|
|
|
|
exception.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
target_include_directories(storage PRIVATE ${CMAKE_SOURCE_DIR})
|
|
|
|
target_include_directories(storage PRIVATE ${Qt${QT_VERSION_MAJOR}_INCLUDE_DIRS})
|
|
|
|
target_include_directories(storage PRIVATE ${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
target_link_libraries(storage
|
|
|
|
PRIVATE
|
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
)
|
|
|
|
target_link_libraries(storage PRIVATE lmdb)
|
2022-09-04 10:14:42 +00:00
|
|
|
|
|
|
|
install(TARGETS storage RUNTIME DESTINATION bin)
|