From 3236e8b10687b912a84580224a7ca2703b82ebe5 Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 13:49:15 +0100 Subject: [PATCH 1/7] link with mpi seperatly --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 613b8a05..8e96750a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,13 +40,16 @@ target_include_directories(sc $ ) target_link_libraries(sc PUBLIC - $<$:MPI::MPI_C> $<$:ZLIB::ZLIB> $<$:jansson::jansson> $<$:m> $<$:${WINSOCK_LIBRARIES}> ) +if ( SC_ENABLE_MPI ) + target_link_libraries(sc PUBLIC MPI::MPI_C) +endif() + # imported target, for use from parent project add_library(SC::SC INTERFACE IMPORTED GLOBAL) target_link_libraries(SC::SC INTERFACE sc) From 0737526d802b3ea36482b9fb3120d9b1f4520ec9 Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 13:50:19 +0100 Subject: [PATCH 2/7] Link with Zlib seperatly --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e96750a..9e4f9612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,6 @@ target_include_directories(sc $ ) target_link_libraries(sc PUBLIC - $<$:ZLIB::ZLIB> $<$:jansson::jansson> $<$:m> $<$:${WINSOCK_LIBRARIES}> @@ -50,6 +49,10 @@ if ( SC_ENABLE_MPI ) target_link_libraries(sc PUBLIC MPI::MPI_C) endif() +if ( SC_HAVE_ZLIB ) + target_link_libraries(sc PUBLIC ZLIB::ZLIB) +endif() + # imported target, for use from parent project add_library(SC::SC INTERFACE IMPORTED GLOBAL) target_link_libraries(SC::SC INTERFACE sc) From 78292262594a622f847487332fe09eead3840faf Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 13:51:12 +0100 Subject: [PATCH 3/7] Link seperatly with jansson --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e4f9612..4f2a712a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,6 @@ target_include_directories(sc $ ) target_link_libraries(sc PUBLIC - $<$:jansson::jansson> $<$:m> $<$:${WINSOCK_LIBRARIES}> ) @@ -53,6 +52,11 @@ if ( SC_HAVE_ZLIB ) target_link_libraries(sc PUBLIC ZLIB::ZLIB) endif() + +if( SC_HAVE_JSON ) + target_link_libraries(sc PUBLIC jansson::jansson) +endif() + # imported target, for use from parent project add_library(SC::SC INTERFACE IMPORTED GLOBAL) target_link_libraries(SC::SC INTERFACE sc) From 51cad7aa9ff1012e161d98ae350990c418a6049e Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 13:52:01 +0100 Subject: [PATCH 4/7] Link seperatly with m --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f2a712a..1f9e402a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,6 @@ target_include_directories(sc $ ) target_link_libraries(sc PUBLIC - $<$:m> $<$:${WINSOCK_LIBRARIES}> ) @@ -57,6 +56,10 @@ if( SC_HAVE_JSON ) target_link_libraries(sc PUBLIC jansson::jansson) endif() +if ( SC_NEED_M ) + target_link_libraries(sc PUBLIC m) +endif() + # imported target, for use from parent project add_library(SC::SC INTERFACE IMPORTED GLOBAL) target_link_libraries(SC::SC INTERFACE sc) From 63ed6cf565b8e72f9d368c754cfe428d9f45ad3f Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 13:56:23 +0100 Subject: [PATCH 5/7] link seperatly with ws2_32 --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f9e402a..f3677083 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,8 @@ target_include_directories(sc $ $ ) -target_link_libraries(sc PUBLIC - $<$:${WINSOCK_LIBRARIES}> -) +# optionally link with external libraries if ( SC_ENABLE_MPI ) target_link_libraries(sc PUBLIC MPI::MPI_C) endif() @@ -60,6 +58,10 @@ if ( SC_NEED_M ) target_link_libraries(sc PUBLIC m) endif() +if ( WIN32 ) + target_link_libraries(sc PUBLIC ws2_32) +endif() + # imported target, for use from parent project add_library(SC::SC INTERFACE IMPORTED GLOBAL) target_link_libraries(SC::SC INTERFACE sc) From c4d9b8c27664050992ae89bce4761b3200e19efd Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 14:34:32 +0100 Subject: [PATCH 6/7] Use winsock_libraries variable --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3677083..85996167 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ if ( SC_NEED_M ) endif() if ( WIN32 ) - target_link_libraries(sc PUBLIC ws2_32) + target_link_libraries(sc PUBLIC ${WINSOCK_LIBRARIES}) endif() # imported target, for use from parent project From 8c6551d8565dfa0e825e87061ce7516b82ababcb Mon Sep 17 00:00:00 2001 From: David Knapp Date: Tue, 17 Dec 2024 15:04:52 +0100 Subject: [PATCH 7/7] Add BSD statement --- doc/author_knapp.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/author_knapp.txt diff --git a/doc/author_knapp.txt b/doc/author_knapp.txt new file mode 100644 index 00000000..3207a519 --- /dev/null +++ b/doc/author_knapp.txt @@ -0,0 +1 @@ +I place my contributions to libsc under the FreeBSD license. David Knapp (david.knapp@dlr.de)