diff options
author | Allen Winter <allen.winter@kdab.com> | 2022-03-05 10:33:50 -0500 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2022-03-05 10:33:50 -0500 |
commit | 03c02ced21494413920744a400c638b0cb5d493f (patch) | |
tree | e14550e414422e0d0ffc5b295b57489328b6d3f3 /cmake | |
parent | 1717e715b87188671ccd4c72f84396dd5929a19a (diff) | |
download | libical-git-03c02ced21494413920744a400c638b0cb5d493f.tar.gz |
buildsystem - fix all uninitialized cmake warnings
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindBerkeleyDB.cmake | 24 | ||||
-rw-r--r-- | cmake/modules/GObjectIntrospectionMacros.cmake | 40 | ||||
-rw-r--r-- | cmake/modules/GtkDoc.cmake | 2 |
3 files changed, 48 insertions, 18 deletions
diff --git a/cmake/modules/FindBerkeleyDB.cmake b/cmake/modules/FindBerkeleyDB.cmake index 401a36c4..d9f2cc8d 100644 --- a/cmake/modules/FindBerkeleyDB.cmake +++ b/cmake/modules/FindBerkeleyDB.cmake @@ -28,15 +28,21 @@ # NOTE: If Berkeley DB ever gets a Pkg-config ".pc" file, add pkg_check_modules() here # Checks if environment paths are empty, set them if they aren't -if(NOT "$ENV{BERKELEYDB_ROOT}" STREQUAL "") - set(_BERKELEYDB_PATHS "$ENV{BERKELEYDB_ROOT}") -elseif(NOT "$ENV{Berkeleydb_ROOT}" STREQUAL "") - set(_BERKELEYDB_PATHS "$ENV{Berkeleydb_ROOT}") -elseif(NOT "$ENV{BERKELEYDBROOT}" STREQUAL "") - set(_BERKELEYDB_PATHS "$ENV{BERKELEYDBROOT}") -else() - # Set just in case, as it's used regardless if it's empty or not - set(_BERKELEYDB_PATHS "") +set(_BERKELEYDB_PATHS "") +if(NOT _BERKELEYDB_PATHS AND DEFINED BERKELEYDB_ROOT) + if($ENV{BERKELEYDB_ROOT} AND NOT "$ENV{BERKELEYDB_ROOT}" STREQUAL "") + set(_BERKELEYDB_PATHS "$ENV{BERKELEYDB_ROOT}") + endif() +endif() +if(NOT _BERKELEYDB_PATHS AND DEFINED Berkeleydb_ROOT) + if($ENV{Berkeleydb_ROOT} AND NOT "$ENV{Berkeleydb_ROOT}" STREQUAL "") + set(_BERKELEYDB_PATHS "$ENV{Berkeleydb_ROOT}") + endif() +endif() +if(NOT _BERKELEYDB_PATHS AND DEFINED BERKELEYDBROOT) + if($ENV{BERKELEYDBROOT} AND NOT "$ENV{BERKELEYDBROOT}" STREQUAL "") + set(_BERKELEYDB_PATHS "$ENV{BERKELEYDBROOT}") + endif() endif() # Allow user to pass a path instead of guessing diff --git a/cmake/modules/GObjectIntrospectionMacros.cmake b/cmake/modules/GObjectIntrospectionMacros.cmake index 83aff931..198e809a 100644 --- a/cmake/modules/GObjectIntrospectionMacros.cmake +++ b/cmake/modules/GObjectIntrospectionMacros.cmake @@ -26,20 +26,45 @@ macro(gir_add_introspections introspections_girs) # Namespace and Version is either fetched from the gir filename # or the _NAMESPACE/_VERSION variable combo - set(_gir_namespace "${${_gir_name}_NAMESPACE}") + set(_gir_namespace "") + if(DEFINED ${_gir_name}_NAMESPACE) + set(_gir_namespace "${${_gir_name}_NAMESPACE}") + endif() if (_gir_namespace STREQUAL "") string(REGEX REPLACE "([^-]+)-.*" "\\1" _gir_namespace "${gir}") endif () - set(_gir_version "${${_gir_name}_VERSION}") + + set(_gir_version "") + if(DEFINED ${_gir_name}_VERSION) + set(_gir_version "${${_gir_name}_VERSION}") + endif() if (_gir_version STREQUAL "") string(REGEX REPLACE ".*-([^-]+).gir" "\\1" _gir_version "${gir}") endif () # _PROGRAM is an optional variable which needs its own --program argument - set(_gir_program "${${_gir_name}_PROGRAM}") + set(_gir_program "") + if(DEFINED ${_gir_name}_PROGRAM) + set(_gir_program "${${_gir_name}_PROGRAM}") + endif() if (NOT _gir_program STREQUAL "") set(_gir_program "--program=${_gir_program}") - endif () + endif() + + # _SCANNERFLAGS is optional + set(_gir_scannerflags "") + if(DEFINED ${_gir_name}_SCANNERFLAGS) + set(_gir_scannerflags "${${_gir_name}_SCANNERFLAGS}") + endif() + + # _FILES + set(_gir_files "") + if(DEFINED ${_gir_name}_FILES) + set(_gir_files "${${_gir_name}_FILES}") + else() + message(ERROR "Unspecified or empty ${_gir_name}_FILES variable") + endif() + # Variables which provides a list of things _gir_list_prefix(_gir_libraries ${_gir_name}_LIBS "--library=") @@ -60,12 +85,12 @@ macro(gir_add_introspections introspections_girs) ${_gir_libraries} ${_gir_packages} ${_gir_includes} - ${${_gir_name}_SCANNERFLAGS} + ${_gir_scannerflags} ${${_gir_name}_CFLAGS} - ${${_gir_name}_FILES} + ${_gir_files} --output ${CMAKE_CURRENT_BINARY_DIR}/${gir} --accept-unprefixed - DEPENDS ${${_gir_name}_FILES} + DEPENDS ${_gir_files} ${${_gir_name}_LIBS} OUTPUT ${gir} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} @@ -77,7 +102,6 @@ macro(gir_add_introspections introspections_girs) string(REPLACE ".gir" ".typelib" _typelib "${gir}") add_custom_command( COMMAND ${GObjectIntrospection_COMPILER} - ${GObjectIntrospection_COMPILER_ARGS} --includedir=. ${CMAKE_CURRENT_BINARY_DIR}/${gir} -o ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} diff --git a/cmake/modules/GtkDoc.cmake b/cmake/modules/GtkDoc.cmake index 2cf76aaa..3356f437 100644 --- a/cmake/modules/GtkDoc.cmake +++ b/cmake/modules/GtkDoc.cmake @@ -210,7 +210,7 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign ${GTKDOC_SCAN} --module=${_module} --deprecated-guards="${_deprecated_guards}" - --ignore-headers="${_ignore_headers}" + --ignore-headers="${${_ignoreheadersvar}}" --rebuild-sections --rebuild-types ${_srcdirs} |