diff options
author | Chad Elliott <elliottc@objectcomputing.com> | 2022-11-09 06:48:51 -0600 |
---|---|---|
committer | Chad Elliott <elliottc@objectcomputing.com> | 2022-11-09 06:48:51 -0600 |
commit | 38aa62978ad2ec23a949ff9a204fb796fbb0e07d (patch) | |
tree | cd7beee22182d1a21d5bfd7eecb80648b8fe83a1 /templates | |
parent | a2195d28ad1db548c1c62a45a0718b8ca0e9b326 (diff) | |
download | MPC-38aa62978ad2ec23a949ff9a204fb796fbb0e07d.tar.gz |
Use the workspace name in the workspace CMakeLists.txt and repaced all add_compile_* calls with target_compile_*.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/cmake.mpd | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/cmake.mpd b/templates/cmake.mpd index f5fa46e8..18d702b2 100644 --- a/templates/cmake.mpd +++ b/templates/cmake.mpd @@ -61,7 +61,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_libout%>) <%endif%> <%if(compile_flags)%> -add_compile_options(<%compile_flags%>) +target_compile_options(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%compile_flags%>) <%endif%> <%if(exename)%> @@ -69,7 +69,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) - add_compile_definitions(<%staticflags%>) + target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>) set_property(TARGET ${PROJECT_TARGET_<%uc(normalize(project_name))%>} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") endif() @@ -79,16 +79,16 @@ endif() add_library(${PROJECT_TARGET_<%uc(normalize(project_name))%>} ${SOURCE_FILES_<%uc(normalize(project_name))%>}) <%if(dynamicflags)%> if(BUILD_SHARED_LIBS) - add_compile_definitions(<%dynamicflags%>) + target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%dynamicflags%>) <%if(staticflags)%> else() - add_compile_definitions(<%staticflags%>) + target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>) <%endif%> endif() <%else%> <%if(staticflags)%> if(NOT BUILD_SHARED_LIBS) - add_compile_definitions(<%staticflags%>) + target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>) endif() <%endif%> <%endif%> @@ -97,7 +97,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)%> -add_compile_definitions(<%staticflags%>) +target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%staticflags%>) <%endif%> <%endif%> <%endif%> @@ -123,10 +123,10 @@ target_precompile_headers(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PRIV <%endif%> <%if(pch_source)%> -add_compile_definitions(<%pch_defines%>) +target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%pch_defines%>) <%endif%> <%if(macros)%> -add_compile_definitions(<%macros%>) +target_compile_definitions(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC<%macros%>) <%endif%> <%if(custom_types)%> |