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