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
This commit is contained in:
@@ -3,37 +3,43 @@ IF (BUILD_GUI)
|
||||
ENDIF (BUILD_GUI)
|
||||
|
||||
SET(OpenSCAD_SRCS
|
||||
Init.py
|
||||
InitGui.py
|
||||
OpenSCAD2Dgeom.py
|
||||
OpenSCADFeatures.py
|
||||
OpenSCADUtils.py
|
||||
OpenSCADCommands.py
|
||||
exportCSG.py
|
||||
importCSG.py
|
||||
tokrules.py
|
||||
colorcodeshapes.py
|
||||
expandplacements.py
|
||||
replaceobj.py
|
||||
Init.py
|
||||
InitGui.py
|
||||
OpenSCAD2Dgeom.py
|
||||
OpenSCADFeatures.py
|
||||
OpenSCADUtils.py
|
||||
OpenSCADCommands.py
|
||||
exportCSG.py
|
||||
importCSG.py
|
||||
tokrules.py
|
||||
colorcodeshapes.py
|
||||
expandplacements.py
|
||||
replaceobj.py
|
||||
)
|
||||
SOURCE_GROUP("" FILES ${OpenSCAD_SRCS})
|
||||
|
||||
SET(ply_SRCS
|
||||
ply/lex.py
|
||||
ply/README
|
||||
ply/yacc.py
|
||||
ply/__init__.py
|
||||
ply/lex.py
|
||||
ply/README
|
||||
ply/yacc.py
|
||||
ply/__init__.py
|
||||
)
|
||||
SOURCE_GROUP("ply" FILES ${ply_SRCS})
|
||||
|
||||
set(all_files ${OpenSCAD_SRCS} ${ply_SRCS})
|
||||
|
||||
SET(OpenSCADGuiIcon_SVG
|
||||
Resources/icons/OpenSCADWorkbench.svg
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(OpenSCAD ALL
|
||||
SOURCES ${allfiles} ${OpenSCAD_QRC_SRCS}
|
||||
SOURCES ${all_files} ${OpenSCAD_QRC_SRCS} ${OpenSCADGuiIcon_SVG}
|
||||
)
|
||||
|
||||
fc_copy_sources(OpenSCAD "${CMAKE_BINARY_DIR}/Mod/OpenSCAD" ${all_files})
|
||||
|
||||
fc_copy_sources(OpenSCAD "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/OpenSCAD" ${OpenSCADGuiIcon_SVG})
|
||||
|
||||
IF (BUILD_GUI)
|
||||
fc_target_copy_resource(OpenSCAD
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
@@ -54,11 +60,10 @@ INSTALL(
|
||||
DESTINATION
|
||||
Mod/OpenSCAD
|
||||
)
|
||||
|
||||
SET(OpenSCADGuiIcon_SVG
|
||||
Resources/icons/OpenSCADWorkbench.svg
|
||||
INSTALL(
|
||||
FILES
|
||||
${OpenSCADGuiIcon_SVG}
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_DATADIR}/Mod/OpenSCAD/Resources/icons"
|
||||
)
|
||||
|
||||
fc_copy_sources(OpenSCAD "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/OpenSCAD" ${OpenSCADGuiIcon_SVG})
|
||||
|
||||
INSTALL(FILES ${OpenSCADGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/OpenSCAD/Resources/icons")
|
||||
|
||||
Reference in New Issue
Block a user