Skip to content

Commit 13185c1

Browse files
committed
Merge branch 'release/0.5.1'
2 parents 0f8ee56 + beb6a1d commit 13185c1

File tree

13 files changed

+202
-136
lines changed

13 files changed

+202
-136
lines changed

CMakeLists.txt

Lines changed: 25 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,17 @@
1-
#
21
# This is the Top level CMakelists file which creates the namespace and
32
# organizes all sublibraries under it.
4-
#
5-
# The project name in this file is considered the "Namespace"
6-
# and any libraries under it will be given a target of
7-
#
8-
# Namespace::library_name
9-
#
10-
#
11-
# This Lists file was modified from https://github.com/forexample/package-example
12-
#
13-
# This file creates project 'Foo' with two library targets 'bar' and 'cat'.
14-
# Target 'cat' depends on 'bar'. After installation this project can be found
15-
# by 'find_package(... CONFIG)' command:
16-
#
17-
# find_package(foo CONFIG REQUIRED)
18-
# target_link_libraries(... foo::bar)
19-
#
20-
# Note that requirements propagated automatically, for example:
21-
# * Foo::baz linked automatically
22-
# * <prefix>/include added to header search path
23-
# * FOO_BAZ_DEBUG=1/FOO_BAR_DEBUG=1 added on Debug
24-
# * FOO_BAZ_DEBUG=0/FOO_BAR_DEBUG=0 added on other configurations
3+
cmake_minimum_required(VERSION 3.13)
254

26-
####
27-
# Set minimum version of CMake. We need 3.13 at least.
28-
cmake_minimum_required(VERSION 3.13) # GENERATOR_IS_MULTI_CONFIG
5+
set(PROJECT_NAME "kami")
296

30-
set(KAMI_VERSION_MAJOR 0)
31-
set(KAMI_VERSION_MINOR 5)
32-
set(KAMI_VERSION_PATCH 0)
33-
set(KAMI_VERSION_STRING ${KAMI_VERSION_MAJOR}.${KAMI_VERSION_MINOR}.${KAMI_VERSION_PATCH})
7+
set(VERSION_MAJOR 0)
8+
set(VERSION_MINOR 5)
9+
set(VERSION_PATCH 1)
10+
set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
3411

35-
################################################################################
36-
# Set variables for the project. The:
37-
# * PROJECT_NAME
38-
# * PROJECT_VERSION
39-
# * PROJECT_NAMESPACE should be the same as the project.
40-
project(kami VERSION ${KAMI_VERSION_STRING}
41-
LANGUAGES CXX)
12+
project(${PROJECT_NAME}
13+
VERSION ${VERSION_STRING}
14+
LANGUAGES CXX)
4215

4316
set(CMAKE_CXX_STANDARD 20)
4417
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -48,11 +21,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_BINARY_DIR}" CACHE STRING "M
4821
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
4922
conan_basic_setup()
5023

51-
set(PROJECT_NAMESPACE kami ) # The project namespace. Library targets
52-
# will be referred by
53-
# foo::bar. This value should usually be
54-
# the same as the project.
55-
################################################################################
24+
set(PROJECT_NAMESPACE ${PROJECT_NAME})
5625

5726
find_package(spdlog)
5827
find_package(Threads)
@@ -95,7 +64,7 @@ ENDFOREACH()
9564
################################################################################
9665
# Examples.
9766
#
98-
# Each example will be built as a static or shared library and a
67+
# Each example will be built as a static or shared binary and a
9968
# target will be created for it.
10069
################################################################################
10170

@@ -125,7 +94,7 @@ include(GNUInstallDirs)
12594
# * <prefix>/include/
12695
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
12796

128-
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
97+
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
12998

