diff --git a/CMakeLists.txt b/CMakeLists.txt index dbc6ccc..bc78304 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0) -project(libfort) +project(libfort VERSION 0.1.5) + +string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" + "\\1.\\2" libfort_SOVERSION + ${libfort_VERSION}) include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) @@ -180,6 +184,7 @@ endif() + # ------------------------------------------------------------------------------ # Set preprocessor macros for all test builds # ------------------------------------------------------------------------------ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5984d2a..0d60da1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -9,8 +9,8 @@ target_include_directories(fort ) set_target_properties(fort - PROPERTIES VERSION 0.1.4 - SOVERSION 0.1) + PROPERTIES VERSION ${libfort_VERSION} + SOVERSION ${libfort_SOVERSION}) if(FORT_HAVE_WCHAR) target_compile_definitions(fort @@ -30,3 +30,6 @@ install( ) install(FILES fort.h fort.hpp DESTINATION include) + +configure_file(libfort.pc.in libfort.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libfort.pc DESTINATION lib/pkgconfig) diff --git a/lib/libfort.pc.in b/lib/libfort.pc.in new file mode 100644 index 0000000..2a37bb4 --- /dev/null +++ b/lib/libfort.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +includedir=${prefix}/include +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ + +Name: libfort +Description: A simple C/C++ crossplatform library to create formatted text tables. +Version: @libfort_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lfort