From 451b80801666dde96e2207ff5a215cb7bcdb49a9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 20 Aug 2018 16:16:13 +0200 Subject: [PATCH] CMP0050: make Import module aware of cmake policy --- src/Mod/Import/CMakeLists.txt | 51 ++++++++++++++++++++++++++++--- src/Mod/Import/Gui/CMakeLists.txt | 5 --- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/src/Mod/Import/CMakeLists.txt b/src/Mod/Import/CMakeLists.txt index 5b14f33198..2e7713840e 100644 --- a/src/Mod/Import/CMakeLists.txt +++ b/src/Mod/Import/CMakeLists.txt @@ -20,12 +20,55 @@ endif(BUILD_GUI) # Import_rc.py) #ENDIF (BUILD_GUI) +SET(DXF_Plate + DxfPlate/blocks10.rub + DxfPlate/blocks112.rub + DxfPlate/blocks114.rub + DxfPlate/classes14.rub + DxfPlate/entities0.rub + DxfPlate/entities12.rub + DxfPlate/entities14.rub + DxfPlate/header0.rub + DxfPlate/header12.rub + DxfPlate/header14.rub + DxfPlate/objects14.rub + DxfPlate/tables10.rub + DxfPlate/tables112.rub + DxfPlate/tables114.rub + DxfPlate/tables20.rub + DxfPlate/tables212.rub + DxfPlate/tables214.rub +) + +set(Import_Scripts + Init.py + gzip_utf8.py + stepZ.py +) + +if(BUILD_GUI) + list (APPEND Import_Scripts InitGui.py) +endif(BUILD_GUI) + +add_custom_target(ImportScripts ALL + SOURCES ${Import_Scripts} ${DXF_Plate} +) + +fc_target_copy_resource(ImportScripts + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/Import + ${Import_Scripts} +) + +fc_target_copy_resource(ImportScripts + ${CMAKE_SOURCE_DIR}/src/Mod/Import + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Import + ${DXF_Plate} +) + INSTALL( FILES - Init.py - InitGui.py - gzip_utf8.py - stepZ.py + ${Import_Scripts} #${Import_QRC_SRCS} DESTINATION Mod/Import diff --git a/src/Mod/Import/Gui/CMakeLists.txt b/src/Mod/Import/Gui/CMakeLists.txt index 1c135dab16..101c7fae57 100644 --- a/src/Mod/Import/Gui/CMakeLists.txt +++ b/src/Mod/Import/Gui/CMakeLists.txt @@ -40,11 +40,6 @@ add_library(ImportGui SHARED ${ImportGui_SRCS}) target_link_libraries(ImportGui ${ImportGui_LIBS}) -fc_target_copy_resource(ImportGui - ${CMAKE_SOURCE_DIR}/src/Mod/Import - ${CMAKE_BINARY_DIR}/Mod/Import - Init.py InitGui.py gzip_utf8.py stepZ.py) - SET_BIN_DIR(ImportGui ImportGui /Mod/Import) SET_PYTHON_PREFIX_SUFFIX(ImportGui)