Files
create/src/Mod/Draft/CMakeLists.txt
wmayer 8088aa159f CMake 2.8.12 and lower allowed the SOURCE signature in add_custom_command
In CMake 3.0 the policy CMP0050 was introduced where it could be set to OLD to keep this behaviour while for NEW an error was raised.
Since CMake 3.5.2 a warning comes up when using the OLD behaviour and that it will be removed in a future version.

In FreeCAD we switched to the new behaviour now and removed the SOURCE signature from add_custom_command which affects the macros
fc_copy_sources, fc_target_copy_resource and fc_target_copy_resource_flat and their usage.
It's not possible any more to add files to a target by using the macros. Now a file must be added to the target before using the macros.

This commit fixes it for Arch, Draft, OpenSCAD, Material, Plot and Ship
2018-08-20 11:47:39 +02:00

61 lines
1.1 KiB
CMake

add_subdirectory(App)
IF (BUILD_GUI)
PYSIDE_WRAP_RC(Draft_QRC_SRCS Resources/Draft.qrc)
ENDIF (BUILD_GUI)
SET(Draft_SRCS
Init.py
InitGui.py
Draft.py
DraftTools.py
DraftGui.py
DraftSnap.py
DraftTrackers.py
DraftVecUtils.py
DraftGeomUtils.py
WorkingPlane.py
importDXF.py
importOCA.py
importSVG.py
importDWG.py
importAirfoilDAT.py
TestDraft.py
)
SOURCE_GROUP("" FILES ${Draft_SRCS})
SET(DraftGuiIcon_SVG
Resources/icons/DraftWorkbench.svg
)
ADD_CUSTOM_TARGET(Draft ALL
SOURCES ${Draft_SRCS} ${Draft_QRC_SRCS} ${DraftGuiIcon_SVG}
)
fc_copy_sources(Draft "${CMAKE_BINARY_DIR}/Mod/Draft" ${Draft_SRCS})
fc_copy_sources(Draft "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Draft" ${DraftGuiIcon_SVG})
IF (BUILD_GUI)
fc_target_copy_resource(Draft
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/Mod/Draft
Draft_rc.py)
ENDIF (BUILD_GUI)
INSTALL(
FILES
${Draft_SRCS}
${Draft_QRC_SRCS}
DESTINATION
Mod/Draft
)
INSTALL(
FILES
${DraftGuiIcon_SVG}
DESTINATION
"${CMAKE_INSTALL_DATADIR}/Mod/Draft/Resources/icons"
)