From 3ba401d7da3b01f97fd8a0409aace71d7f81a6a3 Mon Sep 17 00:00:00 2001 From: Steven McCoy Date: Fri, 9 Nov 2012 08:48:59 -0500 Subject: [PATCH 1/2] Bring along CMake patchset from zeromq3-x for adding minor version to Windows labeling. --- CMakeLists.txt | 96 +++++++++++++++++++++++++--------------- cmake/NSIS.template64.in | 20 ++++----- 2 files changed, 70 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 768c906d..22ac914b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,32 @@ set(PYTHON_EXECUTABLE c:/cygwin/bin/python2.6.exe CACHE FILEPATH "Python interpr # TODO: Replace with FindAsciidoc.cmake set(ASCIIDOC_EXECUTABLE c:/cygwin/bin/asciidoc CACHE FILEPATH "AsciiDoc executable") -set(OPENPGM_ROOT /libpgm/libpgm-5.1.118-1~dfsg/openpgm/pgm CACHE PATH "Location of OpenPGM") +if (WITH_OPENPGM) +# set(OPENPGM_ROOT "" CACHE PATH "Location of OpenPGM") + set(OPENPGM_VERSION_MAJOR 5) + set(OPENPGM_VERSION_MINOR 2) + set(OPENPGM_VERSION_MICRO 121) + if (CMAKE_CL_64) + find_path(OPENPGM_ROOT include/pgm/pgm.h + PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]" + NO_DEFAULT_PATH + ) + else (CMAKE_CL_64) + find_path(OPENPGM_ROOT include/pgm/pgm.h + PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]" + NO_DEFAULT_PATH + ) + endif (CMAKE_CL_64) + message(STATUS "OpenPGM detected - ${OPENPGM_ROOT}") + set(OPENPGM_INCLUDE_DIRS ${OPENPGM_ROOT}/include) + set(OPENPGM_LIBRARY_DIRS ${OPENPGM_ROOT}/lib) + set(OPENPGM_LIBRARIES + optimized libpgm${_zmq_COMPILER}-mt-${OPENPGM_VERSION_MAJOR}_${OPENPGM_VERSION_MINOR}_${OPENPGM_VERSION_MICRO}.lib + debug libpgm${_zmq_COMPILER}-mt-gd-${OPENPGM_VERSION_MAJOR}_${OPENPGM_VERSION_MINOR}_${OPENPGM_VERSION_MICRO}.lib) +endif (WITH_OPENPGM) mark_as_advanced(PYTHON_EXECUTABLE ASCIIDOC_EXECUTABLE) @@ -160,28 +185,13 @@ if(WITH_OPENPGM) add_definitions( -DZMQ_HAVE_OPENPGM ) - include_directories( - ${OPENPGM_ROOT}/include + ${OPENPGM_INCLUDE_DIRS} ) - if (CMAKE_SIZEOF_VOID_P EQUAL 8) -# Win64 - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(OPENPGM_LIBRARYDIR ${OPENPGM_ROOT}/debug64/lib) - else (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(OPENPGM_LIBRARYDIR ${OPENPGM_ROOT}/build64/lib) - endif (CMAKE_BUILD_TYPE STREQUAL "Debug") - else (CMAKE_SIZEOF_VOID_P EQUAL 8) -# Win32 - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(OPENPGM_LIBRARYDIR ${OPENPGM_ROOT}/debug/lib) - else (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(OPENPGM_LIBRARYDIR ${OPENPGM_ROOT}/build/lib) - endif (CMAKE_BUILD_TYPE STREQUAL "Debug") - endif (CMAKE_SIZEOF_VOID_P EQUAL 8) link_directories( - ${OPENPGM_LIBRARYDIR} + ${OPENPGM_LIBRARY_DIRS} ) + set(OPTIONAL_LIBRARIES ${OPENPGM_LIBRARIES}) endif(WITH_OPENPGM) #----------------------------------------------------------------------------- @@ -207,11 +217,11 @@ add_custom_command( ) list(APPEND sources ${CMAKE_BINARY_DIR}/platform.hpp) -if (CMAKE_SIZEOF_VOID_P EQUAL 8) +if (CMAKE_CL_64) set (nsis-template ${CMAKE_SOURCE_DIR}/cmake/NSIS.template64.in) -else (CMAKE_SIZEOF_VOID_P EQUAL 8) +else (CMAKE_CL_64) set (nsis-template ${CMAKE_SOURCE_DIR}/cmake/NSIS.template32.in) -endif (CMAKE_SIZEOF_VOID_P EQUAL 8) +endif (CMAKE_CL_64) add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/NSIS.template.in COMMAND ${CMAKE_COMMAND} @@ -253,17 +263,20 @@ endforeach (txt ${docs}) # output add_library(libzmq SHARED ${sources} ${html-docs} ${CMAKE_BINARY_DIR}/NSIS.template.in) -target_link_libraries(libzmq ws2_32.lib rpcrt4.lib) +target_link_libraries(libzmq ws2_32.lib rpcrt4.lib ${OPTIONAL_LIBRARIES}) +set_target_properties(libzmq PROPERTIES + RELEASE_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" + DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}") -set_target_properties(libzmq PROPERTIES RELEASE_POSTFIX "${_zmq_COMPILER}-mt" DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd") +#----------------------------------------------------------------------------- +# installer +install (TARGETS libzmq ARCHIVE DESTINATION lib COMPONENT SDK) if (CMAKE_BUILD_TYPE STREQUAL "Debug") - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd.dll DESTINATION bin COMPONENT SDK) - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd.lib DESTINATION lib COMPONENT SDK) - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd.pdb DESTINATION lib COMPONENT SDK) + install (TARGETS libzmq RUNTIME DESTINATION bin COMPONENT SDK) + install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}.pdb DESTINATION lib COMPONENT SDK) else (CMAKE_BUILD_TYPE STREQUAL "Debug") install (TARGETS libzmq RUNTIME DESTINATION bin COMPONENT Runtime) - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt.lib DESTINATION lib COMPONENT SDK) endif (CMAKE_BUILD_TYPE STREQUAL "Debug") install (FILES ${headers} DESTINATION include COMPONENT SDK) @@ -296,18 +309,29 @@ endif (WITH_DOC) include (InstallRequiredSystemLibraries) -if (CMAKE_SIZEOF_VOID_P EQUAL 8) +if (CMAKE_CL_64) + set (CPACK_NSIS_DISPLAY_NAME "ZeroMQ ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH} (x64)") + set (CPACK_PACKAGE_FILE_NAME "ZeroMQ-${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}-x64") set (CPACK_INSTALL_CMAKE_PROJECTS - "${CMAKE_SOURCE_DIR}/build64;ZeroMQ;ALL;/" - "${CMAKE_SOURCE_DIR}/debug64;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/build/x64/v110;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/debug/x64/v110;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/build/x64/v100;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/debug/x64/v100;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/build/x64/v90;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/debug/x64/v90;ZeroMQ;ALL;/" ) -else (CMAKE_SIZEOF_VOID_P EQUAL 8) +else (CMAKE_CL_64) + set (CPACK_NSIS_DISPLAY_NAME "ZeroMQ ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}") + set (CPACK_PACKAGE_FILE_NAME "ZeroMQ-${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}-x86") set (CPACK_INSTALL_CMAKE_PROJECTS - "${CMAKE_SOURCE_DIR}/build;ZeroMQ;ALL;/" - "${CMAKE_SOURCE_DIR}/debug;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/build/x86/v110;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/debug/x86/v110;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/build/x86/v100;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/debug/x86/v100;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/build/x86/v90;ZeroMQ;ALL;/" + "${CMAKE_SOURCE_DIR}/debug/x86/v90;ZeroMQ;ALL;/" ) -endif (CMAKE_SIZEOF_VOID_P EQUAL 8) - +endif (CMAKE_CL_64) set (CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "ZeroMQ lightweight messaging kernel") set (CPACK_PACKAGE_VENDOR "Miru") diff --git a/cmake/NSIS.template64.in b/cmake/NSIS.template64.in index 12c7bf89..e744eeca 100644 --- a/cmake/NSIS.template64.in +++ b/cmake/NSIS.template64.in @@ -75,7 +75,7 @@ Var AR_RegFlags ClearErrors ;Reading component status from registry - ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed" + ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)\Components\${SecName}" "Installed" IfErrors "default_${SecName}" ;Status will stay default if registry value not found ;(component was never installed) @@ -108,13 +108,13 @@ Var AR_RegFlags ;Section is not selected: ;Calling Section uninstall macro and writing zero installed flag !insertmacro "Remove_${${SecName}}" - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)\Components\${SecName}" \ "Installed" 0 Goto "exit_${SecName}" "leave_${SecName}:" ;Section is selected: - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)\Components\${SecName}" \ "Installed" 1 "exit_${SecName}:" @@ -494,7 +494,7 @@ Function ConditionalAddToRegisty Pop $0 Pop $1 StrCmp "$0" "" ConditionalAddToRegisty_EmptyString - WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \ + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" \ "$1" "$0" ;MessageBox MB_OK "Set Registry: '$1' to '$0'" DetailPrint "Set install registry entry: '$1' to '$0'" @@ -810,17 +810,17 @@ FunctionEnd Section "Uninstall" ReadRegStr $START_MENU SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "StartMenu" ;MessageBox MB_OK "Start menu is in: $START_MENU" ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "DoNotAddToPath" ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "AddToPathAllUsers" ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "AddToPathCurrentUser" ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" ReadRegStr $INSTALL_DESKTOP SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "InstallToDesktop" ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " @CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ @@ -837,7 +837,7 @@ Section "Uninstall" ;Remove the uninstaller itself. Delete "$INSTDIR\Uninstall.exe" - DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" + DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" ;Remove the installation directory if it is empty. RMDir "$INSTDIR" From 19a8ea4584f63d9fbdb695347f1d9b359f70698f Mon Sep 17 00:00:00 2001 From: Steven McCoy Date: Fri, 9 Nov 2012 08:54:14 -0500 Subject: [PATCH 2/2] Update source list with raw codec. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22ac914b..38def468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,8 @@ set(cxx-sources pull.cpp push.cpp random.cpp + raw_encoder.cpp + raw_decoder.cpp reaper.cpp rep.cpp req.cpp