summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-11-22 11:32:26 -0600
committerChad Elliott <elliottc@objectcomputing.com>2022-11-22 11:32:26 -0600
commita14caf1af8bce5e7a3fb4fedc412853e5ad88fcb (patch)
treedbf815626c56754c169cae6e7356a25306e4c159
parenta486539283aa4001feb244c763f20fcd3631a396 (diff)
downloadMPC-a14caf1af8bce5e7a3fb4fedc412853e5ad88fcb.tar.gz
Make dynamicflags and staticflags PRIVATE so that they are not propagated to projects that use the generated project.
-rw-r--r--templates/cmake.mpd10
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/cmake.mpd b/templates/cmake.mpd
index deee3745..9e39dc43 100644
--- a/templates/cmake.mpd
+++ b/templates/cmake.mpd
@@ -88,7 +88,7 @@ add_executable(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_
target_link_libraries(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${TARGET_LINK_LIBRARIES_<%uc(normalize(project_name))%>})
<%if(staticflags)%>
if(NOT BUILD_SHARED_LIBS)
- target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>)
+ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%staticflags%>)
set_property(TARGET ${PROJECT_TARGET_<%uc(normalize(project_name))%>} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
@@ -98,16 +98,16 @@ endif()
add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>})
<%if(dynamicflags)%>
if(BUILD_SHARED_LIBS)
- target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%dynamicflags%>)
+ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%dynamicflags%>)
<%if(staticflags)%>
else()
- target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>)
+ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%staticflags%>)
<%endif%>
endif()
<%else%>
<%if(staticflags)%>
if(NOT BUILD_SHARED_LIBS)
- target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>)
+ target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%staticflags%>)
endif()
<%endif%>
<%endif%>
@@ -116,7 +116,7 @@ target_link_libraries(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${TARGET
<%if(staticname)%>
add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>})
<%if(staticflags)%>
-target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>)
+target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIVATE <%staticflags%>)
<%endif%>
<%endif%>
<%endif%>