Difference between revisions of "Development/ECM SourceIncompatChanges"

Jump to: navigation, search
(FindKDE4Internal.cmake)
(FindKDE4Internal.cmake)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
=== CheckPrototypeExists.cmake===
 +
 +
Port all usages of check_prototype_exists() to check_prototype_definition(), defined in CheckPrototypeDefinition.cmake, coming with CMake since 2.8.5.
 +
 
=== FindFlex.cmake ===
 
=== FindFlex.cmake ===
  
Line 12: Line 16:
  
 
* gettext_process_po_files(de ALL INSTALL_DESTINATION ${dest} file1.po file2.po) -> gettext_process_po_files(de ALL INSTALL_DESTINATION ${dest} PO_FILES file1.po file2.po)
 
* gettext_process_po_files(de ALL INSTALL_DESTINATION ${dest} file1.po file2.po) -> gettext_process_po_files(de ALL INSTALL_DESTINATION ${dest} PO_FILES file1.po file2.po)
 +
 +
The syntax of GETTEXT_PROCESS_POT() changed a bit, it now needs the additional keyword "LANGUAGES".
 +
 +
*  GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] <lang1> <lang2> ... ) -> GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... )
  
 
=== FindGIF.cmake ===
 
=== FindGIF.cmake ===
Line 84: Line 92:
 
=== MacroEnsureVersion.cmake ===
 
=== MacroEnsureVersion.cmake ===
  
This file has been removed, use VERSION_LESS or VERSION_GREATER instead.
+
This file has been removed and then those macros:
 +
* normalize_version (requested_version normalized_version)
 +
* macro_check_range_inclusive_lower (lower_limit value upper_limit ok)
 +
* macro_ensure_version (requested_version found_version var_too_old)
 +
* macro_ensure_version2 (requested_version2 found_version2 var_too_old2)
 +
* macro_ensure_version_range (min_version found_version max_version var_ok)
 +
 
 +
Use VERSION_LESS or VERSION_GREATER instead.
 
Example:
 
Example:
 
   if ( ${MY_VERSION} VERSION_LESS ${REQUIRED_VERSION} )
 
   if ( ${MY_VERSION} VERSION_LESS ${REQUIRED_VERSION} )
Line 98: Line 113:
  
  
* macro_display_feature_log() -> feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGE)
+
* macro_display_feature_log() -> feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
  
 
=== MacroOptionalAddSubdirectory.cmake ===
 
=== MacroOptionalAddSubdirectory.cmake ===
Line 144: Line 159:
 
=== FindKDE4Internal.cmake ===
 
=== FindKDE4Internal.cmake ===
  
This file does not exist anymore.
+
This file does not exist.
 +
Use this instead of find_package(KDE4) :
 +
<pre>
 +
find_package(ECM 0.0.10 REQUIRED CONFIG)
 +
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 +
include(KDEInstallDirs)
 +
include(KDECMakeSettings)
 +
find_package(KF5 CONFIG REQUIRED I18n KIOCore ....)
 +
</pre>
 +
For stricter compilation flags you can also include(KDEFrameworkCompilerSettings).
 +
 
 +
Removed functions:
 +
* kde4_add_executable -> add_executable  (the only difference was automoc, which is done by cmake now)
 +
* kde4_add_unit_test(exe ...) -> add_executable(exe ...) + add_test(mylib-exe exe) + ecm_mark_as_test(exe). The NOGUI flag is now ecm_mark_nongui_executable(exe)
 +
* kde4_add_ui_files -> qt5_wrap_ui
 +
* kde4_add_kcfg_files -> kconfig_add_kcfg_files
 +
* kde4_install_icons -> ecm_install_icons
 +
 
 
Removed variables:
 
Removed variables:
 
* MIME_INSTALL_DIR
 
* MIME_INSTALL_DIR

Latest revision as of 22:08, 16 February 2014

Contents

[edit] CheckPrototypeExists.cmake

Port all usages of check_prototype_exists() to check_prototype_definition(), defined in CheckPrototypeDefinition.cmake, coming with CMake since 2.8.5.

[edit] FindFlex.cmake

We use the version from CMake now, which is named FindFLEX.cmake (different casing !). Beside that there should be no changes in behaviour.

  • find_package(Flex) -> find_package(FLEX)

