283
283
if (_kdeBootStrapping)
284
set(_ssheet ${CMAKE_SOURCE_DIR}/kdoctools/customization/kde-chunk.xsl)
284
set(_ssheet "${CMAKE_BINARY_DIR}/kdoctools/customization/kde-chunk.xsl")
285
285
set(_bootstrapOption "--srcdir=${CMAKE_BINARY_DIR}/kdoctools/")
286
286
else (_kdeBootStrapping)
287
set(_ssheet ${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-chunk.xsl)
287
set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-chunk.xsl")
288
288
set(_bootstrapOption)
289
289
endif (_kdeBootStrapping)
362
362
if (_kdeBootStrapping)
363
set(_ssheet "${CMAKE_SOURCE_DIR}/kdoctools/docbook/xsl/manpages/docbook.xsl")
363
set(_ssheet "${CMAKE_BINARY_DIR}/kdoctools/customization/kde-include-man.xsl")
364
364
set(_bootstrapOption "--srcdir=${CMAKE_BINARY_DIR}/kdoctools/")
365
365
else (_kdeBootStrapping)
366
set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/docbook/xsl/manpages/docbook.xsl")
366
set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-include-man.xsl")
367
367
set(_bootstrapOption)
368
368
endif (_kdeBootStrapping)
626
626
endmacro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE)
629
macro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)
630
#is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise set the prefix empty
631
if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
633
else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
634
set(_first_SRC ${_with_PREFIX})
635
endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
637
set(_SRCS ${_first_SRC} ${ARGN})
629
macro (KDE4_ADD_PLUGIN _target_NAME )
630
#if the first argument is "WITH_PREFIX" then keep the standard "lib" prefix,
631
#otherwise set the prefix empty
635
set(_add_lib_param "MODULE")
638
foreach(arg ${_args})
639
if (arg STREQUAL "WITH_PREFIX")
641
endif (arg STREQUAL "WITH_PREFIX")
642
if (arg STREQUAL "STATIC")
643
set(_add_lib_param STATIC)
644
endif (arg STREQUAL "STATIC")
645
if (arg STREQUAL "SHARED")
646
set(_add_lib_param SHARED)
647
endif (arg STREQUAL "SHARED")
648
if (arg STREQUAL "MODULE")
649
set(_add_lib_param MODULE)
650
endif (arg STREQUAL "MODULE")
654
list(REMOVE_ITEM _args "WITH_PREFIX")
656
if(_add_lib_param STREQUAL "STATIC")
657
list(REMOVE_ITEM _args "STATIC")
658
endif(_add_lib_param STREQUAL "STATIC")
659
if (_add_lib_param STREQUAL "SHARED")
660
list(REMOVE_ITEM _args "SHARED")
661
endif (_add_lib_param STREQUAL "SHARED")
662
if (_add_lib_param STREQUAL "MODULE")
663
list(REMOVE_ITEM _args "MODULE")
664
endif (_add_lib_param STREQUAL "MODULE")
639
668
_automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS)
670
if("${_add_lib_param}" STREQUAL "STATIC")
671
add_definitions(-DQT_STATICPLUGIN)
672
endif("${_add_lib_param}" STREQUAL "STATIC")
641
674
if (KDE4_ENABLE_FINAL)
642
675
kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS})
643
add_library(${_target_NAME} MODULE ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files})
676
add_library(${_target_NAME} ${_add_lib_param} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files})
644
677
else (KDE4_ENABLE_FINAL)
645
add_library(${_target_NAME} MODULE ${_SRCS})
678
add_library(${_target_NAME} ${_add_lib_param} ${_SRCS})
646
679
endif (KDE4_ENABLE_FINAL)
648
681
_automoc4_kde4_post_target_handling(${_target_NAME})
651
684
set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
685
endif (NOT _with_pre)
654
687
# for shared libraries/plugins a -DMAKE_target_LIB is required
655
688
string(TOUPPER ${_target_NAME} _symbol)
1094
1126
macro (KDE4_ADD_WIN32_APP_ICON appsources)
1095
1127
message(STATUS "KDE4_ADD_WIN32_APP_ICON() is deprecated, use KDE4_ADD_APP_ICON() instead")
1097
1130
find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
1132
find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
1098
1134
find_program(WINDRES_EXECUTABLE NAMES windres)
1100
1136
set(WINDRES_EXECUTABLE TRUE)
1121
1157
endmacro (KDE4_ADD_WIN32_APP_ICON)
1123
1159
# adds application icon to target source list
1124
# for detailled documentation see the top of FindKDE4Internal.cmake
1160
# for detailed documentation see the top of FindKDE4Internal.cmake
1125
1161
macro (KDE4_ADD_APP_ICON appsources pattern)
1126
string(REPLACE _KDEINIT_SRCS "" target ${appsources})
1127
if(${appsources} STREQUAL ${target})
1128
string(REPLACE _SRCS "" target ${appsources})
1129
endif(${appsources} STREQUAL ${target})
1162
set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appsources})
1132
1166
find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
1168
find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
1133
1170
find_program(WINDRES_EXECUTABLE NAMES windres)
1135
1172
set(WINDRES_EXECUTABLE TRUE)
1206
1241
# This will register the icon into the bundle
1207
set(MACOSX_BUNDLE_ICON_FILE ${target}.icns)
1242
set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
1209
1244
# Append the icns file to the sources list so it will be a dependency to the
1211
1246
list(APPEND ${appsources} ${_outfilename}.icns)
1213
# this doesn't seem to work for me - Use manual "install" instead
1214
# TODO: test again with cmake 2.6 ?
1215
# SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${target}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
1217
install(FILES ${_outfilename}.icns DESTINATION ${BIN_INSTALL_DIR}/${target}.app/Contents/Resources/)
1248
# Install the icon into the Resources dir in the bundle
1249
set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
1220
1252
# TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly?
1221
message(STATUS "Unable to find an 128x128 icon for target ${target} - application will not have an application icon!")
1253
message(STATUS "Unable to find an 128x128 icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
1224
1256
else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
1225
1257
message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!")
1226
1258
endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
1228
1260
endmacro (KDE4_ADD_APP_ICON)