Unverified Commit 833b313d authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #258 from kiplingw/pkg-config

Added pkg-config support with versioning...
parents 957198b8 f8b9acbd
......@@ -37,3 +37,49 @@ if (PISTACHE_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
# Set version...
# Major and minor version...
set(VERSION_MAJOR 0)
set(VERSION_MINOR 0)
# Make available in a header file...
configure_file (
"include/pistache/version.h.in"
"include/pistache/version.h"
@ONLY
)
# Install header...
install (
FILES
${CMAKE_BINARY_DIR}/include/pistache/version.h
DESTINATION
include/pistache/
)
# Configure the pkg-config metadata...
# Initialize the metadata variables to support remote builds...
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
set(version ${VERSION_MAJOR}.${VERSION_MINOR})
# Perform substitutions...
configure_file (
"libpistache.pc.in"
"libpistache.pc"
@ONLY
)
# Install pkg-config metadata into standard location within the prefix...
install (
FILES
${CMAKE_BINARY_DIR}/libpistache.pc
DESTINATION
lib/pkgconfig/
)
/* version.h
Kip Warner, 29 May 2018
Version constants
*/
#pragma once
namespace Pistache {
namespace Version {
static constexpr int Major = @VERSION_MAJOR@;
static constexpr int Minor = @VERSION_MINOR@;
} // namespace Version
} // namespace Pistache
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libpistache
URL: http://pistache.io/
Description: An elegant C++ REST framework.
Version: @version@
Requires:
Libs: -L'${libdir}/' -lpistache -lpthread
Libs.private:
Cflags: -I'${includedir}/'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment