From d7ca477e8491fe249fca9f95d89ae672cc97bde1 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sat, 14 Jan 2012 14:34:19 -0500 Subject: [PATCH] Only build fontembedder when requested fontembedder is only need when regenerating LineFont.h from LineFont.src which should be very rarely. --- src/CMakeLists.txt | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 532491273..d7da0ebba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,22 +31,28 @@ ${CMAKE_CURRENT_BINARY_DIR}/tests/CTestCustom.cmake) ### Tests add_subdirectory(tests) -### Font Embedder - - set(fontembedder_SRCS fontembedder.cpp ) - kde4_add_executable(fontembedder ${fontembedder_SRCS}) - target_link_libraries(fontembedder ${KDE4_KIO_LIBS} ) - -### Line graphics font - +### Font Embedder and LineFont.h + option(KONSOLE_BUILD_FONTEMBEDDER "Konsole: build fontembedder executable" OFF) option(KONSOLE_GENERATE_LINEFONT "Konsole: regenerate LineFont file" OFF) - if(KONSOLE_GENERATE_LINEFONT) - add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/LineFont.h - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/fontembedder - ARGS ${CMAKE_SOURCE_DIR}/LineFont.src - DEPENDS ${CMAKE_SOURCE_DIR}/LineFont.src ) - endif(KONSOLE_GENERATE_LINEFONT) + ### Use cmake -DKONSOLE_BUILD_FONTEMBEDDER or/and -DKONSOLE_GENERATE_LINEFONT=1 + if(KONSOLE_BUILD_FONTEMBEDDER OR KONSOLE_GENERATE_LINEFONT) + ### Font Embedder + set(fontembedder_SRCS fontembedder.cpp ) + kde4_add_executable(fontembedder ${fontembedder_SRCS}) + target_link_libraries(fontembedder ${KDE4_KIO_LIBS} ) + + ### Line graphics font + ### The below cmake doesn't work; it might be possible to automate it + ### if LineFont.src has changed. If automated, different OSes will + ### need to be handled. + ### If LineFont.h is needed to be recreated use: + ### fontembedder LineFont.src > LineFont.h + #add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/LineFont.h + # COMMAND ${CMAKE_CURRENT_BINARY_DIR}/fontembedder + # ARGS ${CMAKE_SOURCE_DIR}/LineFont.src + # DEPENDS ${CMAKE_SOURCE_DIR}/LineFont.src ) + endif(KONSOLE_BUILD_FONTEMBEDDER OR KONSOLE_GENERATE_LINEFONT) ### Konsole source files shared between embedded terminal and main application # qdbuscpp2xml -m Session.h -o org.kde.konsole.Session.xml