diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,19 @@ include(KDEInstallDirs) include(KDECMakeSettings) +# reimplementation because kmymoney app image is bound to ECM 5.36 +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() + include(FeatureSummary) include(CMakeDependentOption) diff --git a/README.cmake b/README.cmake --- a/README.cmake +++ b/README.cmake @@ -145,3 +145,24 @@ $ make test to process all unit tests. + +----------------------------------------------------- +Quick-start 5: Run kmymoney from build dir +----------------------------------------------------- + +Instead of installing kmymoney in a system location to be able to +to run it with any newly compiled plugins, you can use the following +recipe to run kmymoney from a build directory. + +After compiling kmymoney (see Quickstart 1:), the following commands +must be executed once to see icons in the application + +$ cd build +$ make install DESTDIR=$PWD/tmp + +After each build you can start kmymoney with + +$ cd build +$ XDG_DATA_DIRS=$PWD/tmp/usr/local/share:$XDG_DATA_DIRS \ + QT_PLUGIN_PATH=$PWD/lib:$QT_PLUGIN_PATH \ + LD_LIBRARY_PATH=$PWD/lib bin/kmymoney diff --git a/kmymoney/CMakeLists.txt b/kmymoney/CMakeLists.txt --- a/kmymoney/CMakeLists.txt +++ b/kmymoney/CMakeLists.txt @@ -165,6 +165,17 @@ $<$:sqlcipher> ) +# create symlink to let kcoreaddons find plugins +if(WIN32) + add_custom_command(TARGET kmymoney POST_BUILD + COMMAND mklink /J kmymoney . + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +else() + add_custom_command(TARGET kmymoney POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink . kmymoney + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +endif() + # own plist magic for mac os if(APPLE) # own plist template