Hi,
I have an issue with using Qt 4 compiled resources on MSVC 2015 due to the
"compiler running out of heap space". I have decided to instead use
external binary resources on Windows builds as this seems to be the
simplest fix.
I am able to generate a binary resource with the following commands:
QT4_ADD_RESOURCES(RCC "main.qrc" OPTIONS "-binary")
ADD_EXECUTABLE(target source ${RCC})
The problem is that the QT4_ADD_RESOURCES will *always* create a cxx file.
This means that the add_executable command will attempt to compile the
binary source file.
The behaviour I would like to see would be to name the file "qrc_main.rcc"
if we are producing binary resources. As this is not a C++ file extension,
add_executable will not try to compile this generated file.
I am making the assumption that it is required to add RCC to the executable
to force it to be generated automatically. If there is a simple solution to
my setup that I have overlooked, please let me know.
I have thought of 2 ways to fix the issue and wanted to post this to the
mailing list for feedback before submitting a patch:
1. We can allow the user to pass a TARGET parameter to the macro. Currently
the rcc_target parameter of the macro is unused. This would be used to
generate a user specified filename, which in this case could be
"myfile.rcc". The issue with this approach is that "-name ${outfilename} "
is passed to rcc and I am unsure of the implications of this parameter. A
generic target name may not fit the inherent naming convention in the
current implementation.
2. We can scan for the "-binary" option and automatically change the file
extension to rcc in this case. My concern here is that it is a bit "magic".
I would appreciate feedback on these approaches, or suggestions for easier
ways to solve the problem.
Best Regards,
Josh
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers