1 (edited by christoph 2024-04-12 00:21:33)

Topic: CMake errors prevent compilation

Hi,

I was running into an annoying bug recently and tried to fix it myself. However, I can't get CMake to run properly right out of the master branch. There are what looks to me obvious errors in the CMake scripts, but I thought as these haven't been changed recently, I'm most likely doing something wrong.

Here is my output when running cmake on the current master branch (URLs in output stripped due to validator in this forum):

qelectrotech-source-mirror on  master [!] via △ v3.29.1
❯ cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
_____________________________________________________________________
Copyright 2006 The QElectroTech Team
This file is part of QElectroTech.

QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with QElectroTech.  If not, see <HERE WAS A URL>.
_____________________________________________________________________
Add sub directory tests
.____________________________________________________________________
. PROJECT_NAME              :unittests
. PROJECT_SOURCE_DIR        :/Users/christoph/Programmieren/qelectrotech-source-mirror/tests
. Add sub directory catch
..___________________________________________________________________
.. PROJECT_NAME              :C_unittests
.. PROJECT_SOURCE_DIR        :/Users/christoph/Programmieren/qelectrotech-source-mirror/tests/catch
.. QET_DIR                   :/Users/christoph/Programmieren/qelectrotech-source-mirror
.. QET_COMPONENTS is not set !!! I set them up !!!
 - qet_compilation_vars
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
.. QT_VERSION_MAJOR   :6
-- Found Cups: /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/lib/libcups.tbd (found version "2.3.4")
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/OpenGL.framework
-- Found WrapOpenGL: TRUE
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
 - fetch_kdeaddons
 - fetch_singleapplication
 - fetch_pugixml
CMake Deprecation Warning at build/_deps/pugixml-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


.. CATCH_INCLUDE_DIR is not set,assuming Catch2 can be found automatically in your system
. Add sub directory googletest
..___________________________________________________________________
.. PROJECT_NAME              :G_unittests
.. PROJECT_SOURCE_DIR        :/Users/christoph/Programmieren/qelectrotech-source-mirror/tests/googletest
.. QET_DIR                   :/Users/christoph/Programmieren/qelectrotech-source-mirror
.. QET_COMPONENTS is not set !!! I set them up !!!
 - qet_compilation_vars
.. QT_VERSION_MAJOR          :6
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
CMake Deprecation Warning at build/_deps/gtest-src/CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at build/_deps/gtest-src/googlemock/CMakeLists.txt:45 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at build/_deps/gtest-src/googletest/CMakeLists.txt:56 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning (dev) at build/_deps/gtest-src/googletest/cmake/internal_utils.cmake:243 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  build/_deps/gtest-src/googletest/CMakeLists.txt:91 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /opt/homebrew/bin/python3.12 (found version "3.12.2")
 - fetch_kdeaddons
 - fetch_singleapplication
 - fetch_pugixml
. Add sub directory googlemock
..___________________________________________________________________
.. PROJECT_NAME              :G_unitmocktests
.. PROJECT_SOURCE_DIR        :/Users/christoph/Programmieren/qelectrotech-source-mirror/tests/googlemock
.. QET_DIR                   :/Users/christoph/Programmieren/qelectrotech-source-mirror
.. QET_COMPONENTS is not set !!! I set them up !!!
 - qet_compilation_vars
.. QT_VERSION_MAJOR          :6
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
 - fetch_kdeaddons
 - fetch_singleapplication
 - fetch_pugixml
. Add sub directory qttest
..___________________________________________________________________
.. PROJECT_NAME              :qt_unittests
.. PROJECT_SOURCE_DIR        :/Users/christoph/Programmieren/qelectrotech-source-mirror/tests/qttest
.. QET_DIR                   :/Users/christoph/Programmieren/qelectrotech-source-mirror
.. QET_COMPONENTS is not set !!! I set them up !!!
 - qet_compilation_vars
.. QT_VERSION_MAJOR          :6
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
 - fetch_kdeaddons
 - fetch_singleapplication
 - fetch_pugixml
 - paths_compilation_installation
 - start_options
 - developer_options
 - git_update_submodules
 - git_last_commit_sha
 - fetch_kdeaddons
CMake Warning at build/_deps/ecm-src/docs/CMakeLists.txt:10 (find_package):
  No "FindSphinx.cmake" found in CMAKE_MODULE_PATH.


CMake Warning (dev) at build/_deps/ecm-src/docs/CMakeLists.txt:10 (find_package):
  FindSphinx.cmake must either be part of this project itself, in this case
  adjust CMAKE_MODULE_PATH so that it points to the correct location inside
  its source tree.

  Or it must be installed by a package which has already been found via
  find_package().  In this case make sure that package has indeed been found
  and adjust CMAKE_MODULE_PATH to contain the location where that package has
  installed FindSphinx.cmake.  This must be a location provided by that
  package.  This error in general means that the buildsystem of this project
  is relying on a Find-module without ensuring that it is actually available.

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at build/_deps/ecm-src/docs/CMakeLists.txt:20 (find_package):
  No "FindQCollectionGenerator.cmake" found in CMAKE_MODULE_PATH.


CMake Warning (dev) at build/_deps/ecm-src/docs/CMakeLists.txt:20 (find_package):
  FindQCollectionGenerator.cmake must either be part of this project itself,
  in this case adjust CMAKE_MODULE_PATH so that it points to the correct
  location inside its source tree.

  Or it must be installed by a package which has already been found via
  find_package().  In this case make sure that package has indeed been found
  and adjust CMAKE_MODULE_PATH to contain the location where that package has
  installed FindQCollectionGenerator.cmake.  This must be a location provided
  by that package.  This error in general means that the buildsystem of this
  project is relying on a Find-module without ensuring that it is actually
  available.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- The following OPTIONAL packages have been found:

 * PythonInterp
 * Threads
 * Qt6LinguistTools
 * Qt6CoreTools (required version >= 6.6.2)
 * OpenGL
 * Qt6GuiTools (required version >= 6.6.2)
 * Qt6DBusTools (required version >= 6.6.2)
 * Qt6WidgetsTools (required version >= 6.6.2)
 * Qt6PrintSupport
 * Qt6Xml
 * Qt6Svg
 * Qt6Sql
 * Qt6Network
 * Qt6Concurrent
 * Qt6Test

-- The following REQUIRED packages have been found:

 * QT
 * Qt6

-- The following features have been disabled:

 * BUILD_HTML_DOCS, Generate HTML documentation for installed modules.
 * BUILD_MAN_DOCS, Generate man page documentation for installed modules.
 * BUILD_QTHELP_DOCS, Generate QtHelp documentation for installed modules.
 * BUILD_TESTING, Build automated tests.

-- The following OPTIONAL packages have not been found:

 * WrapVulkanHeaders
 * Sphinx (required version >= 1.2), Tool to generate documentation., <HERE WAS A URL>
   Required to build documentation for Extra CMake Modules.
 * QCollectionGenerator, Qt help collection generator., <HERE WAS A URL>
   Required to build Extra CMake Modules documentation in Qt Help format.

-- Could NOT find ECM (missing: ECM_DIR)
--
 * ECM (required version >= 5.77.0), Extra CMake Modules., <HERE WAS A URL>

CMake Error at /opt/homebrew/Cellar/cmake/3.29.1/share/cmake/Modules/FeatureSummary.cmake:464 (message):
  feature_summary() Error: REQUIRED package(s) are missing, aborting CMake
  run.
Call Stack (most recent call first):
  build/_deps/kcoreaddons-src/CMakeLists.txt:9 (feature_summary)


-- Configuring incomplete, errors occurred!

The errors start with FindSphinx not found. This is totally understandable, as build/_deps/ecm-src/CMakeLists.txt is not built to be imported as a module. See line 36:

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

This does obviously not work and should be

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

But on the other hand, if this is (as I understand it) a widely used CMake scripts collection by the KDE team, it is probably not meant to be used by CMake's FetchContent.

So, how am I supposed to compile QET?

Thanks,
Christoph

Re: CMake errors prevent compilation

Hello Christoph,

try it with qmake (Qt5).

Regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: CMake errors prevent compilation

Hello Christoph,

christoph wrote:

-- Could NOT find ECM (missing: ECM_DIR)
--
* ECM (required version >= 5.77.0), Extra CMake Modules., <HERE WAS A URL>

on Debian-Systems there is a Package

apt install extra-cmake-modules

Maybe there is something similar on your apple...

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: CMake errors prevent compilation

Hello Christoph,

see the wiki for compil it on macOS.

https://qelectrotech.org/wiki_new/doc/m … onment_old

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: CMake errors prevent compilation

❯ brew info extra-cmake-modules
==> extra-cmake-modules: stable 6.0.0 (bottled), HEAD
Extra modules and scripts for CMake
<URL replaced to make the forum software happy>
Not installed
From: <URL replaced to make the forum software happy>
License: BSD-2-Clause and BSD-3-Clause and MIT
==> Dependencies
Build: cmake ✘, sphinx-doc ✔
==> Options
--HEAD
    Install HEAD version
==> Analytics
install: 672 (30 days), 1,926 (90 days), 5,580 (365 days)
install-on-request: 233 (30 days), 818 (90 days), 2,671 (365 days)
build-error: 4 (30 days)

The extra-cmake-modules in homebrew are too new. For some reason I haven't investigated further they don't work with the qet project.

Seems like I'm stuck with qmake for my first tries. After having seen the dev-env setup for qmake posted by @scipio810 I can understand why Qt moved to CMake as their primary build system. I've almost forgotten how clumsy qmake was. ;-)

Anyways, I'm on a business trip right now but will give it a try next week. Keep you posted.

Re: CMake errors prevent compilation

use this repo Qt5/KF5 : https://invent.kde.org/packaging/homebrew-kde

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: CMake errors prevent compilation

Hello christoph,

Goto the Kde-frameworks-devel
see : https://mail.kde.org/mailman/listinfo/k … orks-devel
To post a message to all the list members, send email to kde-frameworks-devel@kde.org.

Erik

I am an pre-retired industrial developer technician and born in 1960