createLinuxPackages.cmake 1.33 KB
Newer Older
Pierre Aubert's avatar
Pierre Aubert committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

# Commands to create debian package with cmake

set(CPACK_PACKAGE_NAME "${PROGRAM_NAME}")

set(CPACK_PACKAGE_VERSION "${PROGRAM_VERSION}")
set(CPACK_PACKAGE_VENDOR "Pierre Aubert")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROGRAM_DESCRIPTION_NO_QUOTE})

set(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README.md)
set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README.md)
set(CPACK_PACKAGE_HOMEPAGE_URL ${PROGRAM_HOMEPAGE})
set(CPACK_PACKAGE_CONTACT "pierre.aubert@lapp.in2p3.fr")
set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/doc/icon.bmp)
set(CPACK_PACKAGE_DESCRIPTION ${PROGRAM_DESCRIPTION_NO_QUOTE})

if(CREATE_DEB)					#Ok for UBUNTU
	set(CPACK_GENERATOR "DEB")
	set(CPACK_DEBIAN_PACKAGE_MAINTAINER "pierre.aubert@lapp.in2p3.fr") #required
	
	set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PROGRAM_HOMEPAGE})	#For the debian installer only
	set(CPACK_DEBIAN_PACKAGE_DEPENDS "")
endif(CREATE_DEB)



if(CREATE_RPM)	#Need to install rmp package on ubuntu which contains rpmbuild
	set(CPACK_GENERATOR "RPM")
	set(CPACK_RPM_PACKAGE_AUTOREQ "NO")
	set(CPACK_RPM_PACKAGE_REQUIRES "")
endif(CREATE_RPM)

# if(CREATE_DMG)				#We should use DragNDrop or PackageMaker of osx
# 	set(CPACK_GENERATOR "DMG")
# endif(CREATE_DMG)

include(CPack)
# Has to be used :
# cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCREATE_DEB=yes -DSSE4.2=yes # Or whatever extension
# make -j 8
# cpack