diff --git a/CMakeLists.txt b/CMakeLists.txt index e6034689b..9f58e27d9 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -682,6 +682,7 @@ else(MONOLITHIC_BUILD) foreach(EXPORT_MODULE ${MEXPORTS}) list(APPEND WINPR_PC_LIBS "-lwinpr-${EXPORT_MODULE}") endforeach() + list(APPEND WINPR_PC_LIBS "-lwinpr") string(REPLACE ";" " " WINPR_PC_LIBS "${WINPR_PC_LIBS}") endif(MONOLITHIC_BUILD) diff --git a/channels/client/CMakeLists.txt b/channels/client/CMakeLists.txt index 05cb34697..6b8aaf2c3 100644 --- a/channels/client/CMakeLists.txt +++ b/channels/client/CMakeLists.txt @@ -101,10 +101,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-path winpr-file winpr-synch winpr-library winpr-interlocked) + +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} PARENT_SCOPE) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/channels/cliprdr/client/CMakeLists.txt b/channels/cliprdr/client/CMakeLists.txt index 4df74c706..f2f3c32ea 100644 --- a/channels/cliprdr/client/CMakeLists.txt +++ b/channels/cliprdr/client/CMakeLists.txt @@ -32,10 +32,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH} EXPORT FreeRDPTargets) diff --git a/channels/disp/client/CMakeLists.txt b/channels/disp/client/CMakeLists.txt index 704ce2334..377e65153 100644 --- a/channels/disp/client/CMakeLists.txt +++ b/channels/disp/client/CMakeLists.txt @@ -32,10 +32,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-common freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sysinfo) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/drdynvc/client/CMakeLists.txt b/channels/drdynvc/client/CMakeLists.txt index 124397d46..d8e3d02cd 100644 --- a/channels/drdynvc/client/CMakeLists.txt +++ b/channels/drdynvc/client/CMakeLists.txt @@ -33,10 +33,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-synch) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH} EXPORT FreeRDPTargets) diff --git a/channels/drive/client/CMakeLists.txt b/channels/drive/client/CMakeLists.txt index b7f0b8d94..82bbc70f7 100644 --- a/channels/drive/client/CMakeLists.txt +++ b/channels/drive/client/CMakeLists.txt @@ -38,10 +38,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-file winpr-synch winpr-thread winpr-interlocked) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/encomsp/client/CMakeLists.txt b/channels/encomsp/client/CMakeLists.txt index ffa8435ab..7e96cbd0c 100644 --- a/channels/encomsp/client/CMakeLists.txt +++ b/channels/encomsp/client/CMakeLists.txt @@ -25,10 +25,7 @@ add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} FALSE set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH} EXPORT FreeRDPTargets) diff --git a/channels/encomsp/server/CMakeLists.txt b/channels/encomsp/server/CMakeLists.txt index 494d7ff99..90c4e8f31 100644 --- a/channels/encomsp/server/CMakeLists.txt +++ b/channels/encomsp/server/CMakeLists.txt @@ -25,10 +25,7 @@ add_channel_server_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} FALSE set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/parallel/client/CMakeLists.txt b/channels/parallel/client/CMakeLists.txt index e9a87261d..84af28326 100644 --- a/channels/parallel/client/CMakeLists.txt +++ b/channels/parallel/client/CMakeLists.txt @@ -29,10 +29,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-interlocked) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/printer/client/CMakeLists.txt b/channels/printer/client/CMakeLists.txt index 861de097e..5b055b667 100644 --- a/channels/printer/client/CMakeLists.txt +++ b/channels/printer/client/CMakeLists.txt @@ -45,10 +45,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-synch winpr-thread winpr-interlocked) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(WITH_CUPS) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${CUPS_LIBRARIES}) diff --git a/channels/rdpdr/client/CMakeLists.txt b/channels/rdpdr/client/CMakeLists.txt index 241849b9f..d96a0eb5d 100644 --- a/channels/rdpdr/client/CMakeLists.txt +++ b/channels/rdpdr/client/CMakeLists.txt @@ -36,10 +36,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-synch winpr-thread winpr-interlocked) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/rdpei/client/CMakeLists.txt b/channels/rdpei/client/CMakeLists.txt index 2d3adf24c..e248d5f58 100644 --- a/channels/rdpei/client/CMakeLists.txt +++ b/channels/rdpei/client/CMakeLists.txt @@ -34,10 +34,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-common freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sysinfo) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/rdpgfx/client/CMakeLists.txt b/channels/rdpgfx/client/CMakeLists.txt index dc47804ce..abd8352df 100644 --- a/channels/rdpgfx/client/CMakeLists.txt +++ b/channels/rdpgfx/client/CMakeLists.txt @@ -36,10 +36,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-common freerdp-codec freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sysinfo) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/rdpsnd/client/CMakeLists.txt b/channels/rdpsnd/client/CMakeLists.txt index 64bdb2bff..68b442fce 100644 --- a/channels/rdpsnd/client/CMakeLists.txt +++ b/channels/rdpsnd/client/CMakeLists.txt @@ -30,10 +30,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-codec freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sysinfo winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/rdpsnd/client/alsa/CMakeLists.txt b/channels/rdpsnd/client/alsa/CMakeLists.txt index d96a0495c..cbe2ca20a 100644 --- a/channels/rdpsnd/client/alsa/CMakeLists.txt +++ b/channels/rdpsnd/client/alsa/CMakeLists.txt @@ -32,10 +32,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-codec freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${ALSA_LIBRARIES}) diff --git a/channels/rdpsnd/client/winmm/CMakeLists.txt b/channels/rdpsnd/client/winmm/CMakeLists.txt index a75d5fe1c..99aaae53f 100644 --- a/channels/rdpsnd/client/winmm/CMakeLists.txt +++ b/channels/rdpsnd/client/winmm/CMakeLists.txt @@ -31,11 +31,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-utils) - +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) + set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winmm.lib) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/remdesk/client/CMakeLists.txt b/channels/remdesk/client/CMakeLists.txt index bcc67307b..a3ab1cfd5 100644 --- a/channels/remdesk/client/CMakeLists.txt +++ b/channels/remdesk/client/CMakeLists.txt @@ -30,10 +30,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-common) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH} EXPORT FreeRDPTargets) diff --git a/channels/remdesk/server/CMakeLists.txt b/channels/remdesk/server/CMakeLists.txt index 3139058b9..c20bd0618 100644 --- a/channels/remdesk/server/CMakeLists.txt +++ b/channels/remdesk/server/CMakeLists.txt @@ -25,10 +25,7 @@ add_channel_server_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} FALSE set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/serial/client/CMakeLists.txt b/channels/serial/client/CMakeLists.txt index 7d0fe8897..8f2532473 100644 --- a/channels/serial/client/CMakeLists.txt +++ b/channels/serial/client/CMakeLists.txt @@ -29,10 +29,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-comm) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/server/CMakeLists.txt b/channels/server/CMakeLists.txt index 9285a6594..67a2c4cca 100644 --- a/channels/server/CMakeLists.txt +++ b/channels/server/CMakeLists.txt @@ -37,10 +37,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-codec freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-synch winpr-interlocked winpr-error winpr-wtsapi) + +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} PARENT_SCOPE) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/channels/smartcard/client/CMakeLists.txt b/channels/smartcard/client/CMakeLists.txt index d7aaa8a69..a3e263aee 100644 --- a/channels/smartcard/client/CMakeLists.txt +++ b/channels/smartcard/client/CMakeLists.txt @@ -33,10 +33,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-smartcard winpr-synch winpr-thread winpr-interlocked winpr-environment winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/channels/urbdrc/client/CMakeLists.txt b/channels/urbdrc/client/CMakeLists.txt index 7af13726c..1dd4ab54c 100644 --- a/channels/urbdrc/client/CMakeLists.txt +++ b/channels/urbdrc/client/CMakeLists.txt @@ -42,10 +42,7 @@ set(${MODULE_PREFIX}_LIBS ${UDEV_LIBRARIES} ${UUID_LIBRARIES}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} diff --git a/channels/urbdrc/client/libusb/CMakeLists.txt b/channels/urbdrc/client/libusb/CMakeLists.txt index 49386f48f..6770be4b7 100644 --- a/channels/urbdrc/client/libusb/CMakeLists.txt +++ b/channels/urbdrc/client/libusb/CMakeLists.txt @@ -39,10 +39,8 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${UUID_LIBRARIES} ${LIBUSB_1_LIBRARIES}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-utils) + +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/client/Android/FreeRDPCore/jni/CMakeLists.txt b/client/Android/FreeRDPCore/jni/CMakeLists.txt index 0ca2ff33b..d2ea3b839 100644 --- a/client/Android/FreeRDPCore/jni/CMakeLists.txt +++ b/client/Android/FreeRDPCore/jni/CMakeLists.txt @@ -61,10 +61,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-core freerdp-gdi freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-synch) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} dl) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} log) diff --git a/client/DirectFB/CMakeLists.txt b/client/DirectFB/CMakeLists.txt index 061b05c54..75eafc251 100644 --- a/client/DirectFB/CMakeLists.txt +++ b/client/DirectFB/CMakeLists.txt @@ -38,10 +38,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-core freerdp-gdi freerdp-locale freerdp-codec freerdp-primitives freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-input winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/client/Mac/CMakeLists.txt b/client/Mac/CMakeLists.txt index 33c946ee2..91eb01bdb 100755 --- a/client/Mac/CMakeLists.txt +++ b/client/Mac/CMakeLists.txt @@ -84,9 +84,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI MODULE freerdp MODULES freerdp-core freerdp-cache freerdp-gdi freerdp-codec freerdp-primitives freerdp-rail freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-input winpr-crt winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/client/Windows/CMakeLists.txt b/client/Windows/CMakeLists.txt index fb14eb527..e1bc74773 100644 --- a/client/Windows/CMakeLists.txt +++ b/client/Windows/CMakeLists.txt @@ -58,10 +58,8 @@ endif() set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-credui winpr-utils) + +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} diff --git a/client/X11/CMakeLists.txt b/client/X11/CMakeLists.txt index e57f3a18d..d33e90ccb 100644 --- a/client/X11/CMakeLists.txt +++ b/client/X11/CMakeLists.txt @@ -87,9 +87,7 @@ if(WITH_MANPAGES) set(GAD_LIBS freerdp-client) - set_complex_link_libraries(VARIABLE GAD_LIBS MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-utils) + set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set_complex_link_libraries(VARIABLE GAD_LIBS MONOLITHIC ${MONOLITHIC_BUILD} MODULE freerdp diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index 9724af1d8..47bb460f8 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -59,9 +59,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI MODULE freerdp MODULES freerdp-core) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/client/iOS/CMakeLists.txt b/client/iOS/CMakeLists.txt index b07e73970..52bbc1739 100644 --- a/client/iOS/CMakeLists.txt +++ b/client/iOS/CMakeLists.txt @@ -129,9 +129,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI MODULE freerdp MODULES freerdp-core freerdp-gdi freerdp-locale freerdp-primitives freerdp-cache freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-input winpr-crt winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/cunit/CMakeLists.txt b/cunit/CMakeLists.txt index ca351c5fc..dffd4d329 100644 --- a/cunit/CMakeLists.txt +++ b/cunit/CMakeLists.txt @@ -71,7 +71,7 @@ target_link_libraries(test_freerdp freerdp-utils) target_link_libraries(test_freerdp freerdp-codec) target_link_libraries(test_freerdp freerdp-crypto) -target_link_libraries(test_freerdp winpr-sspi) +target_link_libraries(test_freerdp winpr) add_test(CUnitTests ${CMAKE_SOURCE_DIR}/cunit/test_freerdp) diff --git a/libfreerdp/codec/CMakeLists.txt b/libfreerdp/codec/CMakeLists.txt index 17f23d99f..ee2c7c4b3 100644 --- a/libfreerdp/codec/CMakeLists.txt +++ b/libfreerdp/codec/CMakeLists.txt @@ -109,10 +109,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-primitives freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-pool winpr-registry winpr-sysinfo winpr-utils) + +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/common/CMakeLists.txt b/libfreerdp/common/CMakeLists.txt index bbdaa70bb..2b0c40498 100644 --- a/libfreerdp/common/CMakeLists.txt +++ b/libfreerdp/common/CMakeLists.txt @@ -36,9 +36,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION_FULL} set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-path winpr-file winpr-library winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/core/CMakeLists.txt b/libfreerdp/core/CMakeLists.txt index 4f0f72bdc..de23cee38 100644 --- a/libfreerdp/core/CMakeLists.txt +++ b/libfreerdp/core/CMakeLists.txt @@ -145,10 +145,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-crypto freerdp-codec freerdp-locale freerdp-common freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-registry winpr-utils winpr-interlocked winpr-dsparse winpr-sspi winpr-rpc winpr-wtsapi winpr-handle winpr-winsock winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/crypto/CMakeLists.txt b/libfreerdp/crypto/CMakeLists.txt index e33200bec..a22cc5880 100644 --- a/libfreerdp/crypto/CMakeLists.txt +++ b/libfreerdp/crypto/CMakeLists.txt @@ -41,11 +41,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVER set(${MODULE_PREFIX}_LIBS ${OPENSSL_LIBRARIES}) -if(MONOLITHIC_BUILD) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) -else() - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-sspi winpr-library winpr-path winpr-file) -endif() +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(WIN32) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ws2_32) @@ -58,11 +54,6 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-library) - if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) else() diff --git a/libfreerdp/gdi/test/CMakeLists.txt b/libfreerdp/gdi/test/CMakeLists.txt index 48e5a9125..4a2ba50fc 100644 --- a/libfreerdp/gdi/test/CMakeLists.txt +++ b/libfreerdp/gdi/test/CMakeLists.txt @@ -28,10 +28,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-gdi) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-utils) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/libfreerdp/locale/CMakeLists.txt b/libfreerdp/locale/CMakeLists.txt index a3a844876..8cbb33dfb 100644 --- a/libfreerdp/locale/CMakeLists.txt +++ b/libfreerdp/locale/CMakeLists.txt @@ -82,10 +82,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-input winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/primitives/CMakeLists.txt b/libfreerdp/primitives/CMakeLists.txt index a075072d2..95868ca61 100644 --- a/libfreerdp/primitives/CMakeLists.txt +++ b/libfreerdp/primitives/CMakeLists.txt @@ -85,10 +85,7 @@ if(IPP_FOUND) endforeach() endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sysinfo) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/utils/CMakeLists.txt b/libfreerdp/utils/CMakeLists.txt index c2a679ede..0728452e5 100644 --- a/libfreerdp/utils/CMakeLists.txt +++ b/libfreerdp/utils/CMakeLists.txt @@ -56,10 +56,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES SunOS) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-synch winpr-thread winpr-utils winpr-path winpr-winsock) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/utils/test/CMakeLists.txt b/libfreerdp/utils/test/CMakeLists.txt index e6ab6134c..ace2867c6 100644 --- a/libfreerdp/utils/test/CMakeLists.txt +++ b/libfreerdp/utils/test/CMakeLists.txt @@ -13,10 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-thread winpr-synch winpr-file winpr-utils winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} diff --git a/server/Mac/CMakeLists.txt b/server/Mac/CMakeLists.txt index 50cfc1fc1..bedd69ec8 100644 --- a/server/Mac/CMakeLists.txt +++ b/server/Mac/CMakeLists.txt @@ -72,10 +72,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-core freerdp-utils freerdp-codec freerdp-primitives) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/server/Sample/CMakeLists.txt b/server/Sample/CMakeLists.txt index 638a5fef0..1252e3f7f 100644 --- a/server/Sample/CMakeLists.txt +++ b/server/Sample/CMakeLists.txt @@ -37,10 +37,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-core freerdp-utils freerdp-codec freerdp-primitives) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/server/X11/CMakeLists.txt b/server/X11/CMakeLists.txt index 2af6f8f2e..5aeb9ec9d 100644 --- a/server/X11/CMakeLists.txt +++ b/server/X11/CMakeLists.txt @@ -147,10 +147,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-core freerdp-common freerdp-codec freerdp-primitives freerdp-utils freerdp-gdi freerdp-crypto freerdp-locale) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sspi winpr-crt winpr-utils winpr-input winpr-sysinfo) +set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-makecert-tool) diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index d53744418..99a6d413c 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -38,7 +38,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/) # Check for cmake compatibility (enable/disable features) include(CheckCmakeCompat) include(FindFeature) -include(ComplexLibrary) include(AutoVersioning) include(ConfigOptions) include(CheckCCompilerFlag) @@ -51,6 +50,7 @@ set(WINPR_VERSION_MINOR "1") set(WINPR_VERSION_REVISION "0") set(WINPR_VERSION "${WINPR_VERSION_MAJOR}.${WINPR_VERSION_MINOR}") set(WINPR_VERSION_FULL "${WINPR_VERSION}.${WINPR_VERSION_REVISION}") +set(WINPR_VERSION_FULL ${WINPR_VERSION_FULL} PARENT_SCOPE) # Default to release build type if(NOT CMAKE_BUILD_TYPE) @@ -84,7 +84,8 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10") set(WINPR_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/WinPR") set(WINPR_INCLUDE_DIR "include") - set(WINPR_MONOLITHIC_BUILD ${MONOLITHIC_BUILD}) + # Keep this for legacy builds + set(WINPR_MONOLITHIC_BUILD OFF) configure_package_config_file(WinPRConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/WinPRConfig.cmake INSTALL_DESTINATION ${WINPR_CMAKE_INSTALL_DIR} diff --git a/winpr/libwinpr/CMakeLists.txt b/winpr/libwinpr/CMakeLists.txt index c2eabedda..6eb03f341 100644 --- a/winpr/libwinpr/CMakeLists.txt +++ b/winpr/libwinpr/CMakeLists.txt @@ -15,48 +15,85 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr") -set(MODULE_PREFIX "WINPR") - if (APPLE) # flat_namespace should be avoided, but is required for -undefined warning. Since WinPR currently has # a lot of undefined symbols in use, use this hack until they're filled out. set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-flat_namespace,-undefined,warning") endif() -if(MONOLITHIC_BUILD) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) -endif() +set(WINPR_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(WINPR_SRCS "") +set(WINPR_LIBS "") +set(WINPR_INCLUDES "") +set(WINPR_DEFINITIONS "") -set(FILENAME "ModuleOptions.cmake") -file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}") +macro (winpr_module_add) + file (RELATIVE_PATH _relPath "${WINPR_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") + foreach (_src ${ARGN}) + if (_relPath) + list (APPEND WINPR_SRCS "${_relPath}/${_src}") + else() + list (APPEND WINPR_SRCS "${_src}") + endif() + endforeach() + if (_relPath) + set (WINPR_SRCS ${WINPR_SRCS} PARENT_SCOPE) + endif() +endmacro() -foreach(FILEPATH ${FILEPATHS}) - if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}") - string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" ${MODULE_PREFIX}_SUBMODULE ${FILEPATH}) - set(${MODULE_PREFIX}_SUBMODULES ${${MODULE_PREFIX}_SUBMODULES} ${${MODULE_PREFIX}_SUBMODULE}) - endif() -endforeach(FILEPATH) +macro (winpr_include_directory_add) + file (RELATIVE_PATH _relPath "${WINPR_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") + foreach (_src ${ARGN}) + if (_relPath) + list (APPEND WINPR_INCLUDES "${_relPath}/${_src}") + else() + list (APPEND WINPR_INCLUDES "${_src}") + endif() + endforeach() + if (_relPath) + set (WINPR_INCLUDES ${WINPR_INCLUDES} PARENT_SCOPE) + endif() +endmacro() -foreach(${MODULE_PREFIX}_SUBMODULE ${${MODULE_PREFIX}_SUBMODULES}) - add_subdirectory(${${MODULE_PREFIX}_SUBMODULE}) +macro (winpr_library_add) + foreach (_lib ${ARGN}) + list (APPEND WINPR_LIBS "${_lib}") + endforeach() + set (WINPR_LIBS ${WINPR_LIBS} PARENT_SCOPE) +endmacro() + +macro (winpr_definition_add) + foreach (_define ${ARGN}) + list (APPEND WINPR_DEFINITIONS "${_define}") + endforeach() + set (WINPR_DEFINITIONS ${WINPR_DEFINITIONS} PARENT_SCOPE) +endmacro() + +# Level "1" API as defined for MinCore.lib +set(WINPR_CORE synch locale library file comm pipe interlocked security + environment crypto registry credentials path io memory input + heap utils error com timezone sysinfo pool handle thread) + +foreach(DIR ${WINPR_CORE}) + add_subdirectory(${DIR}) endforeach() -if(MONOLITHIC_BUILD) +set(WINPR_LEVEL2 winsock sspi winhttp asn1 sspicli crt bcrypt rpc credui + wtsapi dsparse wnd smartcard nt) - foreach(${MODULE_PREFIX}_SUBMODULE ${${MODULE_PREFIX}_SUBMODULES}) - set(${MODULE_PREFIX}_OBJECTS ${${MODULE_PREFIX}_OBJECTS} "$") - endforeach() +foreach(DIR ${WINPR_LEVEL2}) + add_subdirectory(${DIR}) +endforeach() - add_library(${MODULE_NAME} dummy.c ${${MODULE_PREFIX}_OBJECTS}) - - set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C) - set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - - list(REMOVE_DUPLICATES WINPR_LIBS) - target_link_libraries(${MODULE_NAME} ${WINPR_LIBS}) - - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT WinPRTargets) - - set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/libwinpr") -endif() +set(MODULE_NAME winpr) +list(REMOVE_DUPLICATES WINPR_DEFINITIONS) +list(REMOVE_DUPLICATES WINPR_LIBS) +list(REMOVE_DUPLICATES WINPR_INCLUDES) +include_directories(${WINPR_INCLUDES}) +add_library(${MODULE_NAME} ${WINPR_SRCS}) +set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C) +set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") +add_definitions(${WINPR_DEFINITIONS}) +target_link_libraries(${MODULE_NAME} ${WINPR_LIBS}) +install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT WinPRTargets) +set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/libwinpr") diff --git a/winpr/libwinpr/asn1/CMakeLists.txt b/winpr/libwinpr/asn1/CMakeLists.txt index 920e8001c..214f52801 100644 --- a/winpr/libwinpr/asn1/CMakeLists.txt +++ b/winpr/libwinpr/asn1/CMakeLists.txt @@ -15,30 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-asn1") -set(MODULE_PREFIX "WINPR_ASN1") - -set(${MODULE_PREFIX}_SRCS - asn1.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(asn1.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/asn1/test/CMakeLists.txt b/winpr/libwinpr/asn1/test/CMakeLists.txt index 60e967906..22b8eb50f 100644 --- a/winpr/libwinpr/asn1/test/CMakeLists.txt +++ b/winpr/libwinpr/asn1/test/CMakeLists.txt @@ -24,12 +24,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-asn1) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/bcrypt/CMakeLists.txt b/winpr/libwinpr/bcrypt/CMakeLists.txt index b70d9bf85..24c2206c4 100644 --- a/winpr/libwinpr/bcrypt/CMakeLists.txt +++ b/winpr/libwinpr/bcrypt/CMakeLists.txt @@ -15,35 +15,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-bcrypt") -set(MODULE_PREFIX "WINPR_BCRYPT") +winpr_module_add(bcrypt.c) -set(${MODULE_PREFIX}_SRCS - bcrypt.c) +winpr_include_directory_add( + ${OPENSSL_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIRS}) -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -include_directories(${OPENSSL_INCLUDE_DIR}) -include_directories(${ZLIB_INCLUDE_DIRS}) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${ZLIB_LIBRARIES}) - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-utils) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_library_add(${ZLIB_LIBRARIES}) diff --git a/winpr/libwinpr/com/CMakeLists.txt b/winpr/libwinpr/com/CMakeLists.txt index f00507be4..1b82dbc69 100644 --- a/winpr/libwinpr/com/CMakeLists.txt +++ b/winpr/libwinpr/com/CMakeLists.txt @@ -15,35 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-com") -set(MODULE_PREFIX "WINPR_COM") - -set(${MODULE_PREFIX}_SRCS - com.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} credui) -endif() - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(com.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/com/test/CMakeLists.txt b/winpr/libwinpr/com/test/CMakeLists.txt index 94e42c352..ac6c1c008 100644 --- a/winpr/libwinpr/com/test/CMakeLists.txt +++ b/winpr/libwinpr/com/test/CMakeLists.txt @@ -1,4 +1,3 @@ - set(MODULE_NAME "TestCom") set(MODULE_PREFIX "TEST_COM") @@ -13,13 +12,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-com) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") foreach(test ${${MODULE_PREFIX}_TESTS}) @@ -28,4 +21,3 @@ foreach(test ${${MODULE_PREFIX}_TESTS}) endforeach() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test") - diff --git a/winpr/libwinpr/comm/CMakeLists.txt b/winpr/libwinpr/comm/CMakeLists.txt index c37af7268..ffcc8112d 100644 --- a/winpr/libwinpr/comm/CMakeLists.txt +++ b/winpr/libwinpr/comm/CMakeLists.txt @@ -31,31 +31,8 @@ set(${MODULE_PREFIX}_SRCS comm_sercx2_sys.c comm_sercx2_sys.h) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS}) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-file winpr-utils) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(${${MODULE_PREFIX}_SRCS}) if(BUILD_TESTING) add_subdirectory(test) endif() - diff --git a/winpr/libwinpr/comm/module.def b/winpr/libwinpr/comm/module.def index fc26e7287..44feb6f4e 100644 --- a/winpr/libwinpr/comm/module.def +++ b/winpr/libwinpr/comm/module.def @@ -1,3 +1,3 @@ -LIBRARY "libwinpr-comm" +LIBRARY "libwinpr" EXPORTS diff --git a/winpr/libwinpr/comm/test/CMakeLists.txt b/winpr/libwinpr/comm/test/CMakeLists.txt index dcf737f3a..8b9c07c88 100644 --- a/winpr/libwinpr/comm/test/CMakeLists.txt +++ b/winpr/libwinpr/comm/test/CMakeLists.txt @@ -21,12 +21,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-comm winpr-crt winpr-file) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/credentials/CMakeLists.txt b/winpr/libwinpr/credentials/CMakeLists.txt index 588f28c98..d8ad94942 100644 --- a/winpr/libwinpr/credentials/CMakeLists.txt +++ b/winpr/libwinpr/credentials/CMakeLists.txt @@ -15,28 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-credentials") -set(MODULE_PREFIX "WINPR_CREDENTIALS") - -set(${MODULE_PREFIX}_SRCS - credentials.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - +winpr_module_add(credentials.c) diff --git a/winpr/libwinpr/credui/CMakeLists.txt b/winpr/libwinpr/credui/CMakeLists.txt index cb5a86ba5..b1a06638f 100644 --- a/winpr/libwinpr/credui/CMakeLists.txt +++ b/winpr/libwinpr/credui/CMakeLists.txt @@ -15,41 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-credui") -set(MODULE_PREFIX "WINPR_CREDUI") - -set(${MODULE_PREFIX}_SRCS - credui.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") +winpr_module_add(credui.c) if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} credui) + winpr_library_add(credui) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-utils) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/credui/test/CMakeLists.txt b/winpr/libwinpr/credui/test/CMakeLists.txt index 95a2462ab..e615e3a32 100644 --- a/winpr/libwinpr/credui/test/CMakeLists.txt +++ b/winpr/libwinpr/credui/test/CMakeLists.txt @@ -16,12 +16,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-credui) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/crt/CMakeLists.txt b/winpr/libwinpr/crt/CMakeLists.txt index 6acb1c303..3fd7e0511 100644 --- a/winpr/libwinpr/crt/CMakeLists.txt +++ b/winpr/libwinpr/crt/CMakeLists.txt @@ -15,10 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-crt") -set(MODULE_PREFIX "WINPR_CRT") - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( alignment.c conversion.c buffer.c @@ -28,30 +25,6 @@ set(${MODULE_PREFIX}_SRCS utf.c utf.h) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-error) - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/crt/test/CMakeLists.txt b/winpr/libwinpr/crt/test/CMakeLists.txt index acb6b98d9..4f1f9d3fd 100644 --- a/winpr/libwinpr/crt/test/CMakeLists.txt +++ b/winpr/libwinpr/crt/test/CMakeLists.txt @@ -16,12 +16,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-error) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/crypto/CMakeLists.txt b/winpr/libwinpr/crypto/CMakeLists.txt index 0c7cca6aa..a927909cc 100644 --- a/winpr/libwinpr/crypto/CMakeLists.txt +++ b/winpr/libwinpr/crypto/CMakeLists.txt @@ -15,49 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-crypto") -set(MODULE_PREFIX "WINPR_CRYPTO") - -set(${MODULE_PREFIX}_SRCS - crypto.c +winpr_module_add( + crypto.c crypto.h cert.c) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -include_directories(${ZLIB_INCLUDE_DIRS}) -include_directories(${OPENSSL_INCLUDE_DIR}) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${ZLIB_LIBRARIES} - ${OPENSSL_LIBRARIES}) - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-utils) - -if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} crypt32) -endif() - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/crypto/test/CMakeLists.txt b/winpr/libwinpr/crypto/test/CMakeLists.txt index 58a29cdb7..382831d1a 100644 --- a/winpr/libwinpr/crypto/test/CMakeLists.txt +++ b/winpr/libwinpr/crypto/test/CMakeLists.txt @@ -19,12 +19,7 @@ if(WIN32) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} secur32 crypt32 cryptui) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-crypto winpr-utils) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") @@ -34,4 +29,3 @@ foreach(test ${${MODULE_PREFIX}_TESTS}) endforeach() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test") - diff --git a/winpr/libwinpr/dsparse/CMakeLists.txt b/winpr/libwinpr/dsparse/CMakeLists.txt index 1567d82fc..0703523a7 100644 --- a/winpr/libwinpr/dsparse/CMakeLists.txt +++ b/winpr/libwinpr/dsparse/CMakeLists.txt @@ -15,36 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-dsparse") -set(MODULE_PREFIX "WINPR_DSPARSE") - -set(${MODULE_PREFIX}_SRCS - dsparse.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") +winpr_module_add(dsparse.c) if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ntdsapi) + winpr_library_add(ntdsapi) endif() -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/dsparse/test/CMakeLists.txt b/winpr/libwinpr/dsparse/test/CMakeLists.txt index e7efe6513..eb7699d87 100644 --- a/winpr/libwinpr/dsparse/test/CMakeLists.txt +++ b/winpr/libwinpr/dsparse/test/CMakeLists.txt @@ -14,12 +14,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-dsparse) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/environment/CMakeLists.txt b/winpr/libwinpr/environment/CMakeLists.txt index 66c1c1b4b..53c28181a 100644 --- a/winpr/libwinpr/environment/CMakeLists.txt +++ b/winpr/libwinpr/environment/CMakeLists.txt @@ -15,36 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-environment") -set(MODULE_PREFIX "WINPR_ENVIRONMENT") - -set(${MODULE_PREFIX}_SRCS - environment.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-error) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(environment.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/environment/test/CMakeLists.txt b/winpr/libwinpr/environment/test/CMakeLists.txt index aee38e777..459d42528 100644 --- a/winpr/libwinpr/environment/test/CMakeLists.txt +++ b/winpr/libwinpr/environment/test/CMakeLists.txt @@ -16,12 +16,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-environment) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/error/CMakeLists.txt b/winpr/libwinpr/error/CMakeLists.txt index 795240802..a2401310d 100644 --- a/winpr/libwinpr/error/CMakeLists.txt +++ b/winpr/libwinpr/error/CMakeLists.txt @@ -15,36 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-error") -set(MODULE_PREFIX "WINPR_ERROR") - -set(${MODULE_PREFIX}_SRCS - error.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-nt) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(error.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/error/test/CMakeLists.txt b/winpr/libwinpr/error/test/CMakeLists.txt index ecec7093f..83b16e163 100644 --- a/winpr/libwinpr/error/test/CMakeLists.txt +++ b/winpr/libwinpr/error/test/CMakeLists.txt @@ -13,12 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-synch winpr-thread winpr-error) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/file/CMakeLists.txt b/winpr/libwinpr/file/CMakeLists.txt index d374cab99..034d5c1c0 100644 --- a/winpr/libwinpr/file/CMakeLists.txt +++ b/winpr/libwinpr/file/CMakeLists.txt @@ -15,33 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-file") -set(MODULE_PREFIX "WINPR_FILE") - -set(${MODULE_PREFIX}_SRCS - file.c - pattern.c) - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-handle winpr-path winpr-error winpr-synch) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(file.c pattern.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/file/test/CMakeLists.txt b/winpr/libwinpr/file/test/CMakeLists.txt index 3b88b7e71..f23bde6e9 100644 --- a/winpr/libwinpr/file/test/CMakeLists.txt +++ b/winpr/libwinpr/file/test/CMakeLists.txt @@ -20,12 +20,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-file winpr-path) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/handle/CMakeLists.txt b/winpr/libwinpr/handle/CMakeLists.txt index 93d112bcd..c2322174e 100644 --- a/winpr/libwinpr/handle/CMakeLists.txt +++ b/winpr/libwinpr/handle/CMakeLists.txt @@ -14,38 +14,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +winpr_module_add(handle.c handle.h) -set(MODULE_NAME "winpr-handle") -set(MODULE_PREFIX "WINPR_HANDLE") - -set(${MODULE_PREFIX}_SRCS - handle.c - handle.h) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS}) - if(${CMAKE_SYSTEM_NAME} MATCHES SunOS) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) + winpr_library_add(rt) endif() - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") diff --git a/winpr/libwinpr/heap/CMakeLists.txt b/winpr/libwinpr/heap/CMakeLists.txt index 40d69e2c0..4c44bab22 100644 --- a/winpr/libwinpr/heap/CMakeLists.txt +++ b/winpr/libwinpr/heap/CMakeLists.txt @@ -15,27 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-heap") -set(MODULE_PREFIX "WINPR_HEAP") - -set(${MODULE_PREFIX}_SRCS - heap.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(heap.c) diff --git a/winpr/libwinpr/input/CMakeLists.txt b/winpr/libwinpr/input/CMakeLists.txt index 5913c29a1..b23754a60 100644 --- a/winpr/libwinpr/input/CMakeLists.txt +++ b/winpr/libwinpr/input/CMakeLists.txt @@ -15,32 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-input") -set(MODULE_PREFIX "WINPR_INPUT") - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( virtualkey.c scancode.c keycode.c) - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - diff --git a/winpr/libwinpr/interlocked/CMakeLists.txt b/winpr/libwinpr/interlocked/CMakeLists.txt index aa8a2948a..7f164151c 100644 --- a/winpr/libwinpr/interlocked/CMakeLists.txt +++ b/winpr/libwinpr/interlocked/CMakeLists.txt @@ -15,40 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-interlocked") -set(MODULE_PREFIX "WINPR_INTERLOCKED") - -set(${MODULE_PREFIX}_SRCS - interlocked.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - if (${CMAKE_SYSTEM_VERSION} GREATER "5.1") - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) - else() - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module_5.1.def) - endif() -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-handle) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(interlocked.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/interlocked/test/CMakeLists.txt b/winpr/libwinpr/interlocked/test/CMakeLists.txt index e9b36d3f2..116641080 100644 --- a/winpr/libwinpr/interlocked/test/CMakeLists.txt +++ b/winpr/libwinpr/interlocked/test/CMakeLists.txt @@ -15,12 +15,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-interlocked winpr-synch) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/io/CMakeLists.txt b/winpr/libwinpr/io/CMakeLists.txt index 1100af791..c7050d4a3 100644 --- a/winpr/libwinpr/io/CMakeLists.txt +++ b/winpr/libwinpr/io/CMakeLists.txt @@ -15,38 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-io") -set(MODULE_PREFIX "WINPR_IO") - -set(${MODULE_PREFIX}_SRCS - device.c - io.c - io.h) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-path) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(device.c io.c io.h) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/io/test/CMakeLists.txt b/winpr/libwinpr/io/test/CMakeLists.txt index 2de6e7ef7..96c484820 100644 --- a/winpr/libwinpr/io/test/CMakeLists.txt +++ b/winpr/libwinpr/io/test/CMakeLists.txt @@ -14,12 +14,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-io winpr-nt) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/library/CMakeLists.txt b/winpr/libwinpr/library/CMakeLists.txt index cebaa144d..9db7d0d13 100644 --- a/winpr/libwinpr/library/CMakeLists.txt +++ b/winpr/libwinpr/library/CMakeLists.txt @@ -15,33 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-library") -set(MODULE_PREFIX "WINPR_LIBRARY") - -set(${MODULE_PREFIX}_SRCS - library.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${CMAKE_DL_LIBS}) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(library.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/library/test/CMakeLists.txt b/winpr/libwinpr/library/test/CMakeLists.txt index f49956c98..2962663c2 100644 --- a/winpr/libwinpr/library/test/CMakeLists.txt +++ b/winpr/libwinpr/library/test/CMakeLists.txt @@ -19,12 +19,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-library winpr-path) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/locale/CMakeLists.txt b/winpr/libwinpr/locale/CMakeLists.txt index 6b1ee22fd..826ea68c9 100644 --- a/winpr/libwinpr/locale/CMakeLists.txt +++ b/winpr/libwinpr/locale/CMakeLists.txt @@ -15,36 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-locale") -set(MODULE_PREFIX "WINPR_LOCALE") - -set(${MODULE_PREFIX}_SRCS - locale.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") +winpr_module_add(locale.c) if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ntdsapi) + winpr_library_add(ntdsapi) endif() -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/locale/test/CMakeLists.txt b/winpr/libwinpr/locale/test/CMakeLists.txt index 33025b56b..47b94f5e2 100644 --- a/winpr/libwinpr/locale/test/CMakeLists.txt +++ b/winpr/libwinpr/locale/test/CMakeLists.txt @@ -13,12 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-locale) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/memory/CMakeLists.txt b/winpr/libwinpr/memory/CMakeLists.txt index 02139b575..5e28d3c1e 100644 --- a/winpr/libwinpr/memory/CMakeLists.txt +++ b/winpr/libwinpr/memory/CMakeLists.txt @@ -15,37 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-memory") -set(MODULE_PREFIX "WINPR_MEMORY") - -set(${MODULE_PREFIX}_SRCS - memory.c - memory.h) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(memory.c memory.h) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/memory/test/CMakeLists.txt b/winpr/libwinpr/memory/test/CMakeLists.txt index b143d3f82..861ef6c03 100644 --- a/winpr/libwinpr/memory/test/CMakeLists.txt +++ b/winpr/libwinpr/memory/test/CMakeLists.txt @@ -13,12 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/nt/CMakeLists.txt b/winpr/libwinpr/nt/CMakeLists.txt index 89698ab31..e2988cf42 100644 --- a/winpr/libwinpr/nt/CMakeLists.txt +++ b/winpr/libwinpr/nt/CMakeLists.txt @@ -15,45 +15,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-nt") -set(MODULE_PREFIX "WINPR_NT") +winpr_module_add(nt.c) -set(${MODULE_PREFIX}_SRCS - nt.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS +winpr_library_add( ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) if(${CMAKE_SYSTEM_NAME} MATCHES SunOS) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) + winpr_library_add(rt) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/nt/test/CMakeLists.txt b/winpr/libwinpr/nt/test/CMakeLists.txt index b3fcb8bab..6e26faea3 100644 --- a/winpr/libwinpr/nt/test/CMakeLists.txt +++ b/winpr/libwinpr/nt/test/CMakeLists.txt @@ -14,12 +14,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-nt) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/path/CMakeLists.txt b/winpr/libwinpr/path/CMakeLists.txt index 9342f4d54..dd8393ae6 100644 --- a/winpr/libwinpr/path/CMakeLists.txt +++ b/winpr/libwinpr/path/CMakeLists.txt @@ -15,33 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-path") -set(MODULE_PREFIX "WINPR_PATH") - -set(${MODULE_PREFIX}_SRCS - path.c - shell.c) - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-heap winpr-environment) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(path.c shell.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/path/test/CMakeLists.txt b/winpr/libwinpr/path/test/CMakeLists.txt index 6f9120af3..8d0bc0ac9 100644 --- a/winpr/libwinpr/path/test/CMakeLists.txt +++ b/winpr/libwinpr/path/test/CMakeLists.txt @@ -35,12 +35,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-path) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/pipe/CMakeLists.txt b/winpr/libwinpr/pipe/CMakeLists.txt index 4b2f53263..a78b98af3 100644 --- a/winpr/libwinpr/pipe/CMakeLists.txt +++ b/winpr/libwinpr/pipe/CMakeLists.txt @@ -15,37 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-pipe") -set(MODULE_PREFIX "WINPR_PIPE") - -set(${MODULE_PREFIX}_SRCS - pipe.c - pipe.h) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-synch winpr-handle winpr-file) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(pipe.c pipe.h) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/pipe/test/CMakeLists.txt b/winpr/libwinpr/pipe/test/CMakeLists.txt index c7b9b5a3d..b9bf68560 100644 --- a/winpr/libwinpr/pipe/test/CMakeLists.txt +++ b/winpr/libwinpr/pipe/test/CMakeLists.txt @@ -15,12 +15,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-pipe winpr-io winpr-synch winpr-thread winpr-error winpr-utils) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/pool/CMakeLists.txt b/winpr/libwinpr/pool/CMakeLists.txt index 8044c89e7..d4eff4080 100644 --- a/winpr/libwinpr/pool/CMakeLists.txt +++ b/winpr/libwinpr/pool/CMakeLists.txt @@ -15,10 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-pool") -set(MODULE_PREFIX "WINPR_POOL") - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( synch.c work.c timer.c @@ -30,41 +27,15 @@ set(${MODULE_PREFIX}_SRCS callback.c callback_cleanup.c) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS +winpr_library_add( ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) if(${CMAKE_SYSTEM_NAME} MATCHES SunOS) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) + winpr_library_add(rt) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-thread winpr-synch winpr-utils) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() - diff --git a/winpr/libwinpr/pool/test/CMakeLists.txt b/winpr/libwinpr/pool/test/CMakeLists.txt index eb03c0b6f..9758fff05 100644 --- a/winpr/libwinpr/pool/test/CMakeLists.txt +++ b/winpr/libwinpr/pool/test/CMakeLists.txt @@ -17,12 +17,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-pool winpr-interlocked) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/registry/CMakeLists.txt b/winpr/libwinpr/registry/CMakeLists.txt index 3d04e40c9..4400afdd5 100644 --- a/winpr/libwinpr/registry/CMakeLists.txt +++ b/winpr/libwinpr/registry/CMakeLists.txt @@ -15,30 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-registry") -set(MODULE_PREFIX "WINPR_REGISTRY") - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( registry_reg.c registry_reg.h registry.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} winpr-utils) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") diff --git a/winpr/libwinpr/rpc/CMakeLists.txt b/winpr/libwinpr/rpc/CMakeLists.txt index 758a44fca..a9c7c9acd 100644 --- a/winpr/libwinpr/rpc/CMakeLists.txt +++ b/winpr/libwinpr/rpc/CMakeLists.txt @@ -15,10 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-rpc") -set(MODULE_PREFIX "WINPR_RPC") - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( rpc.c ndr.c ndr_array.c @@ -41,35 +38,13 @@ set(${MODULE_PREFIX}_SRCS ndr_union.h midl.c) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() +winpr_include_directory_add(${OPENSSL_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIRS}) -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -include_directories(${OPENSSL_INCLUDE_DIR}) -include_directories(${ZLIB_INCLUDE_DIRS}) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${OPENSSL_LIBRARIES}) +winpr_library_add(${OPENSSL_LIBRARIES}) if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ws2_32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rpcrt4) + winpr_library_add(ws2_32 rpcrt4) else() - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${ZLIB_LIBRARIES}) + winpr_library_add(${ZLIB_LIBRARIES}) endif() - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") diff --git a/winpr/libwinpr/security/CMakeLists.txt b/winpr/libwinpr/security/CMakeLists.txt index 0630beea1..98141e1a0 100644 --- a/winpr/libwinpr/security/CMakeLists.txt +++ b/winpr/libwinpr/security/CMakeLists.txt @@ -15,30 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-security") -set(MODULE_PREFIX "WINPR_SECURITY") - -set(${MODULE_PREFIX}_SRCS - security.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(security.c) if(BUILD_TESTING) add_subdirectory(test) diff --git a/winpr/libwinpr/security/test/CMakeLists.txt b/winpr/libwinpr/security/test/CMakeLists.txt index 9365b1c66..d9aacb160 100644 --- a/winpr/libwinpr/security/test/CMakeLists.txt +++ b/winpr/libwinpr/security/test/CMakeLists.txt @@ -13,12 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-security) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/smartcard/CMakeLists.txt b/winpr/libwinpr/smartcard/CMakeLists.txt index ec1948d53..00bf37491 100644 --- a/winpr/libwinpr/smartcard/CMakeLists.txt +++ b/winpr/libwinpr/smartcard/CMakeLists.txt @@ -15,15 +15,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-smartcard") set(MODULE_PREFIX "WINPR_SMARTCARD") if(PCSC_WINPR_FOUND) - add_definitions(-DWITH_WINPR_PCSC) + winpr_definition_add(-DWITH_WINPR_PCSC) endif() if(WITH_SMARTCARD_INSPECT) - add_definitions(-DWITH_SMARTCARD_INSPECT) + winpr_definition_add(-DWITH_SMARTCARD_INSPECT) endif() set(${MODULE_PREFIX}_SRCS @@ -41,36 +40,12 @@ if(WIN32) smartcard_winscard.h) endif() -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-library winpr-environment winpr-utils) +winpr_module_add(${${MODULE_PREFIX}_SRCS}) if(PCSC_WINPR_FOUND) - list(APPEND ${MODULE_PREFIX}_LIBS ${PCSC_WINPR_LIBRARY}) + winpr_library_add(${PCSC_WINPR_LIBRARY}) endif() -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() - diff --git a/winpr/libwinpr/smartcard/test/CMakeLists.txt b/winpr/libwinpr/smartcard/test/CMakeLists.txt index e42f291e6..4d8e1074a 100644 --- a/winpr/libwinpr/smartcard/test/CMakeLists.txt +++ b/winpr/libwinpr/smartcard/test/CMakeLists.txt @@ -13,12 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-smartcard winpr-crt) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/sspi/CMakeLists.txt b/winpr/libwinpr/sspi/CMakeLists.txt index ce8152766..40b8da011 100644 --- a/winpr/libwinpr/sspi/CMakeLists.txt +++ b/winpr/libwinpr/sspi/CMakeLists.txt @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-sspi") set(MODULE_PREFIX "WINPR_SSPI") set(${MODULE_PREFIX}_NTLM_SRCS @@ -49,49 +48,24 @@ set(${MODULE_PREFIX}_SRCS sspi.c sspi.h) -set(${MODULE_PREFIX}_SRCS - ${${MODULE_PREFIX}_NTLM_SRCS} +winpr_module_add(${${MODULE_PREFIX}_NTLM_SRCS} ${${MODULE_PREFIX}_KERBEROS_SRCS} ${${MODULE_PREFIX}_NEGOTIATE_SRCS} ${${MODULE_PREFIX}_SCHANNEL_SRCS} ${${MODULE_PREFIX}_SRCS}) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - #set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) +winpr_include_directory_add(${ZLIB_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIR}) -include_directories(${ZLIB_INCLUDE_DIRS}) -include_directories(${OPENSSL_INCLUDE_DIR}) -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${ZLIB_LIBRARIES} +winpr_library_add(${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES}) if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ws2_32) + winpr_library_add(ws2_32) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-sysinfo winpr-registry winpr-crypto winpr-library winpr-utils) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/sspi/test/CMakeLists.txt b/winpr/libwinpr/sspi/test/CMakeLists.txt index afe93c408..60e8e09fd 100644 --- a/winpr/libwinpr/sspi/test/CMakeLists.txt +++ b/winpr/libwinpr/sspi/test/CMakeLists.txt @@ -30,12 +30,7 @@ if(WIN32) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} secur32 crypt32) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-sspi winpr-thread winpr-pipe winpr-file winpr-crypto winpr-utils) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/sspicli/CMakeLists.txt b/winpr/libwinpr/sspicli/CMakeLists.txt index 651978b11..f50585e3d 100644 --- a/winpr/libwinpr/sspicli/CMakeLists.txt +++ b/winpr/libwinpr/sspicli/CMakeLists.txt @@ -15,23 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-sspicli") -set(MODULE_PREFIX "WINPR_SSPICLI") - -set(${MODULE_PREFIX}_SRCS - sspicli.c) - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(sspicli.c) diff --git a/winpr/libwinpr/synch/CMakeLists.txt b/winpr/libwinpr/synch/CMakeLists.txt index 66ce56a53..4de39733c 100644 --- a/winpr/libwinpr/synch/CMakeLists.txt +++ b/winpr/libwinpr/synch/CMakeLists.txt @@ -15,16 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-synch") -set(MODULE_PREFIX "WINPR_SYNCH") - -if(HAVE_PTHREAD_GNU_EXT) - add_definitions(-D_GNU_SOURCE) -endif(HAVE_PTHREAD_GNU_EXT) - -include_directories(../thread) - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( address.c barrier.c condition.c @@ -39,35 +30,10 @@ set(${MODULE_PREFIX}_SRCS timer.c wait.c) -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS}) - if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID)) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) + winpr_library_add(rt) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-handle winpr-error winpr-interlocked winpr-thread winpr-sysinfo) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/synch/test/CMakeLists.txt b/winpr/libwinpr/synch/test/CMakeLists.txt index 7805d1798..34d7d3a68 100644 --- a/winpr/libwinpr/synch/test/CMakeLists.txt +++ b/winpr/libwinpr/synch/test/CMakeLists.txt @@ -20,12 +20,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-synch winpr-sysinfo winpr-error) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index 5300b6b08..7b277117b 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -22,6 +22,10 @@ #include "config.h" #endif +#ifdef HAVE_PTHREAD_GNU_EXT +#define _GNU_SOURCE +#endif + #ifdef HAVE_UNISTD_H #include #endif diff --git a/winpr/libwinpr/sysinfo/CMakeLists.txt b/winpr/libwinpr/sysinfo/CMakeLists.txt index 31006f0da..8f4e79bd0 100644 --- a/winpr/libwinpr/sysinfo/CMakeLists.txt +++ b/winpr/libwinpr/sysinfo/CMakeLists.txt @@ -15,37 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-sysinfo") -set(MODULE_PREFIX "WINPR_SYSINFO") - -set(${MODULE_PREFIX}_SRCS - sysinfo.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") +winpr_module_add(sysinfo.c) if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID)) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) + winpr_library_add(rt) endif() -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() - diff --git a/winpr/libwinpr/sysinfo/test/CMakeLists.txt b/winpr/libwinpr/sysinfo/test/CMakeLists.txt index b757b273c..b76bbf6af 100644 --- a/winpr/libwinpr/sysinfo/test/CMakeLists.txt +++ b/winpr/libwinpr/sysinfo/test/CMakeLists.txt @@ -16,12 +16,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-sysinfo) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/thread/CMakeLists.txt b/winpr/libwinpr/thread/CMakeLists.txt index e8d4c01d1..9897d767a 100644 --- a/winpr/libwinpr/thread/CMakeLists.txt +++ b/winpr/libwinpr/thread/CMakeLists.txt @@ -15,10 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-thread") -set(MODULE_PREFIX "WINPR_THREAD") - -set(${MODULE_PREFIX}_SRCS +winpr_module_add( argv.c process.c processor.c @@ -26,39 +23,10 @@ set(${MODULE_PREFIX}_SRCS thread.h tls.c) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS}) - if(${CMAKE_SYSTEM_NAME} MATCHES SunOS) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) + winpr_library_add(rt) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-path winpr-handle) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/thread/test/CMakeLists.txt b/winpr/libwinpr/thread/test/CMakeLists.txt index 258704857..b078c0664 100644 --- a/winpr/libwinpr/thread/test/CMakeLists.txt +++ b/winpr/libwinpr/thread/test/CMakeLists.txt @@ -14,12 +14,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-thread winpr-heap winpr-environment winpr-synch) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/thread/thread.c b/winpr/libwinpr/thread/thread.c index 3d69f1700..51b775b7d 100644 --- a/winpr/libwinpr/thread/thread.c +++ b/winpr/libwinpr/thread/thread.c @@ -71,7 +71,6 @@ #include #if defined(__linux__) && !defined(__ANDROID__) -#define _GNU_SOURCE #include #include #include diff --git a/winpr/libwinpr/timezone/CMakeLists.txt b/winpr/libwinpr/timezone/CMakeLists.txt index b9fece024..49ae25418 100644 --- a/winpr/libwinpr/timezone/CMakeLists.txt +++ b/winpr/libwinpr/timezone/CMakeLists.txt @@ -15,23 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-timezone") -set(MODULE_PREFIX "WINPR_TIMEZONE") - -set(${MODULE_PREFIX}_SRCS - timezone.c) - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(timezone.c) diff --git a/winpr/libwinpr/utils/CMakeLists.txt b/winpr/libwinpr/utils/CMakeLists.txt index dbf7f4cd1..21cddb632 100644 --- a/winpr/libwinpr/utils/CMakeLists.txt +++ b/winpr/libwinpr/utils/CMakeLists.txt @@ -15,9 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-utils") -set(MODULE_PREFIX "WINPR_UTILS") - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(${MODULE_PREFIX}_COLLECTIONS_SRCS @@ -82,45 +79,25 @@ set(${MODULE_PREFIX}_SRCS stream.c cmdline.c) -set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} +winpr_module_add(${${MODULE_PREFIX}_SRCS} ${${MODULE_PREFIX}_COLLECTIONS_SRCS} ${${MODULE_PREFIX}_TRIO_SRCS} ${${MODULE_PREFIX}_WLOG_SRCS}) -include_directories("trio") -include_directories(${ZLIB_INCLUDE_DIRS}) -include_directories(${OPENSSL_INCLUDE_DIR}) +winpr_include_directory_add( + "trio" + "." + ${ZLIB_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIR}) -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set(${MODULE_PREFIX}_LIBS +winpr_library_add( ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES}) if(UNIX) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} m) + winpr_library_add(m) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-file winpr-path winpr-synch winpr-sysinfo) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() - diff --git a/winpr/libwinpr/utils/test/CMakeLists.txt b/winpr/libwinpr/utils/test/CMakeLists.txt index c217cd587..a663d0640 100644 --- a/winpr/libwinpr/utils/test/CMakeLists.txt +++ b/winpr/libwinpr/utils/test/CMakeLists.txt @@ -27,12 +27,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-path winpr-thread winpr-utils) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/winhttp/CMakeLists.txt b/winpr/libwinpr/winhttp/CMakeLists.txt index 62088e7c3..57576c6f9 100644 --- a/winpr/libwinpr/winhttp/CMakeLists.txt +++ b/winpr/libwinpr/winhttp/CMakeLists.txt @@ -15,23 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-winhttp") -set(MODULE_PREFIX "WINPR_WINHTTP") - -set(${MODULE_PREFIX}_SRCS - winhttp.c) - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -if(MONOLITHIC_BUILD) - -else() - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") +winpr_module_add(winhttp.c) diff --git a/winpr/libwinpr/winsock/CMakeLists.txt b/winpr/libwinpr/winsock/CMakeLists.txt index c4369c535..1d2e1159a 100644 --- a/winpr/libwinpr/winsock/CMakeLists.txt +++ b/winpr/libwinpr/winsock/CMakeLists.txt @@ -15,32 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-winsock") -set(MODULE_PREFIX "WINPR_WINSOCK") - -set(${MODULE_PREFIX}_SRCS - winsock.c) - -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") +winpr_module_add(winsock.c) if(WIN32) - set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ws2_32) + winpr_library_add(ws2_32) endif() - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") diff --git a/winpr/libwinpr/wnd/CMakeLists.txt b/winpr/libwinpr/wnd/CMakeLists.txt index 37a779407..f3897cde5 100644 --- a/winpr/libwinpr/wnd/CMakeLists.txt +++ b/winpr/libwinpr/wnd/CMakeLists.txt @@ -15,37 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-wnd") -set(MODULE_PREFIX "WINPR_WND") - -set(${MODULE_PREFIX}_SRCS - wnd.c +winpr_module_add(wnd.c wnd.h) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS}) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-crt winpr-utils) - -if(MONOLITHIC_BUILD) - -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/wnd/test/CMakeLists.txt b/winpr/libwinpr/wnd/test/CMakeLists.txt index c233ad235..8882d4c44 100644 --- a/winpr/libwinpr/wnd/test/CMakeLists.txt +++ b/winpr/libwinpr/wnd/test/CMakeLists.txt @@ -14,12 +14,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-wnd winpr-library) - -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/libwinpr/wtsapi/CMakeLists.txt b/winpr/libwinpr/wtsapi/CMakeLists.txt index 20da3086c..718166d9b 100644 --- a/winpr/libwinpr/wtsapi/CMakeLists.txt +++ b/winpr/libwinpr/wtsapi/CMakeLists.txt @@ -15,34 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(MODULE_NAME "winpr-wtsapi") -set(MODULE_PREFIX "WINPR_WTSAPI") - -set(${MODULE_PREFIX}_SRCS - wtsapi.c +winpr_module_add(wtsapi.c wtsapi.h) -add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" - MONOLITHIC ${MONOLITHIC_BUILD} - SOURCES ${${MODULE_PREFIX}_SRCS} - EXPORT) - -set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE winpr - MODULES winpr-nt winpr-io winpr-synch winpr-file winpr-error winpr-library winpr-environment winpr-utils) - -if(MONOLITHIC_BUILD) - set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) -else() - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) - install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) -endif() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/winpr/libwinpr/wtsapi/test/CMakeLists.txt b/winpr/libwinpr/wtsapi/test/CMakeLists.txt index 67fd5a1c4..b26197ee0 100644 --- a/winpr/libwinpr/wtsapi/test/CMakeLists.txt +++ b/winpr/libwinpr/wtsapi/test/CMakeLists.txt @@ -20,12 +20,8 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-library winpr-wtsapi winpr-utils) -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) +target_link_libraries(${MODULE_NAME} winpr) set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") diff --git a/winpr/tools/hash/CMakeLists.txt b/winpr/tools/hash/CMakeLists.txt index e9b307173..702ec184a 100644 --- a/winpr/tools/hash/CMakeLists.txt +++ b/winpr/tools/hash/CMakeLists.txt @@ -28,12 +28,8 @@ add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) set(${MODULE_PREFIX}_LIBS ${ZLIB_LIBRARIES} - ${OPENSSL_LIBRARIES}) - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-utils) + ${OPENSSL_LIBRARIES} + winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) diff --git a/winpr/tools/makecert/CMakeLists.txt b/winpr/tools/makecert/CMakeLists.txt index afd925610..6afa33613 100644 --- a/winpr/tools/makecert/CMakeLists.txt +++ b/winpr/tools/makecert/CMakeLists.txt @@ -27,12 +27,8 @@ add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS}) set(${MODULE_PREFIX}_LIBS ${ZLIB_LIBRARIES} - ${OPENSSL_LIBRARIES}) - -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} - MODULE winpr - MODULES winpr-crt winpr-utils winpr-sysinfo winpr-file winpr-path) + ${OPENSSL_LIBRARIES} + winpr) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})