Bump minimum CMake version to 3.0

A nice, round number.
This commit is contained in:
Přemysl Eric Janouch 2020-10-26 23:14:24 +01:00
parent ab5ca0cf8b
commit 7edd9720cd
Signed by: p
GPG Key ID: A0420B94F92B9493
3 changed files with 9 additions and 14 deletions

View File

@ -1,5 +1,5 @@
project (wdmtg C)
cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 3.0)
project (wdmtg VERSION 0.1.0 LANGUAGES C)
# Vala really sucks at producing good C code
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
@ -10,9 +10,6 @@ endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
# Options
option (OPTION_NOINSTALL "Only for developers; work without installing" OFF)
# Version
set (project_VERSION "0.1.0")
# Set some variables
if (OPTION_NOINSTALL)
set (project_SHARE_DIR ${PROJECT_SOURCE_DIR}/share)
@ -68,14 +65,12 @@ set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Activity tracker")
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set (CPACK_PACKAGE_VERSION ${project_VERSION})
set (CPACK_GENERATOR "TGZ;ZIP")
set (CPACK_PACKAGE_FILE_NAME
"${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
"${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${PROJECT_VERSION}")
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set (CPACK_SOURCE_IGNORE_FILES "/build;/\\\\.git")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
include (CPack)

View File

@ -1,3 +1,3 @@
#define PROJECT_NAME "@CMAKE_PROJECT_NAME@"
#define PROJECT_VERSION "@project_VERSION@"
#define PROJECT_NAME "@PROJECT_NAME@"
#define PROJECT_VERSION "@PROJECT_VERSION@"
#define SHARE_DIR "@project_SHARE_DIR@"

View File

@ -4,8 +4,8 @@ add_project_arguments(['--vapidir', meson.current_source_dir()],
language: 'vala')
conf = configuration_data()
conf.set('CMAKE_PROJECT_NAME', meson.project_name())
conf.set('project_VERSION', meson.project_version())
conf.set('PROJECT_NAME', meson.project_name())
conf.set('PROJECT_VERSION', meson.project_version())
configure_file(
input : 'config.h.in',
output : 'config.h',