summaryrefslogtreecommitdiff
path: root/Modules/FindMatlab.cmake
diff options
context:
space:
mode:
authorscivision <scivision@users.noreply.github.com>2023-03-04 23:53:12 -0500
committerscivision <scivision@users.noreply.github.com>2023-03-07 15:34:36 -0500
commit1932ae0284d6eac4b3237d43db772b91e052a379 (patch)
treec6093dc205fa0d72cc27e0f2a1769595d7f76cf7 /Modules/FindMatlab.cmake
parentc4cacdc7eb77592910e9327dd8d7bd905e8e285d (diff)
downloadcmake-1932ae0284d6eac4b3237d43db772b91e052a379.tar.gz
FindMatlab: refactor: use string(APPEND
Diffstat (limited to 'Modules/FindMatlab.cmake')
-rw-r--r--Modules/FindMatlab.cmake15
1 files changed, 7 insertions, 8 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index c2ac29b456..cbf0445631 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -1191,18 +1191,17 @@ function(matlab_add_mex)
if (MSVC)
- set(_link_flags "${_link_flags} /EXPORT:mexFunction")
+ string(APPEND _link_flags " /EXPORT:mexFunction")
if(NOT Matlab_VERSION_STRING VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, export version
- set(_link_flags "${_link_flags} /EXPORT:mexfilerequiredapiversion")
+ string(APPEND _link_flags " /EXPORT:mexfilerequiredapiversion")
endif()
set_property(TARGET ${${prefix}_NAME} APPEND PROPERTY LINK_FLAGS ${_link_flags})
endif() # No other compiler currently supported on Windows.
- set_target_properties(${${prefix}_NAME}
- PROPERTIES
- DEFINE_SYMBOL "DLL_EXPORT_SYM=__declspec(dllexport)")
+ set_property(TARGET ${${prefix}_NAME} PROPERTY
+ DEFINE_SYMBOL "DLL_EXPORT_SYM=__declspec(dllexport)")
else()
@@ -1228,7 +1227,7 @@ function(matlab_add_mex)
if(Matlab_HAS_CPP_API)
list(APPEND _ver_map_files ${Matlab_EXTERN_LIBRARY_DIR}/cppMexFunction.map) # This one doesn't exist on Linux
- set(_link_flags "${_link_flags} -Wl,-U,_mexCreateMexFunction -Wl,-U,_mexDestroyMexFunction -Wl,-U,_mexFunctionAdapter")
+ string(APPEND _link_flags " -Wl,-U,_mexCreateMexFunction -Wl,-U,_mexDestroyMexFunction -Wl,-U,_mexFunctionAdapter")
# On MacOS, the MEX command adds the above, without it the link breaks
# because we indiscriminately use "cppMexFunction.map" even for C API MEX-files.
endif()
@@ -1243,14 +1242,14 @@ function(matlab_add_mex)
target_compile_options(${${prefix}_NAME} PRIVATE "-pthread")
endif()
- set(_link_flags "${_link_flags} -Wl,--as-needed")
+ string(APPEND _link_flags " -Wl,--as-needed")
set(_export_flag_name --version-script)
endif()
foreach(_file IN LISTS _ver_map_files)
- set(_link_flags "${_link_flags} -Wl,${_export_flag_name},${_file}")
+ string(APPEND _link_flags " -Wl,${_export_flag_name},${_file}")
endforeach()
# The `mex` command doesn't add this define. It is specified here in order