-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CommonCPack: make ABI version in package name optional
- Loading branch information
Raphael Dumusc
committed
Mar 22, 2017
1 parent
57fb7e4
commit e3a2dba
Showing
1 changed file
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
|
||
# Copyright (c) 2012-2013 Stefan Eilemann <eile@eyescale.ch> | ||
# Copyright (c) 2013-2017 [email protected] | ||
# Raphael.Dumusc@epfl.ch | ||
# Info: http://www.itk.org/Wiki/CMake:Component_Install_With_CPack | ||
# | ||
# Configures the packaging of the project using CPack. | ||
# | ||
# Also includes CommonPackageConfig (legacy, to be removed in the future). | ||
# | ||
# Input: | ||
# * COMMON_PACKAGE_ABI add the ABI version to the package name (default: ON) | ||
|
||
# No support for subproject packaging | ||
if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) | ||
include(CommonPackageConfig) | ||
return() | ||
endif() | ||
|
||
if(NOT DEFINED COMMON_PACKAGE_ABI) | ||
set(COMMON_PACKAGE_ABI ON) | ||
endif() | ||
|
||
if(NOT CPACK_PROJECT_NAME) | ||
set(CPACK_PROJECT_NAME ${PROJECT_NAME}) | ||
endif() | ||
|
@@ -48,7 +59,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") | |
set(CPACK_PACKAGE_NAME "${LOWER_PACKAGE_NAME_PREFIX}") | ||
|
||
set(OLD_PACKAGES) | ||
if(${PROJECT_NAME}_VERSION_ABI) | ||
if(COMMON_PACKAGE_ABI AND ${PROJECT_NAME}_VERSION_ABI) | ||
set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${${PROJECT_NAME}_VERSION_ABI}") | ||
math(EXPR NUM_OLD_PACKAGES "${${PROJECT_NAME}_VERSION_ABI} - 1") | ||
foreach(i RANGE ${NUM_OLD_PACKAGES}) | ||
|