2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2009-09-28 19:46:51 +04:00
|
|
|
#
|
|
|
|
|
2006-03-09 22:10:59 +03:00
|
|
|
# See FindKDE3.cmake for documentation.
|
|
|
|
#
|
|
|
|
# this file contains the following macros:
|
|
|
|
# KDE3_ADD_DCOP_SKELS
|
|
|
|
# KDE3_ADD_DCOP_STUBS
|
|
|
|
# KDE3_ADD_MOC_FILES
|
|
|
|
# KDE3_ADD_UI_FILES
|
|
|
|
# KDE3_ADD_KCFG_FILES
|
|
|
|
# KDE3_AUTOMOC
|
|
|
|
# KDE3_INSTALL_LIBTOOL_FILE
|
|
|
|
# KDE3_CREATE_FINAL_FILE
|
|
|
|
# KDE3_ADD_KPART
|
|
|
|
# KDE3_ADD_KDEINIT_EXECUTABLE
|
|
|
|
# KDE3_ADD_EXECUTABLE
|
|
|
|
|
|
|
|
|
|
|
|
#neundorf@kde.org
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
include(AddFileDependencies)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
#create the kidl and skeletion file for dcop stuff
|
|
|
|
#usage: KDE_ADD_COP_SKELS(foo_SRCS ${dcop_headers})
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_DCOP_SKELS _sources)
|
|
|
|
foreach (_current_FILE ${ARGN})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
|
|
|
|
get_filename_component(_basename ${_tmp_FILE} NAME_WE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(_skel ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_skel.cpp)
|
|
|
|
set(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (NOT HAVE_${_basename}_KIDL_RULE)
|
|
|
|
set(HAVE_${_basename}_KIDL_RULE ON)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_kidl}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${KDE3_DCOPIDL_EXECUTABLE}
|
2006-10-03 22:03:16 +04:00
|
|
|
ARGS ${_tmp_FILE} > ${_kidl}
|
2006-03-09 22:10:59 +03:00
|
|
|
DEPENDS ${_tmp_FILE}
|
|
|
|
)
|
2007-02-21 00:02:51 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (NOT HAVE_${_basename}_SKEL_RULE)
|
|
|
|
set(HAVE_${_basename}_SKEL_RULE ON)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_skel}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${KDE3_DCOPIDL2CPP_EXECUTABLE}
|
|
|
|
ARGS --c++-suffix cpp --no-signals --no-stub ${_kidl}
|
|
|
|
DEPENDS ${_kidl}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(${_sources} ${${_sources}} ${_skel})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_DCOP_STUBS _sources)
|
|
|
|
foreach (_current_FILE ${ARGN})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_basename ${_tmp_FILE} NAME_WE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(_stub_CPP ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_stub.cpp)
|
|
|
|
set(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (NOT HAVE_${_basename}_KIDL_RULE)
|
|
|
|
set(HAVE_${_basename}_KIDL_RULE ON)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_kidl}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${KDE3_DCOPIDL_EXECUTABLE}
|
2006-10-03 22:03:16 +04:00
|
|
|
ARGS ${_tmp_FILE} > ${_kidl}
|
|
|
|
DEPENDS ${_tmp_FILE}
|
2006-03-09 22:10:59 +03:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (NOT HAVE_${_basename}_STUB_RULE)
|
|
|
|
set(HAVE_${_basename}_STUB_RULE ON)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_stub_CPP}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${KDE3_DCOPIDL2CPP_EXECUTABLE}
|
|
|
|
ARGS --c++-suffix cpp --no-signals --no-skel ${_kidl}
|
|
|
|
DEPENDS ${_kidl}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(${_sources} ${${_sources}} ${_stub_CPP})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_KCFG_FILES _sources)
|
|
|
|
foreach (_current_FILE ${ARGN})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_basename ${_tmp_FILE} NAME_WE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
file(READ ${_tmp_FILE} _contents)
|
|
|
|
string(REGEX REPLACE "^(.*\n)?File=([^\n]+)\n.*$" "\\2" _kcfg_FILE "${_contents}")
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
|
|
|
|
set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_src_FILE}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${KDE3_KCFGC_EXECUTABLE}
|
|
|
|
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${_kcfg_FILE} ${_tmp_FILE}
|
|
|
|
DEPENDS ${_tmp_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${_kcfg_FILE} )
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(${_sources} ${${_sources}} ${_src_FILE})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
#create the moc files and add them to the list of sources
|
|
|
|
#usage: KDE_ADD_MOC_FILES(foo_SRCS ${moc_headers})
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_MOC_FILES _sources)
|
|
|
|
foreach (_current_FILE ${ARGN})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_basename ${_tmp_FILE} NAME_WE)
|
|
|
|
set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_moc}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
|
|
|
ARGS ${_tmp_FILE} -o ${_moc}
|
|
|
|
DEPENDS ${_tmp_FILE}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(${_sources} ${${_sources}} ${_moc})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component( KDE3_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
#create the implementation files from the ui files and add them to the list of sources
|
|
|
|
#usage: KDE_ADD_UI_FILES(foo_SRCS ${ui_files})
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_UI_FILES _sources )
|
|
|
|
foreach (_current_FILE ${ARGN})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_basename ${_tmp_FILE} NAME_WE)
|
|
|
|
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)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_header}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${QT_UIC_EXECUTABLE}
|
2006-08-27 23:52:36 +04:00
|
|
|
ARGS -L ${KDE3_LIB_DIR}/kde3/plugins/designer -nounload -o ${_header} ${CMAKE_CURRENT_SOURCE_DIR}/${_current_FILE}
|
2006-03-09 22:10:59 +03:00
|
|
|
DEPENDS ${_tmp_FILE}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_src}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
ARGS
|
2006-08-27 23:52:36 +04:00
|
|
|
-DKDE_UIC_PLUGIN_DIR:FILEPATH=${KDE3_LIB_DIR}/kde3/plugins/designer
|
2006-05-20 00:57:49 +04:00
|
|
|
-DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC_EXECUTABLE}
|
|
|
|
-DKDE_UIC_FILE:FILEPATH=${_tmp_FILE}
|
|
|
|
-DKDE_UIC_CPP_FILE:FILEPATH=${_src}
|
|
|
|
-DKDE_UIC_H_FILE:FILEPATH=${_header}
|
2006-03-09 22:10:59 +03:00
|
|
|
-P ${KDE3_MODULE_DIR}/kde3uic.cmake
|
|
|
|
DEPENDS ${_header}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_command(OUTPUT ${_moc}
|
2006-03-09 22:10:59 +03:00
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
|
|
|
ARGS ${_header} -o ${_moc}
|
|
|
|
DEPENDS ${_header}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(${_sources} ${${_sources}} ${_src} ${_moc} )
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_AUTOMOC)
|
|
|
|
set(_matching_FILES )
|
|
|
|
foreach (_current_FILE ${ARGN})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
|
|
|
|
# here. this is required to make bouic work correctly:
|
|
|
|
# we need to add generated .cpp files to the sources (to compile them),
|
|
|
|
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
|
|
|
|
# cmake is run for the very first time on them -> however the .cpp files might
|
|
|
|
# exist at a later run. at that time we need to skip them, so that we don't add two
|
|
|
|
# different rules for the same moc file
|
2012-08-13 21:47:32 +04:00
|
|
|
get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (EXISTS ${_abs_FILE} AND NOT _skip)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-19 15:54:56 +04:00
|
|
|
file(STRINGS ${_abs_FILE} _match REGEX "#include +[^ ]+\\.moc[\">]")
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_abs_PATH ${_abs_FILE} PATH)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-19 15:54:56 +04:00
|
|
|
foreach (_current_MOC_INC IN LISTS _match)
|
|
|
|
string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-19 15:54:56 +04:00
|
|
|
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})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-19 15:54:56 +04:00
|
|
|
add_custom_command(OUTPUT ${_moc}
|
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
|
|
|
ARGS ${_header} -o ${_moc}
|
|
|
|
DEPENDS ${_header}
|
|
|
|
)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-19 15:54:56 +04:00
|
|
|
ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-19 15:54:56 +04:00
|
|
|
endforeach ()
|
|
|
|
unset(_match)
|
|
|
|
unset(_header)
|
|
|
|
unset(_moc)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
|
|
|
endforeach ()
|
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2006-08-27 18:19:51 +04:00
|
|
|
# only used internally by KDE3_INSTALL_ICONS
|
2012-08-13 21:47:32 +04:00
|
|
|
macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2006-08-27 18:19:51 +04:00
|
|
|
# if the string doesn't match the pattern, the result is the full string, so all three have the same content
|
2012-08-13 21:47:32 +04:00
|
|
|
if (NOT ${_group} STREQUAL ${_install_NAME} )
|
|
|
|
set(_icon_GROUP "actions")
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (${_group} STREQUAL "mime")
|
|
|
|
set(_icon_GROUP "mimetypes")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (${_group} STREQUAL "filesys")
|
|
|
|
set(_icon_GROUP "filesystems")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (${_group} STREQUAL "device")
|
|
|
|
set(_icon_GROUP "devices")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (${_group} STREQUAL "app")
|
|
|
|
set(_icon_GROUP "apps")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (${_group} STREQUAL "action")
|
|
|
|
set(_icon_GROUP "actions")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name}" )
|
2012-08-13 21:47:32 +04:00
|
|
|
install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-08-27 18:19:51 +04:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro ()
|
2006-08-27 18:19:51 +04:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro (KDE3_INSTALL_ICONS _theme )
|
|
|
|
set(_defaultpath "${CMAKE_INSTALL_PREFIX}/share/icons")
|
2006-08-27 18:19:51 +04:00
|
|
|
# first the png icons
|
2012-08-13 21:47:32 +04:00
|
|
|
file(GLOB _icons *.png)
|
|
|
|
foreach (_current_ICON ${_icons} )
|
|
|
|
string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size "${_current_ICON}")
|
|
|
|
string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}")
|
|
|
|
string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name "${_current_ICON}")
|
2006-08-27 23:52:36 +04:00
|
|
|
_KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
|
|
|
|
${_defaultpath}/${_theme}/${_size}x${_size}
|
2006-08-27 18:19:51 +04:00
|
|
|
${_group} ${_current_ICON} ${_name})
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2006-08-27 18:19:51 +04:00
|
|
|
# and now the svg icons
|
2012-08-13 21:47:32 +04:00
|
|
|
file(GLOB _icons *.svgz)
|
|
|
|
foreach (_current_ICON ${_icons} )
|
|
|
|
string(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}")
|
|
|
|
string(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}")
|
2006-08-27 23:52:36 +04:00
|
|
|
_KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
|
|
|
|
${_defaultpath}/${_theme}/scalable
|
2006-08-27 18:19:51 +04:00
|
|
|
${_group} ${_current_ICON} ${_name})
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_INSTALL_LIBTOOL_FILE _target)
|
|
|
|
get_target_property(_target_location ${_target} LOCATION)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_laname ${_target_location} NAME_WE)
|
|
|
|
get_filename_component(_soname ${_target_location} NAME)
|
|
|
|
set(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
file(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
|
|
|
|
file(APPEND ${_laname} "# The name that we can dlopen(3).\n")
|
|
|
|
file(APPEND ${_laname} "dlname='${_soname}'\n")
|
|
|
|
file(APPEND ${_laname} "# Names of this library\n")
|
|
|
|
if(CYGWIN)
|
|
|
|
file(APPEND ${_laname} "library_names='${_soname}'\n")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
file(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
file(APPEND ${_laname} "# The name of the static archive\n")
|
|
|
|
file(APPEND ${_laname} "old_library=''\n")
|
|
|
|
file(APPEND ${_laname} "# Libraries that this one depends upon.\n")
|
|
|
|
file(APPEND ${_laname} "dependency_libs=''\n")
|
|
|
|
# file(APPEND ${_laname} "dependency_libs='${${_target}_LIB_DEPENDS}'\n")
|
|
|
|
file(APPEND ${_laname} "# Version information.\ncurrent=0\nage=0\nrevision=0\n")
|
|
|
|
file(APPEND ${_laname} "# Is this an already installed library?\ninstalled=yes\n")
|
|
|
|
file(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
|
|
|
|
file(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
|
|
|
|
file(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
|
|
|
|
file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_CREATE_FINAL_FILE _filename)
|
|
|
|
file(WRITE ${_filename} "//autogenerated file\n")
|
|
|
|
foreach (_current_FILE ${ARGN})
|
|
|
|
file(APPEND ${_filename} "#include \"${_current_FILE}\"\n")
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
# option(KDE3_ENABLE_FINAL "Enable final all-in-one compilation")
|
|
|
|
option(KDE3_BUILD_TESTS "Build the tests")
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_KPART _target_NAME _with_PREFIX)
|
2006-03-09 22:10:59 +03:00
|
|
|
#is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise SET the prefix empty
|
2012-08-13 21:47:32 +04:00
|
|
|
if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
|
|
|
|
set(_first_SRC)
|
2012-08-13 21:50:14 +04:00
|
|
|
else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(_first_SRC ${_with_PREFIX})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
# if (KDE3_ENABLE_FINAL)
|
2007-02-21 00:02:51 +03:00
|
|
|
# KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN})
|
2012-08-13 21:47:32 +04:00
|
|
|
# add_library(${_target_NAME} MODULE ${_target_NAME}_final.cpp)
|
2012-08-13 21:50:14 +04:00
|
|
|
# else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
|
2012-08-13 21:50:14 +04:00
|
|
|
# endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(_first_SRC)
|
|
|
|
set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME})
|
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
# if (KDE3_ENABLE_FINAL)
|
2007-02-21 00:02:51 +03:00
|
|
|
# KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
|
2012-08-13 21:47:32 +04:00
|
|
|
# add_library(kdeinit_${_target_NAME} SHARED ${_target_NAME}_final.cpp)
|
2012-08-13 21:50:14 +04:00
|
|
|
# else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
add_library(kdeinit_${_target_NAME} SHARED ${ARGN} )
|
2012-08-13 21:50:14 +04:00
|
|
|
# endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
configure_file(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )
|
|
|
|
target_link_libraries( ${_target_NAME} kdeinit_${_target_NAME} )
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
macro(KDE3_ADD_EXECUTABLE _target_NAME )
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
# if (KDE3_ENABLE_FINAL)
|
2007-02-21 00:02:51 +03:00
|
|
|
# KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
|
2012-08-13 21:47:32 +04:00
|
|
|
# add_executable(${_target_NAME} ${_target_NAME}_final.cpp)
|
2012-08-13 21:50:14 +04:00
|
|
|
# else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable(${_target_NAME} ${ARGN} )
|
2012-08-13 21:50:14 +04:00
|
|
|
# endif ()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2006-03-09 22:10:59 +03:00
|
|
|
|
|
|
|
|