KDE install dirs
I'm trying to write correct CMakeLists.txt file for my new KDE project. However, I have some troubles with KDE install directories.
Part of my installation commands in cmake file looks like below:
INSTALL(TARGETS photolayoutseditoreffectplugin_blur DESTINATION ${PLUGIN_INSTALL_DIR})
INSTALL(FILES photolayoutseditoreffectplugin_blur.desktop DESTINATION ${SERVICES_INSTALL_DIR})
INSTALL(TARGETS photolayoutseditor ${INSTALL_T开发者_如何学编程ARGETS_DEFAULT_ARGS})
INSTALL(PROGRAMS plugin/photolayoutseditor.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
INSTALL(FILES plugin/photolayoutseditorui.rc DESTINATION ${DATA_INSTALL_DIR}/photolayoutseditor)
INSTALL(FILES effects/photolayoutseditoreffectplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
INSTALL(FILES borders/photolayoutseditorborderplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
As you see there are few install dirs which are set by KDE package. Below I write those variables with their values in my cmake script:
${DATA_INSTALL_DIR} = /usr/local/share/apps/
${SERVICES_INSTALL_DIR} = /usr/local/share/kde4/services/
${SERVICETYPES_INSTALL_DIR} = /usr/local/share/kde4/servicetypes/
${PLUGIN_INSTALL_DIR} = /usr/local/lib/kde4/
As you see all of this paths contains "local" folder. After such installation my project is still invisible for my system. I checked those paths using kde4-config and it tells me:
kde4-config -path data = /usr/share/kde4/apps/
kde4-config -path services = /usr/share/kde4/services/
kde4-config -path servicetypes = /usr/share/kde4/servicetypes/
kde4-config -path lib = /usr/lib/
So why paths inside cmake file are different from those from kde4-config tool? I'm sure that kde4-config tells me correct paths becouse when I moved my project files to those directories (without "local" folder in url) my project becomes visible for my system and it works. How to properly configure install paths for my cmakelists.txt ??
Thanks for any help in advance! Best regards!
when you run cmake
, add the flag
-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
精彩评论