Skip to content

Commit de4e201

Browse files
committedJul 14, 2021
Make Spicy version available to subprojects.
1 parent 14eaee2 commit de4e201

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed
 

‎CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ endif ()
167167
# Set up testing infrastructure.
168168
enable_testing()
169169

170+
# Compute project version.
171+
execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/autogen-version --cmake --git-root ${CMAKE_CURRENT_SOURCE_DIR} --store ${CMAKE_SOURCE_DIR}/VERSION
172+
OUTPUT_VARIABLE SPICY_VERSION
173+
OUTPUT_STRIP_TRAILING_WHITESPACE)
174+
set(CMAKE_PROJECT_VERSION ${SPICY_VERSION})
175+
170176
# Add subdirectories.
171177
add_subdirectory(hilti)
172178
add_subdirectory(spicy)
@@ -185,12 +191,6 @@ endif ()
185191

186192
add_subdirectory(3rdparty)
187193

188-
# Compute project version.
189-
execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/autogen-version --cmake --git-root ${CMAKE_CURRENT_SOURCE_DIR} --store ${CMAKE_SOURCE_DIR}/VERSION
190-
OUTPUT_VARIABLE SPICY_VERSION
191-
OUTPUT_STRIP_TRAILING_WHITESPACE)
192-
set(CMAKE_PROJECT_VERSION ${SPICY_VERSION})
193-
194194
## Print build summary
195195
string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType)
196196

‎zeek/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ set(SPICY_CONFIG "${CMAKE_BINARY_DIR}/bin/spicy-config" CACHE FILEPATH "")
1010
set(ZEEK_CONFIG "${ZEEK_CONFIG}" CACHE FILEPATH "")
1111
set(ZEEK_ROOT_DIR "${ZEEK_ROOT_DIR}" CACHE FILEPATH "")
1212

13+
# Hand numerical version number down to subprojects.
14+
#
15+
# TODO: This is temporary, this code will be removed once the submodules get removed.
16+
string(REGEX MATCH "([0-9]*)\.([0-9]*)\.([0-9]*).*" _ ${CMAKE_PROJECT_VERSION})
17+
math(EXPR SPICY_VERSION_NUMBER "${CMAKE_MATCH_1} * 10000 + ${CMAKE_MATCH_2} * 100 + ${CMAKE_MATCH_3}")
18+
1319
add_subdirectory(spicy-plugin)
1420
add_subdirectory(spicy-analyzers EXCLUDE_FROM_ALL)
1521

‎zeek/spicy-plugin

0 commit comments

Comments
 (0)
Please sign in to comment.