summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-10-10 13:22:25 -0500
committerChad Elliott <elliottc@objectcomputing.com>2022-10-10 13:22:25 -0500
commite6d869bed6cacb8efae257d265bb7b97f169d8a5 (patch)
tree5b8ee75794aefd89b741cfe1310fdf5259d0f8b1 /templates
parent44cc597f29aea73d9806324dae77fa2c5a71cb2a (diff)
downloadMPC-e6d869bed6cacb8efae257d265bb7b97f169d8a5.tar.gz
Initial commit of experimental support of CMake.
Diffstat (limited to 'templates')
-rw-r--r--templates/cmake.mpd66
1 files changed, 66 insertions, 0 deletions
diff --git a/templates/cmake.mpd b/templates/cmake.mpd
new file mode 100644
index 00000000..94666a3f
--- /dev/null
+++ b/templates/cmake.mpd
@@ -0,0 +1,66 @@
+cmake_minimum_required(VERSION <%cmake_minimum_required(3.3.0)%>)
+
+<%marker(top)%>
+project(<%project_name%> <%language%>)
+
+<%if(contains(includes, DDS_ROOT))%>
+find_package(OpenDDS REQUIRED)
+
+<%else%>
+<%if(contains(includes, TAO_ROOT))%>
+find_package(TAO REQUIRED)
+
+<%else%>
+<%if(contains(includes, ACE_ROOT))%>
+find_package(ACE REQUIRED)
+
+<%else%>
+<%endif%>
+<%endif%>
+<%endif%>
+set(SOURCE_FILES <%non_generated_sources%>)
+<%if(libs || lit_libs || pure_libs)%>
+set(TARGET_LINK_LIBRARIES<%if(libs)%> <%libs%><%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%>)
+<%endif%>
+<%endif%>
+<%endif%>
+<%marker(macros)%>
+
+<%if(exename)%>
+add_executable(${PROJECT_TARGET} ${SOURCE_FILES})
+target_link_libraries(${PROJECT_TARGET} ${TARGET_LINK_LIBRARIES})
+<%else%>
+<%if(sharedname)%>
+add_library(${PROJECT_TARGET} SHARED ${SOURCE_FILES})
+target_link_libraries(${PROJECT_TARGET} ${TARGET_LINK_LIBRARIES})
+<%else%>
+<%if(staticname)%>
+add_library(${PROJECT_TARGET} ${SOURCE_FILES})
+<%endif%>
+<%endif%>
+<%endif%>
+
+<%if(includes)%>
+target_include_directories(${PROJECT_TARGET} PUBLIC <%env_includes%>)
+
+<%endif%>
+<%if(custom_types)%>
+<%foreach(custom_types)%>
+<%if(custom_type->command && custom_type->input_files)%>
+include(<%custom_type%>.cmake OPTIONAL)
+<%uc(custom_type)%>_TARGET_SOURCES(${PROJECT_TARGET} PUBLIC <%custom_type->input_files%>)
+<%endif%>
+<%endfor%>
+<%endif%>
+
+<%marker(local)%>
+<%marker(bottom)%>