File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
34
34
add_dependencies (libjsonnet md5 stdlib )
35
35
target_link_libraries (libjsonnet md5 nlohmann_json::nlohmann_json ryml )
36
36
37
+ # Version extraction logic duplicated in ../cpp/CMakeLists.txt
38
+ # TODO: Put this logic somewhere else.
37
39
file (STRINGS ${CMAKE_CURRENT_SOURCE_DIR} /../include/libjsonnet.h JSONNET_VERSION_DEF
38
40
REGEX "[#]define[ \t ]+LIB_JSONNET_VERSION[ \t ]+" )
39
41
string (REGEX REPLACE ".*\" v([^\" ]+)\" .*" "\\ 1" JSONNET_VERSION ${JSONNET_VERSION_DEF} )
Original file line number Diff line number Diff line change @@ -12,10 +12,17 @@ add_library(libjsonnet++ SHARED ${LIBJSONNETPP_HEADERS} ${LIBJSONNETPP_SOURCE})
12
12
add_dependencies (libjsonnet++ jsonnet )
13
13
target_link_libraries (libjsonnet++ libjsonnet )
14
14
15
+ # Version extraction logic duplicated from ../core/CMakeLists.txt
16
+ # TODO: Put this logic somewhere else.
17
+ file (STRINGS ${CMAKE_CURRENT_SOURCE_DIR} /../include/libjsonnet.h JSONNET_VERSION_DEF
18
+ REGEX "[#]define[ \t ]+LIB_JSONNET_VERSION[ \t ]+" )
19
+ string (REGEX REPLACE ".*\" v([^\" ]+)\" .*" "\\ 1" JSONNET_VERSION ${JSONNET_VERSION_DEF} )
20
+ message ("Extracted Jsonnet version: " ${JSONNET_VERSION} )
21
+
15
22
# CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without
16
23
# this step the output would be |liblibjsonnet|.
17
24
set_target_properties (libjsonnet++ PROPERTIES OUTPUT_NAME jsonnet++
18
- VERSION "0.21.0 "
25
+ VERSION "${JSONNET_VERSION} "
19
26
SOVERSION "0"
20
27
PUBLIC_HEADER "${LIB_HEADER} " )
21
28
install (TARGETS libjsonnet++
You can’t perform that action at this time.
0 commit comments