Skip to content

Commit 9576a64

Browse files
ricrogzd-b-w
authored andcommitted
enable version in find_package(maeparser)
1 parent da0679e commit 9576a64

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set (CMAKE_CXX_STANDARD 11)
22
cmake_minimum_required(VERSION 3.12)
33

4-
project(maeparser)
4+
project(maeparser VERSION 1.3.3)
55

66
option(MAEPARSER_RIGOROUS_BUILD "Abort the build if the compiler issues any warnings" OFF )
77
option(MAEPARSER_BUILD_TESTS "Whether test executables should be built" ON)
@@ -55,11 +55,11 @@ if(MAEPARSER_USE_BOOST_IOSTREAMS)
5555
endif(Boost_ZLIB_FOUND)
5656

5757
target_link_libraries(maeparser ${boost_libs})
58-
endif(MAEPARSER_BOOST_IOSTREAMS_SUPPORT)
58+
endif(MAEPARSER_USE_BOOST_IOSTREAMS)
5959

6060
SET_TARGET_PROPERTIES (maeparser
6161
PROPERTIES
62-
VERSION 1.3.3
62+
VERSION ${PROJECT_VERSION}
6363
SOVERSION 1
6464
)
6565

@@ -84,6 +84,12 @@ INSTALL(EXPORT maeparser-targets
8484
FILE ${PROJECT_NAME}-config.cmake
8585
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
8686

87+
include(CMakePackageConfigHelpers)
88+
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
89+
COMPATIBILITY AnyNewerVersion)
90+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
91+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
92+
8793
file(GLOB mae_headers "*.hpp")
8894
install(FILES ${mae_headers} DESTINATION include/maeparser)
8995

0 commit comments

Comments
 (0)