Skip to content

Commit

Permalink
Simplify version information using the cmake project() command
Browse files Browse the repository at this point in the history
  • Loading branch information
wdobbe committed Apr 8, 2020
1 parent 0cc91a3 commit 568e5ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
30 changes: 8 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,33 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

cmake_minimum_required(VERSION 3.10)
# =============
# CMake init
# =============
cmake_minimum_required(VERSION 3.12)

# ====================
# Version informations
# ====================
# Stable versions: x.y.z , where z < 50
# Development versions: x.y.90
# Pre-release versions: x.y.z, where z = 90 + X in rcX (1.1rc1 = 1.1.91)
set(icecream_version_major "1")
set(icecream_version_minor "3")
set(icecream_version_micro "90")

if(${icecream_version_micro} STREQUAL "")
set(icecream_version "${icecream_version_major}.${icecream_version_minor}")
else()
set(icecream_version "${icecream_version_major}.${icecream_version_minor}.${icecream_version_micro}")
endif()
project(icecc VERSION 1.3.90 LANGUAGES CXX C)

set(PACKAGE "icecc")
set(VERSION "${icecream_version}")
set(PACKAGE_BUGREPORT "")
set(TARNAME "")
set(PACKAGE_URL "")
set(PACKAGE_NAME "${PACKAGE}")
set(PACKAGE_VERSION "${VERSION}")
if(VERSION)
set(PACKAGE_STRING "${PACKAGE} ${VERSION}")
else()
set(PACKAGE_STRING "${PACKAGE}")
endif()
set(PACKAGE_VERSION "${icecc_VERSION}") #get rid of this one later
set(PACKAGE_STRING "${PACKAGE} ${icecc_VERSION}")


if(NOT TARNAME)
string(REGEX REPLACE "[^a-zA-Z0-9_]" "-" TARNAME "${PACKAGE}")
endif()
set(PACKAGE_TARNAME "${TARNAME}")

# =============
# CMake init
# =============
project(icecc LANGUAGES CXX C)

SET(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/Modules
Expand Down Expand Up @@ -115,7 +102,6 @@ endif()
# ===========================
# Find required base packages
# ===========================
find_package(Libcap-ng)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Libcap-ng)
if (Libcap-ng_FOUND)
Expand Down
6 changes: 3 additions & 3 deletions cmake-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
#define PACKAGE_URL "@PACKAGE_URL@"

/* Define to the version of this package. */
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
#define PACKAGE_VERSION "@icecc_VERSION@"

/* Where to place pid files */
#cmakedefine RUNDIR "@RUNDIR@"
Expand All @@ -173,12 +173,12 @@
#cmakedefine STDC_HEADERS @STDC_HEADERS@

/* Version number of package */
#define VERSION "@VERSION@"
#define VERSION "@icecc_VERSION@"

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#cmakedefine inline @inline@
#endif

#define TAR "@TAR_PROGRAM@"
#define TAR "@TAR_PROGRAM@"

0 comments on commit 568e5ea

Please sign in to comment.