From a69870a93a1c9c705bf6e1c1d8d434bf1a417333 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Fri, 14 Oct 2022 13:19:22 -0500 Subject: Added a pre_find_target template variable and usage of compile_options. Also, added output_option to custom_commands. --- templates/cmake.mpd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/cmake.mpd b/templates/cmake.mpd index 7777e298..33936e76 100644 --- a/templates/cmake.mpd +++ b/templates/cmake.mpd @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION <%cmake_minimum_required(3.12.0)%>) <%marker(top)%> project(<%project_name%> <%language%>) +<%if(pre_find_package)%> +<%pre_find_package%> +<%endif%> <%if(contains(env_includes, DDS_ROOT))%> find_package(OpenDDS REQUIRED) @@ -36,6 +39,10 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY <%if(dllout)%><%env_dllout%><%else%><%env_lib set(CMAKE_RUNTIME_OUTPUT_DIRECTORY <%env_exeout%>) <%endif%> +<%if(compile_flags)%> +add_compile_options(<%compile_flags%>) + +<%endif%> <%if(exename)%> add_executable(${PROJECT_TARGET} ${SOURCE_FILES}) target_link_libraries(${PROJECT_TARGET} ${TARGET_LINK_LIBRARIES}) @@ -62,6 +69,7 @@ target_link_directories(${PROJECT_TARGET} PUBLIC <%env_libpaths%>) <%endif%> <%if(macros)%> add_compile_definitions(<%macros%>) + <%endif%> <%if(custom_types)%> <%foreach(custom_types)%> @@ -72,7 +80,7 @@ include(<%custom_type%> OPTIONAL) <%foreach(custom_type->input_files)%> <%uc(custom_type)%>_TARGET_SOURCES( ${PROJECT_TARGET} PUBLIC <%custom_type->input_file%> - <%uc(custom_type)%>_OPTIONS <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%>) + <%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%>) <%endfor%> <%else%> -- cgit v1.2.1