Skip to content

Commit dfc892d

Browse files
committed
Generate CMake object library targets for IDL
1 parent 2ba2603 commit dfc892d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

modules/CMakeWorkspaceCreator.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use vars qw(@ISA);
2323
# Data Section
2424
# ************************************************************
2525

26-
my $version = '3.12.0';
26+
my $version = '3.20.0';
2727

2828
# ************************************************************
2929
# Subroutine Section

templates/cmake.mpd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION <%cmake_minimum_required(3.12.0)%>)
1+
cmake_minimum_required(VERSION <%cmake_minimum_required(3.20.0)%>)
22

33
<%marker(top)%>
44
project(<%project_name%> <%language%>)
@@ -118,6 +118,10 @@ add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%u
118118
<%if(staticflags)%>
119119
target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%staticflags%>)
120120
<%endif%>
121+
<%else%>
122+
<%if(custom_types)%>
123+
add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} OBJECT)
124+
<%endif%>
121125
<%endif%>
122126
<%endif%>
123127
<%if(use_lib_modifier)%>
@@ -161,7 +165,7 @@ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUB
161165
include(<%custom_type%> OPTIONAL)
162166
<%foreach(custom_type->input_files)%>
163167
<%uc(custom_type)%>_TARGET_SOURCES(
164-
${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%custom_type->input_file%>
168+
${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%custom_type->input_file%>
165169
<%uc(custom_type)%>_OPTIONS <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%><%if(custom_type->output_option)%> <%custom_type->output_option%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endif%>)
166170

167171
<%endfor%>
@@ -172,7 +176,7 @@ include(<%custom_type%> OPTIONAL)
172176
include(<%custom_type%> OPTIONAL)
173177
<%endif%>
174178
<%uc(custom_type)%>_TARGET_SOURCES(
175-
${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%custom_type->input_file%>
179+
${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%custom_type->input_file%>
176180
<%foreach(custom_type->input_file->commands)%>
177181
<%uc(custom_type->input_file->command->type)%>_OPTIONS <%custom_type->input_file->command->flags%><%fornotlast("\n")%><%endfor%>)
178182

0 commit comments

Comments
 (0)