Skip to content

Split CMakeLists.txt by targets and directories

Once suggested in !313 (comment 134956).

  • Fix mistakes from !313 (merged):
    • part/textdocumentsettings.ui -> core/
    • okular_part.desktop -> part/
  • Add ${CMAKE_CURRENT_BINARY_DIR} to include_directories(), otherwise the build fails where config-okular.h is included.
    • Somehow I don’t like this. Maybe it is the easiest to remove config-okular.h, and use add_definitions(-D...=1) instead.
  • add_subdirectory(part) is now conditional on BUILD_DESKTOP.

TODO

  • Use target_sources() instead of source file lists. Since KF 5.76, kconfig_add_kcfg_files() can do that.
  • Remove obsolete version checks from CMakeLists.txt.
  • Make include paths in all autotests less explicit, so they can follow CMakeLists.txt configuration. Modifying include paths for settings[core].h was required because configuration skeletons are now compiled into build/core/ and build/part/ target directories instead of build/.
  • Make autotests depend on targets (e. g. make shell/autotests/ directories) instead of just lying around in the base directory?

Suggested commit message

(pending)

Edited by David Hurka

Merge request reports