[edit] FindGettext.cmake

We use the version from CMake now. The syntax of GETTEXT_PROCESS_PO_FILES() changed a bit, it now needs the additional keyword "PO_FILES.

  • gettext_process_po_files(de ALL INSTALL_DESTINATION ${dest} file1.po file2.po) -> gettext_process_po_files(de ALL INSTALL_DESTINATION ${dest} PO_FILES file1.po file2.po)

The syntax of GETTEXT_PROCESS_POT() changed a bit, it now needs the additional keyword "LANGUAGES".

  • GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] <lang1> <lang2> ... ) -> GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... )

[edit] FindGIF.cmake

We use the version from CMake now. There is a minor difference, which will not affect many systems. The KDE version accepted only giflib version 4, while the CMake version accepted any version of giflib. If giflib version 4 .x is required, the version can now be specified:

  • find_package(GIF) -> find_package(GIF 4 )

This actually only was an issue on some relatively old Sun machines in 2006. Maybe today it is not even there a problem anymore.

[edit] FindLibXslt.cmake

We use the version from CMake 2.8.7 now. There are two changes compared to the one in kdelibs:

  • ${LIBEXSLT_LIBRARIES} -> ${LIBXSLT_EXSLT_LIBRARIES}
  • WinCE is probably not supported anymore, patches are welcome

[edit] FindMsgfmt.cmake

This file does not exist anymore, use GETTEXT_MSGFMT_EXECUTABLE from #FindGettext.cmake coming with CMake instead.

[edit] FindPostgreSQL.cmake

The variable names have changed:

  • POSTGRESQL_INCLUDE_DIR -> PostgreSQL_INCLUDE_DIRS
  • POSTGRESQL_LIBRARIES -> PostgreSQL_LIBRARIES

[edit] FindRUBY.cmake

This file does not exist anymore, use FindRuby.cmake coming with CMake instead. Most variables are the same. Below are the changes:

  • find_package(RUBY) -> find_package(Ruby)
  • RUBY_INCLUDE_PATH -> RUBY_INCLUDE_DIRS

[edit] FindX11.cmake

The following two variables have been removed, use the newer ones instead:

  • X11_Xss_FOUND -> X11_Xscreensaver_FOUND
  • X11_Xss_LIB -> X11_Xscreensaver_LIB

The following libraries are now not part of X11_LIBRARIES anymore, so they may have to be added to target_link_libraries() explicitely where needed:

  • X11_Xau_LIB
  • X11_Xft_LIB
  • X11_Xdmcp_LIB
  • X11_Xpm_LIB

[edit] MacroAddCompileFlags.cmake

This file has been removed. Use set_property(.. APPEND_STRING) instead (new in CMake 2.8.6).

  • include(MacroAddCompileFlags) -> delete
  • macro_add_compile_flags(target "-O2 -g") -> set_property(TARGET target APPEND_STRING PROPERTY COMPILE_FLAGS " -O2 -g")

[edit] MacroAddLinkFlags.cmake

This file has been removed. Use set_property(.. APPEND_STRING) instead (new in CMake 2.8.6).

  • include(MacroAddLinkFlags) -> delete
  • macro_add_link_flags(target "-no-rpath") -> set_property(TARGET target APPEND_STRING PROPERTY LINK_FLAGS " -no-rpath")

[edit] MacroAdditionalCleanFiles.cmake

This file has been removed. Use set_property(... APPEND ...) instead.

  • include(MacroAdditionalCleanFiles) -> delete
  • macro_additional_clean_files(file1 file2 fileN) -> set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "file1;file2;fileN" )

[edit] MacroEnsureVersion.cmake

This file has been removed and then those macros:

  • normalize_version (requested_version normalized_version)
  • macro_check_range_inclusive_lower (lower_limit value upper_limit ok)
  • macro_ensure_version (requested_version found_version var_too_old)
  • macro_ensure_version2 (requested_version2 found_version2 var_too_old2)
  • macro_ensure_version_range (min_version found_version max_version var_ok)

Use VERSION_LESS or VERSION_GREATER instead. Example:

 if ( ${MY_VERSION} VERSION_LESS ${REQUIRED_VERSION} )
   # error, version is too old
 endif()

[edit] MacroLogFeature.cmake

This file has been removed, instead FeatureSummary.cmake from CMake >= 2.8.6 has to be used, which has even more functionality. Please have a look at the documentation of FeatureSummary.cmake on the cmake manpage.

  • macro_log_feature(<variable> <FEATURE> <DESCRIPTION> <URL> <REQUIRED> <MIN_VERSION> <COMMENTS>) -> set_package_properties(FEATURE PROPERTIES DESCRIPTION <DESCRIPTION> URL <URL> TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) PURPOSE "good for something")


  • macro_display_feature_log() -> feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

[edit] MacroOptionalAddSubdirectory.cmake

This file is now part of the extra-cmake-modules package and thus has been renamed to ECMOptionalAddSubdirectory.cmake

  • include(MacroOptionalAddSubdirectory) -> include (ECMOptionalAddSubdirectory)
  • macro_optional_add_subdirectory(...) -> ecm_optional_add_subdirectory(...)

[edit] MacroOptionalDependPackage.cmake

This file has been removed, the purpose was broken.

  • include (MacroOptionalDependPackage) -> delete
  • macro_optional_depend_package() -> delete

[edit] MacroOptionalFindPackage.cmake

This file does not exist anymore. Instead, starting with CMake 2.8.6, every find_package() call which is not REQUIRED can be disabled by setting the variable CMAKE_DISABLE_FIND_PACKAGE_<PackageName> to TRUE. This makes this macro unnecessary.

  • include(MacroFindPackage) -> delete
  • macro_optional_find_package(Foo ...) -> find_package(Foo ... )

[edit] MacroPushRequiredVars.cmake

This file has been merged into CMake, but has been renamed to CMakePushCheckState.cmake.

  • include(MacroPushRequiredVars) -> include(CMakePushCheckState)
  • macro_push_required_vars() -> cmake_push_check_state()
  • macro_pop_required_vars() -> cmake_pop_check_state()

[edit] MacroWriteBasicCMakeVersionFile.cmake

This macro has been merged into CMake, but has been renamed to WriteBasicConfigVersionFile.cmake, also the syntax changed slightly. To get exactly the same behaviour as with the old macro, do as shown below. For details see the documentation in the man page.

  • include(MacroWriteBasicCMakeVersionFile) -> include (WriteBasicConfigVersionFile)
  • macro_write_basic_cmake_version_file(<outfilename> 1 2 3) -> write_basic_config_version_file(<outfilename> VERSION 1.2.3 COMPATIBILITY AnyNewerVersion )

[edit] GenerateExportHeader.cmake

This has been added to CMake and provides the generate_export_header macro. This macro is the replacement of kde4_create_exports_header.


[edit] FindKDE4Internal.cmake

This file does not exist. Use this instead of find_package(KDE4) :

find_package(ECM 0.0.10 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
include(KDECMakeSettings)
find_package(KF5 CONFIG REQUIRED I18n KIOCore ....)

For stricter compilation flags you can also include(KDEFrameworkCompilerSettings).

Removed functions:

  • kde4_add_executable -> add_executable (the only difference was automoc, which is done by cmake now)
  • kde4_add_unit_test(exe ...) -> add_executable(exe ...) + add_test(mylib-exe exe) + ecm_mark_as_test(exe). The NOGUI flag is now ecm_mark_nongui_executable(exe)
  • kde4_add_ui_files -> qt5_wrap_ui
  • kde4_add_kcfg_files -> kconfig_add_kcfg_files
  • kde4_install_icons -> ecm_install_icons

Removed variables:

  • MIME_INSTALL_DIR
  • INFO_INSTALL_DIR
  • KDE4_MIME_INSTALL_DIR
  • KDE4_INFO_INSTALL_DIR
  • LIB_SUFFIX : if the automatic detection does not work as it should, set LIB_INSTALL_DIR
  • KDE4_CXX_FPIE_FLAGS, KDE4_PIE_LDFLAGS: not needed anymore, works automatically since CMake 2.8.11 via automatic handling of the POSITION_INDEPENDENT_CODE target property

[edit] KDE4Defaults.cmake

  • test related settings have been removed. Get them now via find_package(KF5 COMPONENTS CMake)

This page was last modified on 16 February 2014, at 22:08. This page has been accessed 5,043 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal