Add support for running kmymoney from build dir
ClosedPublic

Authored by habacker on Nov 8 2018, 9:07 PM.

Diff Detail

Repository
R261 KMyMoney
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
habacker requested review of this revision.Nov 8 2018, 9:07 PM
habacker created this revision.
wojnilowicz set the repository for this revision to R261 KMyMoney.Nov 11 2018, 5:52 AM
wojnilowicz added a project: KMyMoney.
wojnilowicz added a subscriber: KMyMoney.
wojnilowicz added inline comments.Nov 11 2018, 6:29 AM
CMakeLists.txt
41

This dependency was too high for Thomas.

46

Why do you exclude other OSes?

47

Maybe we should rename namespace for plugins installation from kmymoney to kmymoney-plugins dir instead of workarounding it like that. What do you think?

48

I don't do it that way and I would not like to see these messages each time I build KMyMoney. Please put them in README.cmake

kmymoney/CMakeLists.txt
172

AFAIK, this works only on UNIX. You didn't exclude other OSes.

habacker added inline comments.Nov 15 2018, 10:19 PM
CMakeLists.txt
41

For ECM >= 5.38 some defaults are already set (https://cgit.kde.org/extra-cmake-modules.git/tree/kde-modules/KDECMakeSettings.cmake#n263)
If this version cannot be set as minimum version it is required to set all related variables

if("${ECM_GLOBAL_FIND_VERSION}" VERSION_LESS "5.38.0")
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
  if(WIN32)
     set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
  else()
     set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
  endif()
elseif(NOT WIN32)
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
endif()
46

Because the default settings in ECM are okay for windows (https://cgit.kde.org/extra-cmake-modules.git/tree/kde-modules/KDECMakeSettings.cmake#n263) but not on linux and other unix based os, where shared library normally are expected below lib/

47

No, kmymoney plugins are normally installed into /usr/lib64/qt5/plugins/kmymoney/. Changing it to /usr/lib64/qt5/plugins/kmymoney-plugins/ is obsolate, because the term 'plugins' is already in the path and the subdirectory below plugins should be the application or library name.

48

sure.

kmymoney/CMakeLists.txt
172

yes. cmake does not has cross platform support for this yet. On windows there a symbolic link from bin/kmymoney to bin (see https://en.wikipedia.org/wiki/Symbolic_link) e.g.

cd bin
mklink /D kmymoney .
habacker updated this revision to Diff 45558.Nov 16 2018, 7:28 AM
  • fixed issues
  • todo: creating symlink need to be checked on windows
habacker marked 10 inline comments as done.Nov 16 2018, 7:45 AM
habacker edited the summary of this revision. (Show Details)

Just a hint: running kmymoney from build dir is useful inside an IDE like QtCreator

e.g. if kmymoney source lives in ~/src/kmymoney and build is in ~/src/kmymoney-build you can run

cd ~/src/kmymoney-build
XDG_DATA_DIRS=$XDG_DATA_DIRS:$PWD/tmp/usr/local/share \
 QT_PLUGIN_PATH=$QT_PLUGIN_PATH:$PWD/lib \
 LD_LIBRARY_PATH=$PWD/lib qtcreator ../kmymoney/CMakeLists.txt &

to compile and debug kmymoney completly inside QtCreator

habacker added inline comments.Nov 21 2018, 4:43 PM
CMakeLists.txt
41

This dependency was too high for Thomas.

Can you tell me what exactly prevents updating ECM to a newer version ? The latest kmymoney App Image uses KF5 version 5.51, but stays with ECM version 5.10.

tbaumgart added inline comments.Nov 24 2018, 9:38 AM
CMakeLists.txt
41

The AppImage is build on the KDE CI. My local dev environment is still on openSuSE 42.3 which only comes with ECM 5.32

README.cmake
166

Don't the entries need to be listed the other way around so that you can have an installed version and one in development, e.g.

$ XDG_DATA_DIRS=$PWD/tmp/usr/local/share:$XDG_DATA_DIRS \
  QT_PLUGIN_PATH=$PWD/lib:$QT_PLUGIN_PATH \

This way, the files in the build dir will be found first.

habacker updated this revision to Diff 46193.Nov 25 2018, 12:28 PM
  • use local path first in readme.cmake
  • add note why not using ECM 5.38
habacker marked 3 inline comments as done.Nov 25 2018, 12:29 PM
wojnilowicz resigned from this revision.Mar 10 2019, 6:51 AM
tbaumgart accepted this revision.Mar 24 2019, 9:03 AM
tbaumgart added inline comments.
README.cmake
154

s/to to/to/ please

This revision is now accepted and ready to land.Mar 24 2019, 9:03 AM
habacker marked an inline comment as done.Aug 29 2019, 1:02 AM
This revision was automatically updated to reflect the committed changes.