diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-03-18 17:06:38 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-03-18 17:06:38 +0000 |
commit | 749af63f54c38a6aa03aa5240b8746aeed799507 (patch) | |
tree | 32c4a29dcc3b2f0c10bf7548fb678e914c64bdb0 /modules | |
parent | 59f760108e06726ee40cecd4956fc6b41b5490de (diff) | |
download | extra-cmake-modules-749af63f54c38a6aa03aa5240b8746aeed799507.tar.gz extra-cmake-modules-749af63f54c38a6aa03aa5240b8746aeed799507.tar.bz2 |
-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
Diffstat (limited to 'modules')
-rw-r--r-- | modules/KDE4Macros.cmake | 21 |
1 files changed, 12 insertions, 9 deletions
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} |