Selaa lähdekoodia

Update ctkMacroBuildQtPlugin to fix CMake warning related to CMP0026

This commit fixes the warnings like the following:

// ----------------------
1>-- Configuring Loadable module: Transforms [qSlicerTransformsModuleExport.h]
1>CMake Warning (dev) at C:/D/P/SonoEQ-0-build/Slicer-build/CTK/CMake/ctkMacroBuildQtPlugin.cmake:168 (get_target_property):
1>  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
1>  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
1>  command to set the policy and suppress this warning.
1>  The LOCATION property should not be read from target
1>  "qSlicerAnnotationsModuleWidgetsPlugins".  Use the target name directly
1>  with add_custom_command, or use the generator expression $<TARGET_FILE>, as
1>  appropriate.
1>Call Stack (most recent call first):
1>  C:/D/P/SonoEQ-0-build/Slicer-build/CTK/CMake/ctkMacroBuildQtPlugin.cmake:181 (ctkMacroBuildQtPlugin)
1>  Modules/Loadable/Annotations/Widgets/DesignerPlugins/CMakeLists.txt:36 (ctkMacroBuildQtDesignerPlugin)
// ----------------------
Jean-Christophe Fillion-Robin 10 vuotta sitten
vanhempi
commit
d779b43a38
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 2
      CMake/ctkMacroBuildQtPlugin.cmake

+ 1 - 2
CMake/ctkMacroBuildQtPlugin.cmake

@@ -165,13 +165,12 @@ macro(ctkMacroBuildQtPlugin)
   # subdirectory (e.g. 'designer') but not deeper (e.g. designer/Debug), let's copy them.
 
   if(NOT CMAKE_CFG_INTDIR STREQUAL ".")
-    get_target_property(FILE_PATH ${lib_name} LOCATION)
     get_target_property(DIR_PATH ${lib_name} LIBRARY_OUTPUT_DIRECTORY)
 
     add_custom_command(
       TARGET ${lib_name}
       POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E copy ${FILE_PATH} ${DIR_PATH}/../${MY_PLUGIN_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${lib_name}${CMAKE_BUILD_TYPE}${CMAKE_SHARED_LIBRARY_SUFFIX}
+      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE> ${DIR_PATH}/../${MY_PLUGIN_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${lib_name}${CMAKE_BUILD_TYPE}${CMAKE_SHARED_LIBRARY_SUFFIX}
       )
   endif()