From a14caf1af8bce5e7a3fb4fedc412853e5ad88fcb Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Tue, 22 Nov 2022 11:32:26 -0600 Subject: Make dynamicflags and staticflags PRIVATE so that they are not propagated to projects that use the generated project. --- templates/cmake.mpd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'templates') 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$<$: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%> -- cgit v1.2.1