From 749af63f54c38a6aa03aa5240b8746aeed799507 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sat, 18 Mar 2006 17:06:38 +0000 Subject: -don't generate any files in the source tree, but only in the build tree Laurent, where did this cause problems ? Was this with the files where source files with the same base names are now compiled to the same target, and beforfe with libtool one of them was part of a convenience libs ? Now that we don't use convenience libs anymore, this means that if two source files have the same basename, they will generate moc files with the same name, also for ui-files. What can we do about this ? If two files have the same names, maybe the name is too generic, so let's rename one of them to a more specialized name, especially now that we have svn. But generating files is the source-tree is a no-no. CCMAIL: montel@kde.org svn path=/trunk/KDE/kdelibs/; revision=520047 --- modules/KDE4Macros.cmake | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'modules') diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 4450a734..6846dba5 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -1,3 +1,6 @@ + +# for documentation look at FindKDE4Internal.cmake +# # this file contains the following macros: # KDE4_ADD_FILE_DEPENDANCY # KDE4_ADD_DCOP_SKELS @@ -106,9 +109,9 @@ MACRO(KDE4_ADD_KCFG_FILES _sources) FILE(READ ${_tmp_FILE} _contents) STRING(REGEX REPLACE "^(.*\n)?File=([^\n]+kcfg).*\n.*$" "\\2" _kcfg_FILE "${_contents}") - set(_src_FILE ${_abs_PATH}/${_basename}.cpp) - set(_header_FILE ${_abs_PATH}/${_basename}.h) - set(_moc_FILE ${_abs_PATH}/${_basename}.moc) + 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) # the command for creating the source file from the kcfg file ADD_CUSTOM_COMMAND(OUTPUT ${_src_FILE} @@ -171,11 +174,11 @@ MACRO(KDE4_ADD_UI3_FILES _sources ) foreach (_current_FILE ${ARGN}) GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE) - GET_FILENAME_COMPONENT(_abs_PATH ${_tmp_FILE} PATH) +# GET_FILENAME_COMPONENT(_abs_PATH ${_tmp_FILE} PATH) GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE) - set(_header ${_abs_PATH}/${_basename}.h) - set(_src ${_abs_PATH}/${_basename}.cpp) - set(_moc ${_abs_PATH}/${_basename}.moc.cpp) + set(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) + set(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) + set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp) ADD_CUSTOM_COMMAND(OUTPUT ${_header} COMMAND ${CMAKE_COMMAND} @@ -246,8 +249,8 @@ MACRO(KDE4_AUTOMOC) get_filename_component(_basename ${_current_MOC} NAME_WE) # set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h) set(_header ${_abs_PATH}/${_basename}.h) - #set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) - set(_moc ${_abs_PATH}/${_current_MOC}) + set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) + #set(_moc ${_abs_PATH}/${_current_MOC}) add_custom_command(OUTPUT ${_moc} COMMAND ${QT_MOC_EXECUTABLE} ARGS ${_moc_INCS} ${_header} -o ${_moc} -- cgit v1.2.1