Commit f6986102 authored by Jan Möbius's avatar Jan Möbius

Use autorcc

parent 88abc462
......@@ -153,33 +153,6 @@ macro (acg_qt5)
endif ()
endmacro ()
# generate qrc targets for sources in list
macro (acg_qt5_autoqrc qrc_SRCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
if ( EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
get_filename_component (_basename ${_current_FILE} NAME_WE)
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${_basename}.cpp)
qt5_add_resources( ${_outfile} ${_abs_FILE} )
add_file_dependencies (${_source} ${_outfile})
set (${qrc_SRCS} ${${qrc_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
#generates qt translations
function (acg_add_translations _target _languages _sources)
......
......@@ -58,9 +58,10 @@ endif()
# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/OpenFlipper/cmake)
# Enable automoc and autouic
# Enable automoc, autouic and auto rcc
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
......
......@@ -639,11 +639,7 @@ function (_build_openflipper_plugin plugin)
add_definitions(${${_PLUGIN}_TYPE_DEFINITIONS})
# genereate qrc targets
acg_qt5_autoqrc (qrc_targets ${qrc})
add_library (Plugin-${plugin} MODULE ${ui} ${sources} ${headers} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
add_library (Plugin-${plugin} MODULE ${ui} ${sources} ${headers} ${qrc} ${${_PLUGIN}_ADDSRC})
#group projects by parent folder name on MSVC (used for e.g. plugincollection)
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
get_filename_component(PARENT_DIR_NAME "${PARENT_DIR}" NAME)
......@@ -653,7 +649,7 @@ function (_build_openflipper_plugin plugin)
acg_set (OPENFLIPPER_${_PLUGIN}_BUILD "1")
if (STATIC_PLUGIN_${_PLUGIN})
add_library (Plugin-Static-${plugin} STATIC ${ui} ${sources} ${headers} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
add_library (Plugin-Static-${plugin} STATIC ${ui} ${sources} ${headers} ${qrc} ${${_PLUGIN}_ADDSRC})
set_target_properties(Plugin-Static-${plugin} PROPERTIES COMPILE_DEFINITIONS "QT_STATICPLUGIN")
get_target_property(PLUGIN_OUTPUT_FILENAME Plugin-${plugin} LOCATION)
get_filename_component(PLUGIN_OUTPUT_FILENAME "${PLUGIN_OUTPUT_FILENAME}" NAME)
......
......@@ -113,14 +113,8 @@ acg_append_files (qrc "*.qrc" ${directories} .)
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic and moc targets
if (QT5_FOUND)
acg_qt5_autoqrc (qrc_targets ${qrc})
endif()
if (QT5_FOUND)
acg_add_library (ACG SHARED ${ui} ${sources} ${headers} ${qrc_targets})
acg_add_library (ACG SHARED ${ui} ${sources} ${headers} ${qrc})
endif()
if ( NOT WIN32 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment