Skip to content

Commit

Permalink
make cmake install also install version file
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor C. Richberger committed Dec 29, 2022
1 parent 156f89e commit 1101684
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@

cmake_minimum_required(VERSION 3.2)

include(GNUInstallDirs)
string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")


set(ARGS_MAIN_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ARGS_MAIN_PROJECT ON)
endif()
project(args CXX)
set(PROJECT_DESCRIPTION "A simple, small, flexible, single-header C++11 argument parsing library. that is designed to appear somewhat similar to Python's argparse.")
set(PROJECT_HOMEPAGE_URL "https://github.com/Taywee/args")
set(PROJECT_VERSION 6.4.2)

project(args LANGUAGES CXX VERSION 6.4.3 DESCRIPTION "A flexible single-header C++11 argument parsing library that is designed to appear somewhat similar to Python's argparse" HOMEPAGE_URL "https://github.com/Taywee/args")

include(GNUInstallDirs)

option(ARGS_BUILD_EXAMPLE "Build example" ON)
option(ARGS_BUILD_UNITTESTS "Build unittests" ON)
Expand All @@ -46,12 +44,16 @@ target_include_directories(args INTERFACE
$<INSTALL_INTERFACE:include>)

if(ARGS_MAIN_PROJECT)
include(CMakePackageConfigHelpers)
install(FILES args.hxx DESTINATION include)
install(TARGETS args EXPORT args-targets)
install(EXPORT args-targets
FILE args-config.cmake
NAMESPACE taywee::
DESTINATION lib/cmake/args)

write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/args-config-version.cmake" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/args-config-version.cmake" DESTINATION lib/cmake/args)
endif()

if (ARGS_BUILD_EXAMPLE)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "args"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 6.4.2
PROJECT_NUMBER = 6.4.3

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions args.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#ifndef ARGS_HXX
#define ARGS_HXX

#define ARGS_VERSION "6.4.2"
#define ARGS_VERSION "6.4.3"
#define ARGS_VERSION_MAJOR 6
#define ARGS_VERSION_MINOR 4
#define ARGS_VERSION_PATCH 2
#define ARGS_VERSION_PATCH 3

#include <algorithm>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ArgsConan(ConanFile):
name = "args"
version = "6.4.2"
version = "6.4.3"
url = "https://github.com/Taywee/args"
description = "A simple header-only C++ argument parser library."
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('args.hxx', ['cpp'],
version: '6.4.2',
version: '6.4.3',
default_options: 'cpp_std=c++11',
license: 'MIT'
)
Expand Down

0 comments on commit 1101684

Please sign in to comment.