matlo607 commented on a change in pull request #288: Refactor cmake to use modern feature URL: https://github.com/apache/qpid-dispatch/pull/288#discussion_r259420162
########## File path: src/CMakeLists.txt ########## @@ -116,24 +103,42 @@ endif() # strict aliasing optimization is only available in GCC if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - set_property( - SOURCE python_embedded.c router_pynode.c - PROPERTY COMPILE_FLAGS -Wno-strict-aliasing + set_property( + SOURCE python_embedded.c router_pynode.c + PROPERTY COMPILE_FLAGS -Wno-strict-aliasing ) endif (CMAKE_C_COMPILER_ID STREQUAL "GNU") add_library(qpid-dispatch SHARED ${qpid_dispatch_SOURCES}) -if(NOT LIBWEBSOCKETS_FOUND) -target_link_libraries(qpid-dispatch ${Proton_Core_LIBRARIES} ${Proton_Proactor_LIBRARIES} ${pthread_lib} ${rt_lib} ${dl_lib} ${PYTHON_LIBRARIES}) -else() -target_link_libraries(qpid-dispatch ${Proton_Core_LIBRARIES} ${Proton_Proactor_LIBRARIES} ${pthread_lib} ${rt_lib} ${dl_lib} ${PYTHON_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES}) +target_link_libraries(qpid-dispatch + PUBLIC + PythonLibs::PythonLibs + Threads::Threads + Glibc::dl + Glibc::rt + Proton::Proactor) + +target_include_directories(qpid-dispatch + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + PUBLIC + ${CMAKE_SOURCE_DIR}/include) + +if(LIBWEBSOCKETS_FOUND) + target_link_libraries(qpid-dispatch PUBLIC WebSockets::WebSockets) endif() -set_target_properties(qpid-dispatch PROPERTIES - LINK_FLAGS "${CATCH_UNDEFINED}" - ) +if (CATCH_UNDEFINED) + set_target_properties(qpid-dispatch PROPERTIES LINK_FLAGS "${CATCH_UNDEFINED}") +endif() + install(TARGETS qpid-dispatch LIBRARY DESTINATION ${QPID_DISPATCH_HOME}) -set (QPID_DISPATCH_LIB "libqpid-dispatch.so") +if (UNIX) + set (QPID_DISPATCH_LIB "libqpid-dispatch.so") +else() + set (QPID_DISPATCH_LIB "qpid-dispatch.dll") Review comment: No, I only built it on Linux. This work was a draft and has never been finalized. I was expecting a more enthusiast review than the first comment I got. That's a pity that the project wants to stick to completely outdated cmake versions only because it is installed by default on a distribution. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org