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)%>
44project(<%project_name%> <%language%>)
@@ -79,12 +79,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_libout%>)
7979<%endif%>
8080<%endif%>
8181
82+ <%if(exename || sharedname || staticname)%>
8283<%if(compile_flags)%>
8384target_compile_options(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%compile_flags%>)
8485
8586<%endif%>
8687<%if(exename)%>
87- add_executable(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>})
88+ add_executable(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>} ${HEADER_FILES_<%uc(normalize(project_name))%>} )
8889target_link_libraries(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${TARGET_LINK_LIBRARIES_<%uc(normalize(project_name))%>})
8990<%if(staticflags)%>
9091if(NOT BUILD_SHARED_LIBS)
@@ -95,7 +96,7 @@ endif()
9596<%endif%>
9697<%else%>
9798<%if(sharedname)%>
98- add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>})
99+ add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>} ${HEADER_FILES_<%uc(normalize(project_name))%>} )
99100<%if(dynamicflags)%>
100101if(BUILD_SHARED_LIBS)
101102 target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%dynamicflags%>)
@@ -114,7 +115,7 @@ endif()
114115target_link_libraries(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${TARGET_LINK_LIBRARIES_<%uc(normalize(project_name))%>})
115116<%else%>
116117<%if(staticname)%>
117- add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>})
118+ add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>} ${HEADER_FILES_<%uc(normalize(project_name))%>} )
118119<%if(staticflags)%>
119120target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%staticflags%>)
120121<%endif%>
@@ -152,6 +153,7 @@ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUB
152153<%if(macros)%>
153154target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%macros%>)
154155
156+ <%endif%>
155157<%endif%>
156158<%if(custom_types)%>
157159<%foreach(custom_types)%>
@@ -161,7 +163,7 @@ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUB
161163include(<%custom_type%> OPTIONAL)
162164<%foreach(custom_type->input_files)%>
163165<%uc(custom_type)%>_TARGET_SOURCES(
164- ${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%custom_type->input_file%>
166+ ${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%custom_type->input_file%>
165167 <%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%>)
166168
167169<%endfor%>
@@ -172,7 +174,7 @@ include(<%custom_type%> OPTIONAL)
172174include(<%custom_type%> OPTIONAL)
173175<%endif%>
174176<%uc(custom_type)%>_TARGET_SOURCES(
175- ${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%custom_type->input_file%>
177+ ${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%custom_type->input_file%>
176178<%foreach(custom_type->input_file->commands)%>
177179 <%uc(custom_type->input_file->command->type)%>_OPTIONS <%custom_type->input_file->command->flags%><%fornotlast("\n")%><%endfor%>)
178180
0 commit comments