Added language .qm file generation (lrelease) in cmake.
--- a/qjpeg/gui/CMakeLists.txt Sun Dec 09 18:42:03 2007 +0100
+++ b/qjpeg/gui/CMakeLists.txt Sun Dec 09 19:03:09 2007 +0100
@@ -61,13 +61,20 @@
qt4_automoc(${qtproject_SRCS} ${testQChain_SRCS})
-SET(qtproject_RCCS qjpegrest.qrc)
+# Build the languages qm.
+FIND_PROGRAM(QLRELEASE lrelease)
-QT4_ADD_RESOURCES(qtproject_RCCS_SRCS ${qtproject_RCCS})
+EXEC_PROGRAM(${QLRELEASE} ${CMAKE_CURRENT_SOURCE_DIR}/lang
+ ARGS qjpegrest_en.ts
+ RETURN_VALUE exectest)
-#add_executable(qjpegrest ${qtproject_SRCS} ${qtproject_UIS_H})
+IF (${exectest})
+ MESSAGE(FATAL_ERROR "Cannot build the language qm files")
+ENDIF (${exectest})
-#add_executable(testQChain ${testQChain_SRCS})
+# We store languages in the binary
+SET(qtproject_RCCS qjpegrest.qrc)
+QT4_ADD_RESOURCES(qtproject_RCCS_SRCS ${qtproject_RCCS})
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (NOT PLUGIN_JPEG)
@@ -84,9 +91,8 @@
target_link_libraries(qjpegrest ${QT_LIBRARIES}
netpbm jpeg plugins image ${PLUGIN_JPEG})
else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ # Normal Linux building
add_executable(qjpegrest ${qtproject_SRCS} ${qtproject_RCCS_SRCS})
target_link_libraries(qjpegrest ${QT_LIBRARIES}
netpbm jpeg plugins image)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-
-#target_link_libraries(testQChain ${QT_LIBRARIES} netpbm jpeg plugins image)