From 09dced02eb89dbdc3a544890b6427b937b8756cc Mon Sep 17 00:00:00 2001 From: Alexey Ozeritskiy Date: Sat, 9 Dec 2023 01:21:47 +0100 Subject: [PATCH] Optimize cmakelists --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20caa42..d03d9ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,18 +26,20 @@ add_library(coroio coroio/ssl.cpp ) +target_include_directories(coroio PUBLIC ${URING_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS}) +target_link_directories(coroio PUBLIC ${URING_LIBRARY_DIRS} ${OPENSSL_LIBRARY_DIRS}) +target_link_libraries(coroio PUBLIC ${URING_LIBRARIES} ${OPENSSL_LIBRARIES}) + macro(target name source) add_executable(${name} ${source}) - target_include_directories(${name} PRIVATE ${CMOCKA_INCLUDE_DIRS} ${URING_INCLUDE_DIRS}) - target_link_directories(${name} PRIVATE ${CMOCKA_LIBRARY_DIRS} ${URING_LIBRARY_DIRS}) - target_link_libraries(${name} coroio ${CMOCKA_LIBRARIES} ${URING_LIBRARIES} ${OPENSSL_LIBRARIES}) + target_link_libraries(${name} coroio) endmacro() macro(ut name source) add_executable(ut_${name} ${source}) - target_include_directories(ut_${name} PRIVATE ${CMOCKA_INCLUDE_DIRS} ${URING_INCLUDE_DIRS}) - target_link_directories(ut_${name} PRIVATE ${CMOCKA_LIBRARY_DIRS} ${URING_LIBRARY_DIRS}) - target_link_libraries(ut_${name} coroio ${CMOCKA_LIBRARIES} ${URING_LIBRARIES}) + target_include_directories(ut_${name} PRIVATE ${CMOCKA_INCLUDE_DIRS}) + target_link_directories(ut_${name} PRIVATE ${CMOCKA_LIBRARY_DIRS}) + target_link_libraries(ut_${name} PRIVATE coroio ${CMOCKA_LIBRARIES}) add_test(NAME ${name} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/ut_${name}) set_tests_properties(${name} PROPERTIES ENVIRONMENT "CMOCKA_MESSAGE_OUTPUT=xml;CMOCKA_XML_FILE=${name}.xml")