KDE/kdelibs/cmake/modules
David Faure
faure at kde.org
Wed Mar 4 18:54:02 CET 2009
SVN commit 935251 by dfaure:
Support for .kcfg files being generated using configure_file like tmcguire
wants to do in kmail.
CCMAIL: kde-buildsystem at kde.org
M +10 -2 KDE4Macros.cmake
--- trunk/KDE/kdelibs/cmake/modules/KDE4Macros.cmake #935250:935251
@@ -70,13 +70,21 @@
set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
set(_moc_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+ set(_kcfg_PATH ${_abs_PATH}/${_kcfg_FILE})
+ # Maybe the .kcfg is a generated file?
+ if(NOT EXISTS "${_kcfg_PATH}")
+ set(_kcfg_PATH ${CMAKE_CURRENT_BINARY_DIR}/${_kcfg_FILE})
+ endif(NOT EXISTS "${_kcfg_PATH}")
+ if(NOT EXISTS "${_kcfg_PATH}")
+ message(ERROR "${_kcfg_FILE} not found; tried in ${_abs_PATH} and ${CMAKE_CURRENT_BINARY_DIR}")
+ endif(NOT EXISTS "${_kcfg_PATH}")
# the command for creating the source file from the kcfg file
add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE}
COMMAND ${KDE4_KCFGC_EXECUTABLE}
- ARGS ${_abs_PATH}/${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR}
+ ARGS ${_kcfg_PATH} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${_tmp_FILE}
- DEPENDS ${_abs_PATH}/${_kcfg_FILE} ${_KDE4_KCONFIG_COMPILER_DEP} )
+ DEPENDS ${_kcfg_PATH} ${_KDE4_KCONFIG_COMPILER_DEP} )
if(_kcfg_generatemoc)
qt4_generate_moc(${_header_FILE} ${_moc_FILE} )
More information about the Kde-buildsystem
mailing list