Skip to content

Commit e2dbd2d

Browse files
authored
Merge pull request #749 from elbeno/string-output-targets
✨ Add target for string collateral
2 parents 3a6da7f + c313ed0 commit e2dbd2d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cmake/string_catalog.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function(gen_str_catalog)
1010
VERSION
1111
GUID_ID
1212
GUID_MASK
13-
MODULE_ID_MAX)
13+
MODULE_ID_MAX
14+
OUTPUTS_TARGET)
1415
set(multiValueArgs INPUT_JSON INPUT_LIBS INPUT_HEADERS STABLE_JSON)
1516
cmake_parse_arguments(SC "${options}" "${oneValueArgs}" "${multiValueArgs}"
1617
${ARGN})
@@ -87,4 +88,9 @@ function(gen_str_catalog)
8788
add_library(${SC_OUTPUT_LIB} STATIC ${SC_OUTPUT_CPP})
8889
target_link_libraries(${SC_OUTPUT_LIB} PUBLIC cib)
8990
endif()
91+
if(SC_OUTPUTS_TARGET)
92+
add_custom_target(
93+
${SC_OUTPUTS_TARGET} DEPENDS ${SC_OUTPUT_CPP} ${SC_OUTPUT_XML}
94+
${SC_OUTPUT_JSON})
95+
endif()
9096
endfunction()

test/log/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ gen_str_catalog(
3838
GUID_ID
3939
"01234567-89ab-cdef-0123-456789abcdef"
4040
GUID_MASK
41-
"ffffffff-ffff-ffff-ffff-ffffffffffff")
41+
"ffffffff-ffff-ffff-ffff-ffffffffffff"
42+
OUTPUTS_TARGET
43+
test_catalog_json)
4244

4345
add_library(catalog_strings STATIC ${CMAKE_CURRENT_BINARY_DIR}/strings.cpp)
4446
target_link_libraries(catalog_strings PUBLIC cib)

0 commit comments

Comments
 (0)