diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-10-27 11:53:49 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-10-27 11:53:49 +0100 |
commit | 5e66f5402d2c1165324fae9747e815380d495cb4 (patch) | |
tree | d8a98499b3a33e6b065d6b5edfed2c01bc5429db | |
parent | 38694ea5205004fa4a5493fe02c3a31fb6b2f532 (diff) | |
download | hex-5e66f5402d2c1165324fae9747e815380d495cb4.tar.gz hex-5e66f5402d2c1165324fae9747e815380d495cb4.tar.xz hex-5e66f5402d2c1165324fae9747e815380d495cb4.zip |
Bump minimum CMake version to 3.0
A nice, round number. This allows us to remove some boilerplate.
-rw-r--r-- | CMakeLists.txt | 22 | ||||
-rw-r--r-- | README.adoc | 3 | ||||
-rw-r--r-- | config.h.in | 4 |
3 files changed, 7 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f6b7c71..333c408 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -project (hex C) -cmake_minimum_required (VERSION 2.8.5) +cmake_minimum_required (VERSION 3.0) +project (hex VERSION 0.1.0 LANGUAGES C) # Moar warnings if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC) @@ -7,15 +7,6 @@ if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra ${wdisabled}") endif () -# Version -set (project_VERSION_MAJOR "0") -set (project_VERSION_MINOR "1") -set (project_VERSION_PATCH "0") - -set (project_VERSION "${project_VERSION_MAJOR}") -set (project_VERSION "${project_VERSION}.${project_VERSION_MINOR}") -set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}") - # For custom modules set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/liberty/cmake) @@ -125,16 +116,13 @@ set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hex viewer") 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_MAJOR ${project_VERSION_MAJOR}) -set (CPACK_PACKAGE_VERSION_MINOR ${project_VERSION_MINOR}) -set (CPACK_PACKAGE_VERSION_PATCH ${project_VERSION_PATCH}) set (CPACK_GENERATOR "TGZ;ZIP") set (CPACK_PACKAGE_FILE_NAME - "${PROJECT_NAME}-${project_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") -set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${project_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 "/\\\\.git;/build;/CMakeLists.txt.user") -set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${project_VERSION}") +set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}") set (CPACK_SET_DESTDIR TRUE) include (CPack) diff --git a/README.adoc b/README.adoc index 0cb4103..8ae9973 100644 --- a/README.adoc +++ b/README.adoc @@ -35,9 +35,6 @@ Or you can try telling CMake to make a package for you. For Debian it is: $ cpack -G DEB # dpkg -i hex-*.deb -Note that for versions of CMake before 2.8.9, you need to prefix `cpack` with -`fakeroot` or file ownership will end up wrong. - Having the program installed, optionally create a configuration file and run it on a file of your choice. diff --git a/config.h.in b/config.h.in index c71fa57..ba7991d 100644 --- a/config.h.in +++ b/config.h.in @@ -1,8 +1,8 @@ #ifndef CONFIG_H #define CONFIG_H -#define PROGRAM_NAME "${CMAKE_PROJECT_NAME}" -#define PROGRAM_VERSION "${project_VERSION}" +#define PROGRAM_NAME "${PROJECT_NAME}" +#define PROGRAM_VERSION "${PROJECT_VERSION}" #cmakedefine HAVE_RESIZETERM #cmakedefine HAVE_LUA |