From 8ddfb854836c7aca1a5f281ca6f65a0a626a032f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 15 Nov 2024 17:22:35 -0800 Subject: [PATCH 1/2] cmake: use imported intl target A bit simpler. Signed-off-by: Rosen Penev --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 724a3fd..a20c6c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,7 @@ add_executable(httping ${SOURCES}) target_link_libraries(httping m) find_package(Intl REQUIRED) -target_link_libraries(httping ${Intl_LIBRARIES}) -target_include_directories(httping PUBLIC ${Intl_INCLUDE_DIRS}) +target_link_libraries(httping Intl::Intl) if (USE_GETTEXT) find_package(Gettext REQUIRED) From bd6ab7f0a9a4dc2a6c5976e535021ec69cb4ad21 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 15 Nov 2024 17:23:22 -0800 Subject: [PATCH 2/2] cmake: find openssl with cmake module Simplifies with imported targets. Signed-off-by: Rosen Penev --- CMakeLists.txt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a20c6c2..b87f71c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,15 +36,8 @@ target_include_directories(httping PUBLIC ${FFTW3_INCLUDE_DIRS}) target_compile_options(httping PUBLIC ${FFTW3_CFLAGS_OTHER}) endif () -pkg_check_modules(SSL libssl) -target_link_libraries(httping ${SSL_LIBRARIES}) -target_include_directories(httping PUBLIC ${SSL_INCLUDE_DIRS}) -target_compile_options(httping PUBLIC ${SSL_CFLAGS_OTHER}) - -pkg_check_modules(OPENSSL openssl) -target_link_libraries(httping ${OPENSSL_LIBRARIES}) -target_include_directories(httping PUBLIC ${OPENSSL_INCLUDE_DIRS}) -target_compile_options(httping PUBLIC ${OPENSSL_CFLAGS_OTHER}) +find_package(OpenSSL REQUIRED) +target_link_libraries(httping OpenSSL::SSL OpenSSL::Crypto) include(GNUInstallDirs)