summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-10-12 12:09:14 -0500
committerChad Elliott <elliottc@objectcomputing.com>2022-10-12 12:09:14 -0500
commitfbd413bd8c9832a06fe6e99983b9b2aef48e7cd8 (patch)
treeb5d4c4949d97300b838d26d49f016bc6bb5e3ca2 /templates
parent52a01101184c9ae210bce15a3e93b58002eb1135 (diff)
downloadMPC-fbd413bd8c9832a06fe6e99983b9b2aef48e7cd8.tar.gz
Added configurable build configurations and used combined_custom to simplify generated CMakeLists.txt files.
Diffstat (limited to 'templates')
-rw-r--r--templates/cmake.mpd34
-rw-r--r--templates/cmakedll.mpt16
-rw-r--r--templates/cmakeexe.mpt3
3 files changed, 37 insertions, 16 deletions
diff --git a/templates/cmake.mpd b/templates/cmake.mpd
index 6785b199..843a5259 100644
--- a/templates/cmake.mpd
+++ b/templates/cmake.mpd
@@ -20,22 +20,10 @@ find_package(ACE REQUIRED)
<%endif%>
set(SOURCE_FILES <%source_files%>)
<%if(libs || lit_libs || pure_libs)%>
-set(TARGET_LINK_LIBRARIES<%if(libs)%> $<$<CONFIG:Release>:<%libs%>>
- $<$<CONFIG:Debug>:<%foreach(libs)%><%fornotfirst(" ")%><%lib%>d<%endfor%>><%endif%><%if(lit_libs)%> <%lit_libs%><%endif%><%if(pure_libs)%> <%pure_libs%><%endif%>)
-<%endif%>
-<%if(exename)%>
-set(PROJECT_TARGET <%exename%>)
-<%else%>
-<%if(sharedname)%>
-set(PROJECT_TARGET <%sharedname%>)
-<%else%>
-<%if(staticname)%>
-set(PROJECT_TARGET <%staticname%>)
-<%else%>
-set(PROJECT_TARGET <%project_name%>)
-<%endif%>
-<%endif%>
+set(TARGET_LINK_LIBRARIES<%if(libs)%> <%foreach(configurations)%><%fornotfirst(" ")%>$<$<CONFIG:<%configuration%>>:<%foreach(libs)%><%fornotfirst(" ")%><%lib%><%lib_modifier%><%endfor%>><%fornotlast("
+")%><%endfor%><%endif%><%if(lit_libs)%> <%lit_libs%><%endif%><%if(pure_libs)%> <%pure_libs%><%endif%>)
<%endif%>
+set(PROJECT_TARGET <%if(exename)%><%exename%><%else%><%if(sharedname)%><%sharedname%><%else%><%if(staticname)%><%staticname%><%else%><%project_name%><%endif%><%endif%><%endif%>)
<%marker(macros)%>
<%if(libout)%>
@@ -77,11 +65,25 @@ add_compile_definitions(<%macros%>)
<%endif%>
<%if(custom_types)%>
<%foreach(custom_types)%>
-<%if(custom_type->command && custom_type->input_files)%>
+<%if(custom_type->input_files)%>
+<%if(custom_type->command)%>
include(<%custom_type%> OPTIONAL)
<%uc(custom_type)%>_TARGET_SOURCES(${PROJECT_TARGET} PUBLIC <%custom_type->input_files%>
<%uc(custom_type)%>_OPTIONS <%custom_type->commandflags%>)
+<%else%>
+<%foreach(custom_type->input_files)%>
+<%if(forfirst && custom_type->input_file->commands)%>
+include(<%custom_type%> OPTIONAL)
+<%foreach(custom_type->input_files)%>
+<%uc(custom_type)%>_TARGET_SOURCES(
+ ${PROJECT_TARGET} PUBLIC <%custom_type->input_file%>
+<%foreach(custom_type->input_file->commands)%>
+ <%uc(custom_type->input_file->command->type)%>_OPTIONS <%custom_type->input_file->command->flags%><%fornotlast("
+")%><%endfor%><%endfor%>)
+<%endif%>
+<%endfor%>
+<%endif%>
<%endif%>
<%endfor%>
<%endif%>
diff --git a/templates/cmakedll.mpt b/templates/cmakedll.mpt
new file mode 100644
index 00000000..4296daff
--- /dev/null
+++ b/templates/cmakedll.mpt
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+
+configurations = Debug Release
+
+// ***********************************************************************
+// Configuration Section
+// ***********************************************************************
+
+Debug {
+ lib_modifier = d
+}
+
+Release {
+}
+
+conditional_include "user_cmakedll"
diff --git a/templates/cmakeexe.mpt b/templates/cmakeexe.mpt
new file mode 100644
index 00000000..55c1608f
--- /dev/null
+++ b/templates/cmakeexe.mpt
@@ -0,0 +1,3 @@
+// -*- MPC -*-
+conditional_include "cmakedll"
+conditional_include "user_cmakeexe"