summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-10-11 09:31:43 -0500
committerChad Elliott <elliottc@objectcomputing.com>2022-10-11 09:31:43 -0500
commitb3dbad5d84d83bcf809e7aba458627b6014d6d71 (patch)
tree6a2afed7bc1eb02aa19db05d73501c289c9f47b7 /templates
parente6d869bed6cacb8efae257d265bb7b97f169d8a5 (diff)
downloadMPC-b3dbad5d84d83bcf809e7aba458627b6014d6d71.tar.gz
Added dynamicflags, staticflags, libpaths, and macros. Corrected basic support for custom types.
Diffstat (limited to 'templates')
-rw-r--r--templates/cmake.mpd25
1 files changed, 23 insertions, 2 deletions
diff --git a/templates/cmake.mpd b/templates/cmake.mpd
index 94666a3f..ed263236 100644
--- a/templates/cmake.mpd
+++ b/templates/cmake.mpd
@@ -35,16 +35,28 @@ set(PROJECT_TARGET <%staticname%>)
<%endif%>
<%marker(macros)%>
+<%if(libout)%>
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY <%env_libout%>)
+<%endif%>
+<%if(dllout || libout)%>
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY <%if(dllout)%><%env_dllout%><%else%><%env_libout%><%endif%>)
+<%endif%>
+<%if(exeout)%>
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY <%env_exeout%>)
+<%endif%>
+
<%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})
+add_compile_definitions(<%dynamicflags%>)
target_link_libraries(${PROJECT_TARGET} ${TARGET_LINK_LIBRARIES})
<%else%>
<%if(staticname)%>
add_library(${PROJECT_TARGET} ${SOURCE_FILES})
+add_compile_definitions(<%staticflags%>)
<%endif%>
<%endif%>
<%endif%>
@@ -53,11 +65,20 @@ add_library(${PROJECT_TARGET} ${SOURCE_FILES})
target_include_directories(${PROJECT_TARGET} PUBLIC <%env_includes%>)
<%endif%>
+<%if(libpaths)%>
+target_link_directories(${PROJECT_TARGET} PUBLIC <%env_libpaths%>)
+
+<%endif%>
+<%if(macros)%>
+add_compile_definitions(<%macros%>)
+<%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%>)
+
+include(<%custom_type%> OPTIONAL)
+<%uc(custom_type)%>_TARGET_SOURCES(${PROJECT_TARGET} PUBLIC <%custom_type->input_files%>
+ <%uc(custom_type)%>_OPTIONS <%custom_type->commandflags%>)
<%endif%>
<%endfor%>
<%endif%>