diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/FindKDE4.cmake | 13 | ||||
| -rw-r--r-- | modules/KDE4Macros.cmake | 29 | ||||
| -rw-r--r-- | modules/MacroAppendDirectoryProperties.cmake | 19 | ||||
| -rw-r--r-- | modules/MacroAppendSourceFilesProperties.cmake | 21 | ||||
| -rw-r--r-- | modules/MacroLibrary.cmake | 2 | 
5 files changed, 67 insertions, 17 deletions
| diff --git a/modules/FindKDE4.cmake b/modules/FindKDE4.cmake index b7ef270d..08ad73be 100644 --- a/modules/FindKDE4.cmake +++ b/modules/FindKDE4.cmake @@ -35,6 +35,8 @@ FIND_PACKAGE(Qt4 REQUIRED)  SET(QT_AND_KDECORE_LIBS ${QT_QTCORE_LIBRARY} kdecore) +INCLUDE (MacroLibrary) +  #add some KDE specific stuff @@ -171,21 +173,24 @@ IF (WIN32)     # at first find the kdewin32 library, this has to be compiled and installed before kdelibs/ -   FIND_LIBRARY(KDEWIN32_LIBRARY NAMES kdewin32 PATHS ${CMAKE_LIBRARY_PATH}) -   FIND_PATH(KDEWIN32_INCLUDE_DIR winposix_export.h ${CMAKE_INCLUDE_PATH}) +   FIND_LIBRARY(KDEWIN32_LIBRARY NAMES kdewin32 PATHS ) +   FIND_PATH(KDEWIN32_INCLUDE_DIR winposix_export.h )     # kdelibs/win/ has to be built before the rest of kdelibs/     # eventually it will be moved out from kdelibs/     IF (NOT KDEWIN32_LIBRARY OR NOT KDEWIN32_INCLUDE_DIR)        MESSAGE(FATAL_ERROR "Could not find kdewin32 library, build and install kdelibs/win/ before building kdelibs/")     ENDIF (NOT KDEWIN32_LIBRARY OR NOT KDEWIN32_INCLUDE_DIR) + +   # add the winsock2 library, using find_library or something like this would probably be better +   SET(KDEWIN32_LIBRARY ${KDEWIN32_LIBRARY} ws2_32)     IF(MINGW)        #mingw compiler -      SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/mingw ${QT_INCLUDES} ${CMAKE_INCLUDE_PATH}) +      SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/mingw ${QT_INCLUDES})     ELSE(MINGW)        # msvc compiler -      SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/msvc  ${QT_INCLUDES}  ${CMAKE_INCLUDE_PATH}) +      SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/msvc  ${QT_INCLUDES})        # add the MS SDK include directory if available        SET(MS_SDK_DIR $ENV{MSSdk}) diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index d8566dab..db49f3a2 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -18,18 +18,18 @@  #this should better be part of cmake:  #add an additional file to the list of files a source file depends on -MACRO(KDE4_ADD_FILE_DEPENDANCY file) - -   GET_SOURCE_FILE_PROPERTY(_deps ${file} OBJECT_DEPENDS) -   IF (_deps) -      SET(_deps ${_deps} ${ARGN}) -   ELSE (_deps) -      SET(_deps ${ARGN}) -   ENDIF (_deps) - -   SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES OBJECT_DEPENDS "${_deps}") - -ENDMACRO(KDE4_ADD_FILE_DEPENDANCY) +#MACRO(KDE4_ADD_FILE_DEPENDANCY file) +# +#   GET_SOURCE_FILE_PROPERTY(_deps ${file} OBJECT_DEPENDS) +#   IF (_deps) +#      SET(_deps ${_deps} ${ARGN}) +#   ELSE (_deps) +#      SET(_deps ${ARGN}) +#   ENDIF (_deps) +# +#   SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES OBJECT_DEPENDS "${_deps}") +# +#ENDMACRO(KDE4_ADD_FILE_DEPENDANCY)  #create the kidl and skeletion file for dcop stuff @@ -275,7 +275,8 @@ MACRO(KDE4_AUTOMOC)                    DEPENDS ${_header}                 ) -               KDE4_ADD_FILE_DEPENDANCY(${_tmp_FILE} ${_moc}) +#               KDE4_ADD_FILE_DEPENDANCY(${_tmp_FILE} ${_moc}) +               MACRO_APPEND_SOURCE_FILES_PROPERTIES(${_tmp_FILE} PROPERTIES OBJECT_DEPENDS ${_moc} )              ENDFOREACH (_current_MOC_INC)           ENDIF(_match) @@ -396,6 +397,7 @@ MACRO(KDE4_CREATE_LIBTOOL_FILE _target _subdir)     FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/${KDE4_LIB_INSTALL_DIR}/${_subdir}'\n")     INSTALL_FILES(${KDE4_LIB_INSTALL_DIR}/${_subdir} FILES ${_laname}) +   MACRO_APPEND_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${_laname})  ENDMACRO(KDE4_CREATE_LIBTOOL_FILE) @@ -448,6 +450,7 @@ ENDMACRO(KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)  MACRO(KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME )     CONFIGURE_FILE(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) +   MACRO_APPEND_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )  #   IF (WIN32)  #      # under windows, just build a normal executable diff --git a/modules/MacroAppendDirectoryProperties.cmake b/modules/MacroAppendDirectoryProperties.cmake new file mode 100644 index 00000000..2fed5a55 --- /dev/null +++ b/modules/MacroAppendDirectoryProperties.cmake @@ -0,0 +1,19 @@ +# - MACRO_APPEND_DIRECTORY_PROPERTIES(PROPERTIES key values...) +# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] ) + +MACRO(MACRO_APPEND_DIRECTORY_PROPERTIES _properties _property) +   GET_DIRECTORY_PROPERTY(_tmp_DIR_PROPS ${_property} ) +   IF (NOT _tmp_DIR_PROPS) +      SET(_tmp_DIR_PROPS) +   ENDIF (NOT _tmp_DIR_PROPS) +   FOREACH(_value ${ARGN}) +      IF (_tmp_DIR_PROPS) +         SET(_tmp_DIR_PROPS ${_tmp_DIR_PROPS} ${_value}) +      ELSE (_tmp_DIR_PROPS) +         SET(_tmp_DIR_PROPS ${_value}) +      ENDIF (_tmp_DIR_PROPS) +   ENDFOREACH(_value ${ARGN}) + +   SET_DIRECTORY_PROPERTIES(${_properties} ${_property} "${_tmp_DIR_PROPS}") +ENDMACRO(MACRO_APPEND_DIRECTORY_PROPERTIES) + diff --git a/modules/MacroAppendSourceFilesProperties.cmake b/modules/MacroAppendSourceFilesProperties.cmake new file mode 100644 index 00000000..4d387e20 --- /dev/null +++ b/modules/MacroAppendSourceFilesProperties.cmake @@ -0,0 +1,21 @@ +# - MACRO_APPEND_SOURCE_FILES_PROPERTIES(<file> PROPERTIES key values...) +# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] ) + +MACRO(MACRO_APPEND_SOURCE_FILES_PROPERTIES _file _properties _property) +   GET_SOURCE_FILE_PROPERTY(_tmp_FILE_PROPS ${_file} ${_property}) +    +   IF (NOT _tmp_FILE_PROPS) # make sure it's empty not e.g. "NOTFOUND" or "FALSE" +      SET(_tmp_FILE_PROPS) +   ENDIF (NOT _tmp_FILE_PROPS) +    +   FOREACH(_value ${ARGN}) +      IF (_tmp_FILE_PROPS) +         SET(_tmp_FILE_PROPS ${_tmp_FILE_PROPS} ${_value}) +      ELSE (_tmp_FILE_PROPS) +         SET(_tmp_FILE_PROPS ${_value}) +      ENDIF (_tmp_FILE_PROPS) +   ENDFOREACH(_value ${ARGN}) + +   SET_SOURCE_FILES_PROPERTIES(${_file} ${_properties} ${_property} "${_tmp_FILE_PROPS}") +ENDMACRO(MACRO_APPEND_SOURCE_FILES_PROPERTIES) + diff --git a/modules/MacroLibrary.cmake b/modules/MacroLibrary.cmake index 25abc38d..337a1087 100644 --- a/modules/MacroLibrary.cmake +++ b/modules/MacroLibrary.cmake @@ -2,4 +2,6 @@  # OPTIONAL_FIND_PACKAGE( <name> [QUIT] )  INCLUDE (MacroOptionalFindPackage) +INCLUDE (MacroAppendDirectoryProperties) +INCLUDE (MacroAppendSourceFilesProperties) | 
