From 358af8b51806bbd45b32e9ce9d638c01aba0f11c Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 20 Aug 2018 16:34:54 +0200 Subject: [PATCH] CMP0050: make Points module aware of cmake policy --- src/Mod/Points/App/CMakeLists.txt | 12 ++++++++---- src/Mod/Points/CMakeLists.txt | 11 +++++++++-- src/Mod/Points/Gui/CMakeLists.txt | 30 +++++++++++++++++------------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/Mod/Points/App/CMakeLists.txt b/src/Mod/Points/App/CMakeLists.txt index adec068f43..be40884dfb 100644 --- a/src/Mod/Points/App/CMakeLists.txt +++ b/src/Mod/Points/App/CMakeLists.txt @@ -54,15 +54,19 @@ SET(Points_SRCS Structured.h ) -add_library(Points SHARED ${Points_SRCS}) +set(Points_Scripts + ../Init.py +) + +add_library(Points SHARED ${Points_SRCS} ${Points_Scripts}) target_link_libraries(Points ${Points_LIBS}) -fc_target_copy_resource(Points - ${CMAKE_SOURCE_DIR}/src/Mod/Points +fc_target_copy_resource_flat(Points + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/Mod/Points - Init.py) + ${Points_Scripts}) SET_BIN_DIR(Points Points /Mod/Points) SET_PYTHON_PREFIX_SUFFIX(Points) diff --git a/src/Mod/Points/CMakeLists.txt b/src/Mod/Points/CMakeLists.txt index 4b1d1edcd3..a1e872e02b 100644 --- a/src/Mod/Points/CMakeLists.txt +++ b/src/Mod/Points/CMakeLists.txt @@ -4,10 +4,17 @@ if(BUILD_GUI) add_subdirectory(Gui) endif(BUILD_GUI) +set(Points_Scripts + Init.py +) + +if(BUILD_GUI) + list (APPEND Points_Scripts InitGui.py) +endif(BUILD_GUI) + INSTALL( FILES - Init.py - InitGui.py + ${Points_Scripts} DESTINATION Mod/Points ) diff --git a/src/Mod/Points/Gui/CMakeLists.txt b/src/Mod/Points/Gui/CMakeLists.txt index 2a9a3fcee2..8d37fc2129 100644 --- a/src/Mod/Points/Gui/CMakeLists.txt +++ b/src/Mod/Points/Gui/CMakeLists.txt @@ -62,24 +62,28 @@ SET(PointsGui_SRCS Workbench.h ) -add_library(PointsGui SHARED ${PointsGui_SRCS}) -target_link_libraries(PointsGui ${PointsGui_LIBS}) - - -fc_target_copy_resource(PointsGui - ${CMAKE_SOURCE_DIR}/src/Mod/Points - ${CMAKE_BINARY_DIR}/Mod/Points - InitGui.py) - -SET_BIN_DIR(PointsGui PointsGui /Mod/Points) -SET_PYTHON_PREFIX_SUFFIX(PointsGui) - -INSTALL(TARGETS PointsGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) +set(PointsGui_Scripts + ../InitGui.py +) SET(PointsGuiIcon_SVG Resources/icons/PointsWorkbench.svg ) +add_library(PointsGui SHARED ${PointsGui_SRCS} ${PointsGui_Scripts} ${PointsGuiIcon_SVG}) +target_link_libraries(PointsGui ${PointsGui_LIBS}) + + +fc_target_copy_resource_flat(PointsGui + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/Points + ${PointsGui_Scripts}) + +SET_BIN_DIR(PointsGui PointsGui /Mod/Points) +SET_PYTHON_PREFIX_SUFFIX(PointsGui) + fc_copy_sources(PointsGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Points" ${PointsGuiIcon_SVG}) +INSTALL(TARGETS PointsGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) + INSTALL(FILES ${PointsGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Points/Resources/icons")