CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / cmake / FindCPack.cmake
CommitLineData
bd8c7dab 1# AliRoot Build System Module to find and configure ROOT
2#
3# Author: Johny Jose m(johny.jose@cern.ch)
4# Port of previous Makefile build to cmake
5
cbd58b9c 6cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
bd8c7dab 7
8get_filename_component(__cmake_path ${CMAKE_COMMAND} PATH)
9find_program(CPACK_COMMAND cpack ${__cmake_path})
10message(STATUS "Found CPack at: ${CPACK_COMMAND}")
11if(NOT CPACK_COMMAND)
12 message(WARNING "CPack not found you will be unable to make packages!")
13endif(NOT CPACK_COMMAND)
14
15if(UNIX)
16 set(CPACK_GENERATOR "RPM")
17endif(UNIX)
18#if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
19# set(CPACK_GENERATOR "TBZ2;STGZ")
20#endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
21if(WIN32)
22 set(CPACK_GENERATOR "NSIS;ZIP")
23endif(WIN32)
24add_custom_target(all_packages)
25
26macro(add_component_package __component __targetname)
27 set(PACKAGE_COMPONENT ${__component})
28 set(__packageConfig CPackConfig-${PACKAGE_COMPONENT}.cmake)
29
30 configure_file(${PROJECT_SOURCE_DIR}/cmake/CPackConfig.in ${__packageConfig} @ONLY)
31 message(STATUS "Package ${__targetname} configured")
32 add_custom_target(${__targetname}
33 ${CPACK_COMMAND} --config "${__packageConfig}"
34# WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
35 )
36 add_dependencies(all_packages ${__targetname})
37endmacro(add_component_package)