13099
# Configuration
131100
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
@@ -158,38 +127,30 @@ configure_package_config_file(
158127
# * <prefix>/lib/libbaz.a
159128
# * header location after install: <prefix>/include/foo/Bar.hpp
160129
# * headers can be included by C++ code `#include <foo/Bar.hpp>`
161-
install(
162-
TARGETS
163-
${sub_modules} ${example_modules}
164-
${COVERAGE_INSTALL_TARGET}
165-
EXPORT
166-
"${TARGETS_EXPORT_NAME}"
167-
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
168-
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
169-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
170-
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
171-
)
130+
install(
131+
TARGETS ${sub_modules} ${example_modules} ${COVERAGE_INSTALL_TARGET}
132+
EXPORT "${TARGETS_EXPORT_NAME}"
133+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
134+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
135+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
136+
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
137+
)
172138

173139

174140
# Config
175141
# * <prefix>/lib/cmake/Foo/FooConfig.cmake
176142
# * <prefix>/lib/cmake/Foo/FooConfigVersion.cmake
177143
install(
178-
FILES
179-
"${project_config}" "${version_config}"
180-
DESTINATION
181-
"${config_install_dir}"
144+
FILES "${project_config}" "${version_config}"
145+
DESTINATION "${config_install_dir}"
182146
)
183147

184148
# Config
185149
# * <prefix>/lib/cmake/Foo/FooTargets.cmake
186150
install(
187-
EXPORT
188-
"${TARGETS_EXPORT_NAME}"
189-
NAMESPACE
190-
"${namespace}"
191-
DESTINATION
192-
"${config_install_dir}"
151+
EXPORT "${TARGETS_EXPORT_NAME}"
152+
NAMESPACE "${namespace}"
153+
DESTINATION "${config_install_dir}"
193154
)
194155

195156
add_subdirectory(docs)

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
[![Build (main)](https://github.com/JHUAPL/kami/actions/workflows/build-main.yml/badge.svg)](https://github.com/JHUAPL/kami/actions/workflows/build-main.yml)
22
[![Build (develop)](https://github.com/JHUAPL/kami/actions/workflows/build-develop.yml/badge.svg)](https://github.com/JHUAPL/kami/actions/workflows/build-develop.yml)
3-
[![Documentation status](https://readthedocs.org/projects/kami/badge/?version=latest)](https://kami.readthedocs.io/en/latest/?badge=latest)
3+
[![Documentation status](https://readthedocs.org/projects/kami/badge/?version=main)](https://kami.readthedocs.io/en/main/)
44
[![Release status](https://img.shields.io/github/release/JHUAPL/kami.svg)](https://github.com/JHUAPL/kami/releases)
55
![License](https://img.shields.io/github/license/JHUAPL/kami)
66

77
# Kami is Agent-Based Modeling in Modern C++
88

9+
Agent-based models (ABMs) are models for simulating the actions of
10+
individual actors within a provided environment to understand the
11+
behavior of the agents, most individually and collectively. ABMs
12+
are particularly suited for addressing problems governed by nonlinear
13+
processes or where there is a wide variety of potential responses
14+
an individual agent may provide depending on the environment and
15+
behavior of other agents. Because of this, ABMs have become powerful
16+
tools in both simulation and modeling, especially in public health
17+
and ecology, where they are also known as individual-based models.
18+
ABMs also provide support in economic, business, robotics, and many
19+
other fields.
20+
921
## Compiling
1022

1123
```Bash

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class KamiConan(ConanFile):
55
name = "kami"
6-
version = "0.5.0"
6+
version = "0.5.1"
77
license = "MIT"
88
author = "James P. Howard, II <[email protected]>"
99
url = "https://github.com/jhuapl/kami"

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
- :release:`0.5.1 <2022.08.11>`
5+
- :support:`0` Completed initial unit tests
6+
- :support:`0` Added background info to READ ME
7+
8+
- :release:`0.5.0 <2022.08.08>`
49
- :feature:`0` Added a barebones "starter" model to build from
510
- :support:`0` Numerous documentation cleanups
611
- :bug:`0` Numerous code cleanups to remove void returns and eliminate stored Model references

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Introduction
77
.. image:: https://github.com/JHUAPL/kami/actions/workflows/build-develop.yml/badge.svg?branch=develop
88
:target: https://github.com/JHUAPL/kami/actions/workflows/build-develop.yml
99
:alt: Build Status (develop)
10-
.. image:: https://readthedocs.org/projects/kami/badge/?version=latest
11-
:target: https://kami.readthedocs.io/en/latest/?badge=latest
10+
.. image:: https://readthedocs.org/projects/kami/badge/?version=main
11+
:target: https://kami.readthedocs.io/en/main/
1212
:alt: Documentation Status
1313
.. image:: https://img.shields.io/github/release/JHUAPL/kami.svg
1414
:target: https://github.com/JHUAPL/kami/releases

examples/boltzmann1d/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ create_executable(
1515
PUBLIC_LINKED_TARGETS fmt spdlog::spdlog kami::libkami
1616
)
1717

18-
set_target_properties(${EXAMPLE_NAME} PROPERTIES VERSION ${KAMI_VERSION_STRING})
18+
set_target_properties(${EXAMPLE_NAME} PROPERTIES VERSION ${VERSION_STRING})

examples/boltzmann2d/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ create_executable(
1515
PUBLIC_LINKED_TARGETS fmt spdlog::spdlog kami::libkami
1616
)
1717

18-
set_target_properties(${EXAMPLE_NAME} PROPERTIES VERSION ${KAMI_VERSION_STRING})
18+
set_target_properties(${EXAMPLE_NAME} PROPERTIES VERSION ${VERSION_STRING})

examples/starter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ create_executable(
1515
PUBLIC_LINKED_TARGETS fmt spdlog::spdlog kami::libkami
1616
)
1717

18-
set_target_properties(${EXAMPLE_NAME} PROPERTIES VERSION ${KAMI_VERSION_STRING})
18+
set_target_properties(${EXAMPLE_NAME} PROPERTIES VERSION ${VERSION_STRING})

include/kami/config.h.in

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,23 @@
4141
/**
4242
* The major version of the Kami library.
4343
*/
44-
#define KAMI_VERSION_MAJOR @KAMI_VERSION_MAJOR@
44+
#define KAMI_VERSION_MAJOR @VERSION_MAJOR@
4545

4646
/**
4747
* The minor version of the Kami library.
4848
*/
49-
#define KAMI_VERSION_MINOR @KAMI_VERSION_MINOR@
49+
#define KAMI_VERSION_MINOR @VERSION_MINOR@
5050

5151
/**
5252
* The patch level of the Kami library.
5353
*/
54-
#define KAMI_VERSION_PATCH @KAMI_VERSION_PATCH@
54+
#define KAMI_VERSION_PATCH @VERSION_PATCH@
5555

5656
namespace kami {
5757

5858
namespace {
5959
/**
6060
* @brief A reference copy of the current version of Kami
61-
*
62-
* @return the version as a `semver` object
6361
*/
6462
constexpr auto version = semver::version{KAMI_VERSION_MAJOR, KAMI_VERSION_MINOR, KAMI_VERSION_PATCH};
6563
}

src/libkami/CMakeLists.txt

Lines changed: 60 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,71 @@
22
# Set minimum version of CMake.
33
cmake_minimum_required(VERSION 3.13)
44

5-
project(libkami VERSION ${KAMI_VERSION_STRING}
6-
LANGUAGES CXX)
5+
set(LIBRARY_NAME "libkami")
76

8-
create_library(NAME libkami
9-
NAMESPACE libkami
10-
SOURCES
11-
agent.cc
12-
domain.cc
13-
grid1d.cc
14-
grid2d.cc
15-
model.cc
16-
multigrid1d.cc
17-
multigrid2d.cc
18-
population.cc
19-
random.cc
20-
sequential.cc
21-
sologrid1d.cc
22-
sologrid2d.cc
23-
staged.cc
24-
PUBLIC_INCLUDE_PATHS
25-
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
26-
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated_headers>"
27-
PRIVATE_LINKED_TARGETS
28-
${COVERAGE_TARGET}
29-
EXPORT_FILE_PATH
30-
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/KAMI_EXPORT.h"
31-
)
7+
project(${LIBRARY_NAME} LANGUAGES CXX)
8+
9+
project(${LIBRARY_NAME}
10+
VERSION ${VERSION_STRING}
11+
LANGUAGES CXX)
12+
13+
create_library(
14+
NAME ${LIBRARY_NAME}
15+
NAMESPACE ${LIBRARY_NAME}
16+
SOURCES
17+
agent.cc
18+
domain.cc
19+
grid1d.cc
20+
grid2d.cc
21+
model.cc
22+
multigrid1d.cc
23+
multigrid2d.cc
24+
population.cc
25+
random.cc
26+
sequential.cc
27+
sologrid1d.cc
28+
sologrid2d.cc
29+
staged.cc
30+
PUBLIC_INCLUDE_PATHS "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated_headers>"
31+
PRIVATE_LINKED_TARGETS ${COVERAGE_TARGET}
32+
EXPORT_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/KAMI_EXPORT.h"
33+
)
3234

3335
configure_file(
34-
"${CMAKE_SOURCE_DIR}/include/kami/config.h.in"
35-
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/config.h")
36+
"${CMAKE_SOURCE_DIR}/include/kami/config.h.in"
37+
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/config.h"
38+
)
3639

37-
set_target_properties(libkami PROPERTIES VERSION ${KAMI_VERSION_STRING}
38-
SOVERSION ${KAMI_VERSION_MAJOR}
39-
OUTPUT_NAME kami)
40+
set_target_properties(
41+
${LIBRARY_NAME}
42+
PROPERTIES VERSION ${VERSION_STRING}
43+
SOVERSION ${VERSION_MAJOR}
44+
OUTPUT_NAME kami
45+
)
4046

41-
# Introduce variables:
42-
# * CMAKE_INSTALL_LIBDIR
43-
# * CMAKE_INSTALL_BINDIR
44-
# * CMAKE_INSTALL_INCLUDEDIR
45-
include(GNUInstallDirs)
47+
# Introduce variables:
48+
# * CMAKE_INSTALL_LIBDIR
49+
# * CMAKE_INSTALL_BINDIR
50+
# * CMAKE_INSTALL_INCLUDEDIR
51+
include(GNUInstallDirs)
4652

47-
# Headers:
48-
# * include/foo/bar/bar.h -> <prefix>/include/NAMESPACE/LIBRARY_NAME/*.h
49-
# * include/foo/bar/bar.h -> <prefix>/include/foo/bar/bar.h
50-
install(
51-
DIRECTORY "${CMAKE_SOURCE_DIR}/include/kami"
52-
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
53-
FILES_MATCHING PATTERN "*"
54-
)
53+
# Headers:
54+
# * include/foo/bar/bar.h -> <prefix>/include/NAMESPACE/LIBRARY_NAME/*.h
55+
# * include/foo/bar/bar.h -> <prefix>/include/foo/bar/bar.h
56+
install(
57+
DIRECTORY "${CMAKE_SOURCE_DIR}/include/kami"
58+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
59+
FILES_MATCHING PATTERN "*"
60+
)
5561

56-
# Export headers:
57-
# The export header will be stored in:
58-
# <prefix>/include/${NAMESPACE}/LIBRARY_NAME/LIBRARY_NAME_export.h
59-
install(
60-
FILES
61-
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/KAMI_EXPORT.h"
62-
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/config.h"
63-
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kami"
64-
)
62+
# Export headers:
63+
# The export header will be stored in:
64+
# <prefix>/include/${NAMESPACE}/LIBRARY_NAME/LIBRARY_NAME_export.h
65+
install(
66+
FILES
67+
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/KAMI_EXPORT.h"
68+
"${CMAKE_CURRENT_BINARY_DIR}/generated_headers/kami/config.h"
69+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kami"
70+
)
6571

66-
add_library(kami::libkami ALIAS libkami)
72+
add_library(kami::libkami ALIAS libkami)

0 commit comments

Comments
 (0)