2022-05-10 20:10:34 +00:00
|
|
|
# Light helpers library expected to be used by all other libraries
|
|
|
|
#
|
|
|
|
cmake_minimum_required(VERSION 3.21)
|
|
|
|
|
|
|
|
project(StatusGoQt
|
|
|
|
VERSION 0.1.0
|
|
|
|
LANGUAGES CXX)
|
|
|
|
|
|
|
|
set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS true)
|
|
|
|
|
2022-07-04 21:14:13 +00:00
|
|
|
find_package(Qt6 ${STATUS_QT_VERSION} COMPONENTS Core Concurrent REQUIRED)
|
2022-05-10 20:10:34 +00:00
|
|
|
qt6_standard_project_setup()
|
|
|
|
|
2022-07-04 21:14:13 +00:00
|
|
|
add_library(${PROJECT_NAME} SHARED)
|
2022-05-10 20:10:34 +00:00
|
|
|
|
|
|
|
# Use by linker only
|
|
|
|
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug)
|
|
|
|
|
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2022-07-04 21:14:13 +00:00
|
|
|
PUBLIC
|
2022-05-10 20:10:34 +00:00
|
|
|
Qt6::Core
|
2022-07-04 21:14:13 +00:00
|
|
|
Qt6::Concurrent
|
2022-05-10 20:10:34 +00:00
|
|
|
|
2022-07-04 21:14:13 +00:00
|
|
|
PRIVATE
|
2022-05-10 20:10:34 +00:00
|
|
|
statusgo_shared
|
|
|
|
)
|
2022-07-04 21:14:13 +00:00
|
|
|
add_library(Status::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
2022-05-10 20:10:34 +00:00
|
|
|
|
|
|
|
# Copy status-go lib close to the executable
|
|
|
|
# Temporary workaround; TODO: see a better alternative that doesn't depend on target order (dedicated dependencies dir?)
|
2022-07-04 21:14:13 +00:00
|
|
|
# and current directory (on mac). Use bundle or set rpath relative to executable
|
2022-05-10 20:10:34 +00:00
|
|
|
get_target_property(STATUSGO_LIBRARY_PATH statusgo_shared IMPORTED_LOCATION)
|
2022-07-04 21:14:13 +00:00
|
|
|
add_custom_command(
|
|
|
|
TARGET
|
|
|
|
${PROJECT_NAME}
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
$<TARGET_FILE:statusgo_shared>
|
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
|
|
|
COMMENT "Copying status-go lib beside project executable"
|
|
|
|
)
|
2022-06-07 10:58:06 +00:00
|
|
|
|
|
|
|
install(
|
2022-07-04 21:14:13 +00:00
|
|
|
IMPORTED_RUNTIME_ARTIFACTS
|
|
|
|
statusgo_shared
|
|
|
|
)
|