Skip to content

Commit 93e1231

Browse files
authored
Merge pull request mdaus#793 from mdaus/support/1.x
merge release 1.0.0
2 parents b2a0cba + 8af433c commit 93e1231

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Author: Scott A. Colcord
44

55
cmake_minimum_required(VERSION 3.14)
6-
project(coda-oss)
6+
project(coda-oss VERSION 1.0.0)
77

88
if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
99
# build and package with conan
@@ -38,6 +38,13 @@ if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
3838
install(DIRECTORY "cmake/"
3939
DESTINATION "${CODA_STD_PROJECT_LIB_DIR}/cmake/"
4040
FILES_MATCHING PATTERN "*.cmake")
41+
42+
# If the package version is defined, write a version file for find_package
43+
set(version_file "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake")
44+
include(CMakePackageConfigHelpers)
45+
write_basic_package_version_file(${version_file} VERSION ${CMAKE_PROJECT_VERSION} COMPATIBILITY SameMajorVersion)
46+
install(FILES ${version_file} DESTINATION "lib/cmake")
47+
4148
endif()
4249

4350
add_subdirectory("modules")

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
CODA is a set of modules, and each module, while complimentary to one another, has
1212
a very specific and largely independent purpose.
1313

14+
CODA follows [Semantic Versioning](https://semver.org/).
15+
1416
Building CODA
1517
--------------
1618

cmake/CodaBuild.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,8 @@ function(coda_generate_package_config)
275275
"cmake/${CMAKE_PROJECT_NAME}Config.cmake.in"
276276
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
277277
INSTALL_DESTINATION "lib/cmake"
278-
PATH_VARS ${ARGN}
279-
)
280-
#write_basic_package_version_file(
281-
# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
282-
# VERSION 1.2.3
283-
# COMPATIBILITY SameMajorVersion )
278+
PATH_VARS ${ARGN})
284279
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
285-
#"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
286280
DESTINATION "lib/cmake")
287281
endif()
288282
endfunction()

0 commit comments

Comments
 (0)