Make compile. Oh, and tweak some more.
[quassel.git] / cmake / modules / QuasselMacros.cmake
1 # This macro sets variables for additional Qt modules.
2 # We need this because targets need different Qt4 modules, i.e. different libs
3 # and defines. We can't simply include UseQt4 several times, since definitions add up.
4 # We workaround this by using our own macro to figure out what to add.
5
6 macro(setup_qt4_variables)
7   set(QUASSEL_QT_LIBRARIES )
8   IF(WIN32)
9     set(MAIN MAIN)
10   ENDIF(WIN32)
11   foreach(qtmod CORE ${ARGV} ${MAIN})
12     set(QUASSEL_QT_LIBRARIES ${QUASSEL_QT_LIBRARIES} ${QT_QT${qtmod}_LIBRARY} ${QT_${qtmod}_LIB_DEPENDENCIES})
13   endforeach(qtmod ${ARGV})
14   set(QUASSEL_QT_LIBRARIES ${QUASSEL_QT_LIBRARIES} ${QT_LIBRARIES})
15 endmacro(setup_qt4_variables)
16
17 # This generates a .qm from a .ts file
18 macro(generate_qm outvar basename)
19   set(input ${CMAKE_SOURCE_DIR}/i18n/${basename}.ts)
20   set(output ${CMAKE_CURRENT_BINARY_DIR}/${basename}.qm)
21   add_custom_command(OUTPUT ${output}
22           COMMAND ${QT_LRELEASE_EXECUTABLE}
23           ARGS ${input}
24                -qm ${output}
25                -silent -compress
26           DEPENDS ${basename}.ts)
27   set(${outvar} ${output})
28 endmacro(generate_qm outvar basename)