Почти исправлена система сборки
This commit is contained in:
parent
71e8dd0202
commit
d06bc7644d
@ -27,13 +27,14 @@ if(MYXLIB_BUILD_EXAMPLES)
|
||||
# Создание цели для автоматического форматирования кода
|
||||
add_format_sources(${TRGT} ${TRGT_cpp})
|
||||
|
||||
# Qt5
|
||||
target_include_directories(${TRGT} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
target_compile_definitions(${TRGT} PUBLIC MYXLIB_BUILD_LIBRARIES)
|
||||
|
||||
add_dependencies(${TRGT} base_static filesystem_static)
|
||||
target_link_libraries(${TRGT} myx-filesystem)
|
||||
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
add_dependencies(${TRGT} base filesystem)
|
||||
|
||||
target_link_libraries(${TRGT} base_static filesystem_static)
|
||||
target_link_libraries(${TRGT} Qt5::Core)
|
||||
target_link_libraries(${TRGT} Threads::Threads)
|
||||
|
||||
@ -57,6 +58,7 @@ if(MYXLIB_BUILD_EXAMPLES_HO)
|
||||
|
||||
target_include_directories(${TRGT}-ho PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
target_include_directories(${TRGT}-ho SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
# target_compile_definitions(${TRGT} PUBLIC MYXLIB_HEADER_ONLY)
|
||||
|
||||
add_dependencies(${TRGT}-ho base-header-only filesystem-header-only)
|
||||
|
||||
|
@ -38,11 +38,13 @@ if(MYXLIB_BUILD_EXAMPLES)
|
||||
target_include_directories(${TRGT} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
|
||||
target_compile_definitions(${TRGT} PUBLIC MYXLIB_HEADER_ONLY)
|
||||
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
add_dependencies(${TRGT} base qt)
|
||||
|
||||
target_link_libraries(${TRGT} base_static qt_static)
|
||||
|
||||
target_link_libraries(${TRGT} Qt5::Core)
|
||||
target_link_libraries(${TRGT} Threads::Threads)
|
||||
|
||||
# Имя выходного файла для цели
|
||||
set_target_properties(${TRGT} PROPERTIES OUTPUT_NAME qt-translators)
|
||||
@ -64,6 +66,7 @@ if(MYXLIB_BUILD_EXAMPLES_HO)
|
||||
|
||||
target_include_directories(${TRGT}-ho PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
target_include_directories(${TRGT}-ho SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
# target_compile_definitions(${TRGT} PUBLIC MYXLIB_HEADER_ONLY)
|
||||
|
||||
add_dependencies(${TRGT}-ho base-header-only qt-header-only)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
set(TRGT example-redis-client)
|
||||
|
||||
# Список файлов исходных текстов
|
||||
set(TRGT_cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
|
||||
set(TRGT_cpp ${CMAKE_CURRENT_SOURCE_DIR}/client.cpp)
|
||||
|
||||
set(TRGT_moc_hpp ${CMAKE_CURRENT_SOURCE_DIR}/client.hpp)
|
||||
|
||||
@ -37,11 +37,12 @@ if(MYXLIB_BUILD_EXAMPLES)
|
||||
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Network_INCLUDE_DIRS})
|
||||
|
||||
target_compile_definitions(${TRGT} PUBLIC MYXLIB_HEADER_ONLY)
|
||||
add_dependencies(${TRGT} base_static redis_static)
|
||||
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
add_dependencies(${TRGT} base redis)
|
||||
|
||||
target_link_libraries(${TRGT} myx-redis)
|
||||
target_link_libraries(${TRGT} base_static redis_static)
|
||||
target_link_libraries(${TRGT} Qt5::Core Qt5::Network)
|
||||
target_link_libraries(${TRGT} Threads::Threads)
|
||||
|
||||
# Имя выходного файла для цели
|
||||
set_target_properties(${TRGT} PROPERTIES OUTPUT_NAME redis-client)
|
||||
@ -63,14 +64,16 @@ if(MYXLIB_BUILD_EXAMPLES_HO)
|
||||
|
||||
target_include_directories(${TRGT}-ho PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
target_include_directories(${TRGT}-ho SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
target_include_directories(${TRGT}-ho SYSTEM PUBLIC ${Qt5Network_INCLUDE_DIRS})
|
||||
# target_compile_definitions(${TRGT} PUBLIC MYXLIB_HEADER_ONLY)
|
||||
|
||||
add_dependencies(${TRGT}-ho base-header-only qt-header-only)
|
||||
add_dependencies(${TRGT}-ho base-header-only redis-header-only)
|
||||
|
||||
target_link_libraries(${TRGT}-ho Qt5::Core)
|
||||
target_link_libraries(${TRGT}-ho Qt5::Core Qt5::Network)
|
||||
target_link_libraries(${TRGT}-ho Threads::Threads)
|
||||
|
||||
# Имя выходного файла для цели
|
||||
set_target_properties(${TRGT}-ho PROPERTIES OUTPUT_NAME qt-translators-ho)
|
||||
set_target_properties(${TRGT}-ho PROPERTIES OUTPUT_NAME redis-translators-ho)
|
||||
|
||||
add_sanitizers(${TRGT}-ho)
|
||||
cotire(${TRGT}-ho)
|
||||
|
Loading…
Reference in New Issue
Block a user