summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-10-18 10:09:40 -0500
committerChad Elliott <elliottc@objectcomputing.com>2022-10-18 10:09:40 -0500
commit52bfb94882530b4313d4a9341148bd1f7c1b6531 (patch)
treebeb7020eeee1d700df428263357d63155d915ed5 /templates
parentc27c961c628ee343b1279e925f73ac0f8d0d6751 (diff)
downloadMPC-52bfb94882530b4313d4a9341148bd1f7c1b6531.tar.gz
Added settings to make CMake build things in the default style of MPC.
Diffstat (limited to 'templates')
-rw-r--r--templates/cmake.mpd42
-rw-r--r--templates/cmakedll.mpt2
2 files changed, 40 insertions, 4 deletions
diff --git a/templates/cmake.mpd b/templates/cmake.mpd
index 8700206d..90a8b0a6 100644
--- a/templates/cmake.mpd
+++ b/templates/cmake.mpd
@@ -29,14 +29,41 @@ set(TARGET_LINK_LIBRARIES<%if(libs)%> <%foreach(configurations)%><%fornotfirst("
set(PROJECT_TARGET <%if(exename)%><%exename%><%else%><%if(sharedname)%><%sharedname%><%else%><%if(staticname)%><%staticname%><%else%><%project_name%><%endif%><%endif%><%endif%>)
<%marker(macros)%>
+<%if(exeout)%>
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY <%env_exeout%>)
+<%if(use_lib_modifier)%>
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG <%env_exeout%>)
+<%endif%>
+<%else%>
<%if(libout)%>
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY <%env_libout%>)
+<%if(use_lib_modifier)%>
+<%foreach(configurations)%>
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_libout%>)
+<%endfor%>
+<%endif%>
+<%endif%>
+<%if(dllout)%>
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY <%env_dllout%>)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY <%env_dllout%>)
+<%if(use_lib_modifier)%>
+<%foreach(configurations)%>
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_dllout%>)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_dllout%>)
+<%endfor%>
+<%endif%>
+<%else%>
+<%if(libout)%>
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY <%env_libout%>)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY <%env_libout%>)
+<%if(use_lib_modifier)%>
+<%foreach(configurations)%>
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_libout%>)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_libout%>)
+<%endfor%>
+<%endif%>
<%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(compile_flags)%>
@@ -57,6 +84,13 @@ add_library(${PROJECT_TARGET} ${SOURCE_FILES})
add_compile_definitions(<%staticflags%>)
<%endif%>
<%endif%>
+<%if(use_lib_modifier)%>
+<%foreach(configurations)%>
+<%if(lib_modifier)%>
+set_target_properties(${PROJECT_TARGET} PROPERTIES <%uc(configuration)%>_POSTFIX "<%lib_modifier%>")
+<%endif%>
+<%endfor%>
+<%endif%>
<%endif%>
<%if(includes)%>
diff --git a/templates/cmakedll.mpt b/templates/cmakedll.mpt
index 4296daff..4b83cf64 100644
--- a/templates/cmakedll.mpt
+++ b/templates/cmakedll.mpt
@@ -1,5 +1,7 @@
// -*- MPC -*-
+conditional_include "common"
+
configurations = Debug Release
// ***********************************************************************