mirror of
https://abf.rosa.ru/djam/freecad.git
synced 2025-02-23 14:02:52 +00:00
130 lines
5.9 KiB
Diff
130 lines
5.9 KiB
Diff
diff -Naur freecad-0.13.1830.orig/cMake/FreeCadMacros.cmake freecad-0.13.1830.qt4/cMake/FreeCadMacros.cmake
|
|
--- freecad-0.13.1830.orig/cMake/FreeCadMacros.cmake 2013-02-02 11:09:17.000000000 -0600
|
|
+++ freecad-0.13.1830.qt4/cMake/FreeCadMacros.cmake 2014-01-13 18:32:47.637368958 -0600
|
|
@@ -167,67 +167,48 @@
|
|
#
|
|
#endmacro(qt4_wrap_ui)
|
|
|
|
-
|
|
-# This is a special version of the built in macro qt4_add_resources that generates .cpp files
|
|
-#
|
|
-#macro(fc_add_resources outfiles )
|
|
-# #QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
|
-# set(ARGN )
|
|
-# foreach (it ${rcc_files})
|
|
-# get_filename_component(outfilename ${it} NAME_WE)
|
|
-# get_filename_component(infile ${it} ABSOLUTE)
|
|
-# get_filename_component(rc_path ${infile} PATH)
|
|
-# set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
|
|
-# # parse file for dependencies
|
|
-# # all files are absolute paths or relative to the location of the qrc file
|
|
-# file(READ "${infile}" _RC_FILE_CONTENTS)
|
|
-# string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
|
-# set(_RC_DEPENDS)
|
|
-# foreach(_RC_FILE ${_RC_FILES})
|
|
-# string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
|
-# string(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
|
-# if(NOT _ABS_PATH_INDICATOR)
|
|
-# set(_RC_FILE "${rc_path}/${_RC_FILE}")
|
|
-# endif(NOT _ABS_PATH_INDICATOR)
|
|
-# set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
|
-# endforeach(_RC_FILE)
|
|
-# add_custom_command(OUTPUT ${outfile}
|
|
-# COMMAND ${QT_RCC_EXECUTABLE}
|
|
-# ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
|
-# MAIN_DEPENDENCY ${infile}
|
|
-# DEPENDS ${_RC_DEPENDS})
|
|
-# set(${outfiles} ${${outfiles}} ${outfile})
|
|
-# endforeach (it)
|
|
-#endmacro(fc_add_resources)
|
|
-
|
|
MACRO (fc_add_resources outfiles )
|
|
- QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
|
+ QT4_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN})
|
|
+
|
|
+ foreach (it ${rcc_files})
|
|
+ get_filename_component(outfilename ${it} NAME_WE)
|
|
+ get_filename_component(infile ${it} ABSOLUTE)
|
|
+ get_filename_component(rc_path ${infile} PATH)
|
|
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
|
|
+
|
|
+ set(_RC_DEPENDS)
|
|
+ if(EXISTS "${infile}")
|
|
+ # parse file for dependencies
|
|
+ # all files are absolute paths or relative to the location of the qrc file
|
|
+ file(READ "${infile}" _RC_FILE_CONTENTS)
|
|
+ string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
|
+ foreach(_RC_FILE ${_RC_FILES})
|
|
+ string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
|
+ if(NOT IS_ABSOLUTE "${_RC_FILE}")
|
|
+ set(_RC_FILE "${rc_path}/${_RC_FILE}")
|
|
+ endif()
|
|
+ set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
|
+ endforeach()
|
|
+ unset(_RC_FILES)
|
|
+ unset(_RC_FILE_CONTENTS)
|
|
+ # Since this cmake macro is doing the dependency scanning for these files,
|
|
+ # let's make a configured file and add it as a dependency so cmake is run
|
|
+ # again when dependencies need to be recomputed.
|
|
+ QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
|
|
+ configure_file("${infile}" "${out_depends}" COPY_ONLY)
|
|
+ else()
|
|
+ # The .qrc file does not exist (yet). Let's add a dependency and hope
|
|
+ # that it will be generated later
|
|
+ set(out_depends)
|
|
+ endif()
|
|
|
|
- FOREACH (it ${rcc_files})
|
|
- GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
|
|
- GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
|
- GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
|
|
- SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
|
|
- # parse file for dependencies
|
|
- # all files are absolute paths or relative to the location of the qrc file
|
|
- FILE(READ "${infile}" _RC_FILE_CONTENTS)
|
|
- STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
|
- SET(_RC_DEPENDS)
|
|
- FOREACH(_RC_FILE ${_RC_FILES})
|
|
- STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
|
- STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
|
- IF(NOT _ABS_PATH_INDICATOR)
|
|
- SET(_RC_FILE "${rc_path}/${_RC_FILE}")
|
|
- ENDIF(NOT _ABS_PATH_INDICATOR)
|
|
- SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
|
- ENDFOREACH(_RC_FILE)
|
|
- ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
+ add_custom_command(OUTPUT ${outfile}
|
|
COMMAND ${QT_RCC_EXECUTABLE}
|
|
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
|
MAIN_DEPENDENCY ${infile}
|
|
- DEPENDS ${_RC_DEPENDS})
|
|
- SET(${outfiles} ${${outfiles}} ${outfile})
|
|
- ENDFOREACH (it)
|
|
+ DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
|
|
+ set(${outfiles} ${${outfiles}} ${outfile})
|
|
+ endforeach ()
|
|
|
|
ENDMACRO (fc_add_resources)
|
|
|
|
diff -Naur freecad-0.13.1830.orig/CMakeLists.txt freecad-0.13.1830.qt4/CMakeLists.txt
|
|
--- freecad-0.13.1830.orig/CMakeLists.txt 2014-01-10 10:56:16.648269370 -0600
|
|
+++ freecad-0.13.1830.qt4/CMakeLists.txt 2014-01-13 18:27:18.895600935 -0600
|
|
@@ -325,15 +325,15 @@
|
|
macro(fc_wrap_cpp outfiles )
|
|
# get include dirs
|
|
QT4_GET_MOC_FLAGS(moc_flags)
|
|
- QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
|
+ QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
|
|
# fixes bug 0000585: bug with boost 1.48
|
|
SET(moc_options ${moc_options} -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
|
|
|
|
foreach(it ${moc_files})
|
|
get_filename_component(it ${it} ABSOLUTE)
|
|
QT4_MAKE_OUTPUT_FILE(${it} moc_ cpp outfile)
|
|
- QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
|
|
- set(${outfiles} ${${outfiles}} ${outfile})
|
|
+ QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
|
|
+ list(APPEND outfiles ${outfile})
|
|
add_file_dependencies(${it} ${outfile})
|
|
endforeach(it)
|
|
endmacro(fc_wrap_cpp)
|