Changeset 10008

Show
Ignore:
Timestamp:
04/09/09 17:56:04 (5 years ago)
Author:
robert
Message:

From Mattias Helsing, ""
* Use the CPack ZIP generator on windows (WIN32)
* Reformatted according to Philip Lowman's recent submissions"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeModules/OsgCPack.cmake

    r9998 r10008  
    3131    ENDIF() 
    3232ENDIF() 
    33  
    3433# Guess the compiler (is this desired for other platforms than windows?) 
    3534IF(NOT DEFINED OSG_CPACK_COMPILER) 
     
    4140 
    4241IF(OSG_CPACK_COMPILER) 
    43     SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER}) 
     42  SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER}) 
    4443ELSE() 
    45     SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}) 
     44  SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}) 
    4645ENDIF() 
    4746 
     
    5150 
    5251# these goes for all platforms. Setting these stops the CPack.cmake script from generating options about other package compression formats (.z .tz, etc.) 
    53 SET(CPACK_GENERATOR "TGZ") 
     52IF(WIN32) 
     53    SET(CPACK_GENERATOR "ZIP") 
     54ELSE() 
     55    SET(CPACK_GENERATOR "TGZ") 
     56ENDIF() 
    5457SET(CPACK_SOURCE_GENERATOR "TGZ") 
    5558 
     
    8285ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME}) 
    8386 
    84 #============================= 
    85 # Macro: 
    86 #    GENERATE_PACKAGING_TARGET() 
    87 # 
    8887MACRO(GENERATE_PACKAGING_TARGET package_name) 
    8988    SET(CPACK_PACKAGE_NAME ${package_name}) 
     
    104103 
    105104    # This is naive and will probably need fixing eventually 
    106     IF(WIN32) 
     105    IF(MSVC) 
    107106        SET(MOVE_COMMAND "move") 
    108107    ELSE() 
    109108        SET(MOVE_COMMAND "mv") 
     109    ENDIF() 
     110 
     111    # Set in and out archive filenames. Windows = zip, others = tar.gz 
     112    IF(WIN32) 
     113        SET(ARCHIVE_EXT "zip") 
     114    ELSE() 
     115        SET(ARCHIVE_EXT "tar.gz") 
    110116    ENDIF() 
    111117     
     
    115121    ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_TARGETNAME} 
    116122        COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake 
    117         COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.tar.gz" "${OSG_PACKAGE_FILE_NAME}.tar.gz" 
    118         COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.tar.gz -> ${OSG_PACKAGE_FILE_NAME}.tar.gz" 
     123        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" 
     124        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" 
    119125        COMMENT "Run CPack packaging for ${package_name}..." 
    120126    ) 
     
    123129    ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME} 
    124130        COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake 
    125         COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.tar.gz" "${OSG_PACKAGE_FILE_NAME}.tar.gz" 
    126         COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.tar.gz -> ${OSG_PACKAGE_FILE_NAME}.tar.gz" 
     131        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" 
     132        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" 
    127133    ) 
    128134ENDMACRO(GENERATE_PACKAGING_TARGET) 
    129 # 
    130 #============================= 
    131135 
    132136# Create configs and targets for a package including all components