Add dist target to CMAKE conf. (#434)
authorAlpar Juttner <alpar@cs.elte.hu>
Wed, 01 Feb 2012 06:43:50 +0100
changeset 1135fc1aa7c01c55
parent 1134 0b9a94956916
child 1139 cfbabca1b4e9
Add dist target to CMAKE conf. (#434)
CMakeLists.txt
cmake/version.cmake.in
doc/CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Mon Jan 30 17:49:50 2012 +0100
     1.2 +++ b/CMakeLists.txt	Wed Feb 01 06:43:50 2012 +0100
     1.3 @@ -188,6 +188,33 @@
     1.4    )
     1.5  ENDIF()
     1.6  
     1.7 +CONFIGURE_FILE(
     1.8 +  ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in
     1.9 +  ${PROJECT_BINARY_DIR}/cmake/version.cmake
    1.10 +  @ONLY
    1.11 +)
    1.12 +
    1.13 +SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})
    1.14 +STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)
    1.15 +SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})
    1.16 +ADD_CUSTOM_TARGET(dist
    1.17 +  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
    1.18 +  COMMAND hg archive ${ARCHIVE_NAME}
    1.19 +  COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake
    1.20 +  COMMAND tar -czf ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_NAME}
    1.21 +  COMMAND zip -r ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.zip ${ARCHIVE_NAME}
    1.22 +  COMMAND cmake -E copy_directory doc/html ${ARCHIVE_NAME}/doc/html
    1.23 +  COMMAND tar -czf ${ARCHIVE_NAME}.tar.gz ${ARCHIVE_NAME}
    1.24 +  COMMAND zip -r ${ARCHIVE_NAME}.zip ${ARCHIVE_NAME}
    1.25 +  COMMAND cmake -E copy_directory doc/html ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
    1.26 +  COMMAND tar -czf ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
    1.27 +  COMMAND zip -r ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.zip ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
    1.28 +  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
    1.29 +  COMMAND cmake -E remove_directory ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
    1.30 +  DEPENDS html
    1.31 +  WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
    1.32 +
    1.33 +# CPACK config (Basically for NSIS)
    1.34  IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.35    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
    1.36    SET(CPACK_PACKAGE_VENDOR "EGRES")
     2.1 --- a/cmake/version.cmake.in	Mon Jan 30 17:49:50 2012 +0100
     2.2 +++ b/cmake/version.cmake.in	Wed Feb 01 06:43:50 2012 +0100
     2.3 @@ -1,1 +1,1 @@
     2.4 -SET(LEMON_VERSION "@PACKAGE_VERSION@" CACHE STRING "LEMON version string.")
     2.5 +SET(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.")
     3.1 --- a/doc/CMakeLists.txt	Mon Jan 30 17:49:50 2012 +0100
     3.2 +++ b/doc/CMakeLists.txt	Wed Feb 01 06:43:50 2012 +0100
     3.3 @@ -17,6 +17,15 @@
     3.4    @ONLY
     3.5  )
     3.6  
     3.7 +# Copy doc from source (if exists)
     3.8 +IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html AND 
     3.9 +    NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
    3.10 +  MESSAGE(STATUS "Copy doc from source tree")
    3.11 +  EXECUTE_PROCESS(
    3.12 +    COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/html ${CMAKE_CURRENT_BINARY_DIR}/html
    3.13 +    )
    3.14 +ENDIF()
    3.15 +
    3.16  IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
    3.17    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
    3.18    SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)