This forum has been archived. All content is frozen. Please use KDE Discuss instead.

master MinGW build is broken

Tags: None
(comma "," separated)
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

master MinGW build is broken

Mon Nov 11, 2013 3:46 pm
cmake fails because of macro QT4_ADD_RESOURCES2 beeing declared too late in ./src/CMakeLists.txt
Fixing the above issue then leads to problems with ./src/apps/marble-qt/marble.rc and ./src/apps/marble-qt/marble.rc.

The patch given below addresses the issues when using cmake 2.8.12 and QT 5.1.1.

Code: Select all
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1578335..7433a95 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -54,37 +54,6 @@ endif( NOT QTONLY AND KDE4_PLASMA_LIBS )
 if(APPLE)
   add_subdirectory( mac )
 endif(APPLE)
-# FIXME: The original QT4_ADD_RESOURCES should be extended to support this filetype too
-#
-# QT4_ADD_RESOURCE2(outfiles inputfile ... )
-# TODO  perhaps consider adding support for compression and root options to rcc
-
-if (MINGW)
-MACRO (QT4_ADD_RESOURCES2 outfiles )
-
-FOREACH (it ${ARGN})
-  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}/${outfilename}_res.o)
-  #  parse file for dependencies
-  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}")
-    SET(_RC_DEPENDS ${_RC_DEPENDS} "${rc_path}/${_RC_FILE}")
-  ENDFOREACH(_RC_FILE)
-  ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-    COMMAND windres
-    ARGS -i ${infile} -o ${outfile} --include-dir=${CMAKE_CURRENT_SOURCE_DIR}
-    MAIN_DEPENDENCY ${infile}
-    DEPENDS ${_RC_DEPENDS})
-  SET(${outfiles} ${${outfiles}} ${outfile})
-ENDFOREACH (it)
-
-ENDMACRO (QT4_ADD_RESOURCES2)
-ENDIF(MINGW)
 
 if (QTONLY)
   # ce: don't know why this is needed here - on win32
diff --git a/src/apps/marble-qt/CMakeLists.txt b/src/apps/marble-qt/CMakeLists.txt
index 58425d5..c755555 100644
--- a/src/apps/marble-qt/CMakeLists.txt
+++ b/src/apps/marble-qt/CMakeLists.txt
@@ -2,14 +2,6 @@ set(marble_SRCS qtmain.cpp QtMainWindow.cpp)
 include_directories(${CMAKE_CURRENT_BINARY_DIR}
                     ${CMAKE_CURRENT_SOURCE_DIR}/../marble-ui)
 
-if(MSVC)
-  set(marble_SRCS ${marble_SRCS} marble.rc)
-endif(MSVC)
-
-if(MINGW)
-   QT4_ADD_RESOURCES2(marble_SRCS marble.rc)
-endif(MINGW)
-
 qt_wrap_ui(marble_SRCS ${marble_UI})
 marble_qt4_automoc(${marble_SRCS})
 
diff --git a/src/apps/marble-ui/CMakeLists.txt b/src/apps/marble-ui/CMakeLists.txt
index 1dc165b..59f7a6d 100644
--- a/src/apps/marble-ui/CMakeLists.txt
+++ b/src/apps/marble-ui/CMakeLists.txt
@@ -1,14 +1,6 @@
 set(marble_SRCS ControlView.cpp MarbleTest.cpp)
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-if(MSVC)
-  set(marble_SRCS ${marble_SRCS} marble.rc)
-endif(MSVC)
-
-if(MINGW)
-   QT4_ADD_RESOURCES2(marble_SRCS marble.rc)
-endif(MINGW)
-
 qt_add_resources(marble_SRCS marble.qrc)
 
 qt_wrap_ui(marble_SRCS ${marble_UI})


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]