Skip to content

Commit

Permalink
Merge pull request cyclus#589 from cyclus/version-management
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke authored Mar 21, 2024
2 parents 3b60186 + 580504c commit 945211c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cycamore Change Log
* Updated build procedure to use newer versions of packages in 2023 (#549)
* Added active/dormant and request size variation from buy policy to Storage (#546, #568, #586, #587)
* Update build procedure to force a rebuild when a test file is changed (#584)
* Define the version number in `CMakeLists.txt` and rely on CMake to propagate the version throughout the code (#589)

v1.5.5
====================
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
#taken from http://geant4.cern.ch/support/source/geant4/CMakeLists.txt
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(STATUS "Cycamore requires an out-of-source build.")
Expand All @@ -11,7 +11,7 @@ IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
ENDIF()

# This project name is cycamore.
PROJECT(CYCAMORE)
PROJECT(CYCAMORE VERSION 1.5.5)

# check for and enable c++11 support (required for cyclus)
INCLUDE(CheckCXXCompilerFlag)
Expand Down Expand Up @@ -344,9 +344,9 @@ IF(NOT CYCLUS_DOC_ONLY)
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.rst")

# Version
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_PROJECT_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_PROJECT_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_PROJECT_VERSION_PATCH}")

# Dependencies
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "cyclus (>= 1.4.0)")
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG make_cores=2
COPY . /cycamore
WORKDIR /cycamore

RUN python install.py -j ${make_cores} --build-type=Release --core-version 999999.999999
RUN python install.py -j ${make_cores} --build-type=Release

FROM cycamore as cycamore-test
RUN cycamore_unit_tests
Expand Down
5 changes: 0 additions & 5 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ def install_cyclus(args):
]
if args.build_type:
cmake_cmd += ['-DCMAKE_BUILD_TYPE=' + args.build_type]
if args.core_version:
cmake_cmd += ['-DCORE_VERSION=' + args.core_version]
if args.D is not None:
cmake_cmd += ['-D' + x for x in args.D]
if args.cmake_debug:
Expand Down Expand Up @@ -188,9 +186,6 @@ def main():
build_type = "the CMAKE_BUILD_TYPE"
parser.add_argument('--build-type', '--build_type', help=build_type)

parser.add_argument('--core-version', dest='core_version', default=None,
help='Sets the core version number.')

parser.add_argument('-D', metavar='VAR', action='append',
help='Set enviornment variable(s).')
parser.add_argument('--cmake-debug', action='store_true', default=False,
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ------------------- Add all Concrete Agents ----------------------------

EXECUTE_PROCESS(COMMAND git describe --tags OUTPUT_VARIABLE cycamore_version OUTPUT_STRIP_TRAILING_WHITESPACE)
CONFIGURE_FILE(cycamore_version.h.in "${CMAKE_CURRENT_SOURCE_DIR}/cycamore_version.h" @ONLY)

SET(CYCLUS_CUSTOM_HEADERS "cycamore_version.h")
Expand Down
8 changes: 4 additions & 4 deletions src/cycamore_version.h.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef CYCAMORE_SRC_VERSION_H_
#define CYCAMORE_SRC_VERSION_H_

#define CYCAMORE_VERSION_MAJOR 1
#define CYCAMORE_VERSION_MINOR 5
#define CYCAMORE_VERSION_MICRO 5
#define CYCAMORE_VERSION "@cycamore_version@"
#define CYCAMORE_VERSION_MAJOR @CMAKE_PROJECT_VERSION_MAJOR@
#define CYCAMORE_VERSION_MINOR @CMAKE_PROJECT_VERSION_MINOR@
#define CYCAMORE_VERSION_MICRO @CMAKE_PROJECT_VERSION_PATCH@
#define CYCAMORE_VERSION "@CMAKE_PROJECT_VERSION@"

#endif // CYCAMORE_SRC_VERSION_H_

0 comments on commit 945211c

Please sign in to comment.