summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-10-14 13:19:22 -0500
committerChad Elliott <elliottc@objectcomputing.com>2022-10-14 13:19:22 -0500
commita69870a93a1c9c705bf6e1c1d8d434bf1a417333 (patch)
tree2b9956d92ce0c933a9bb1242e5872a78d18562ed
parenta106fb89d99beb7a3fd159078b9bf05693326509 (diff)
downloadMPC-a69870a93a1c9c705bf6e1c1d8d434bf1a417333.tar.gz
Added a pre_find_target template variable and usage of compile_options. Also, added output_option to custom_commands.
-rw-r--r--templates/cmake.mpd10
1 files changed, 9 insertions, 1 deletions
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%>