"TBB library cannot be found" CMake on MacOS - c++

I'm trying to build PrusaSlicer from source on Mac. I don't have any experience with CMake. I'm following the instructions given here.
Every time I try to build dependencies. This command cmake ..gives me errors. Earlier it was saying "Boost cannot be found." I fixed that by installing boost with brew. Now it's stuck on TBB.
OS X SDK Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk
OS X Deployment Target: (default)
-- Boost::boost exists
CMake Error at /opt/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
TBB library cannot be found. Consider set TBBROOT environment variable.
(missing: TBB_LIBRARIES) (found version "2020.3")
Call Stack (most recent call first):
/opt/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindTBB.cmake.in:286 (find_package_handle_standard_args)
cmake/modules/FindTBB.cmake:29 (include)
CMakeLists.txt:384 (find_package)
-- Configuring incomplete, errors occurred!
I have installed TBB. If you would notice even this error has the version listed.
Things I have tried:
Installing boost, cmake and tbb via brew.
Installing boost, cmake and tbb via macports.

Try the following
cmake .. -DTBB_LIBRARYDIR=/opt/intel/tbb/lib/intel64/gcc4.8 -DTBB_INCLUDEDIR=/opt/intel/tbb/include
Note the subtle differences in the CMake var names and the path to include, not include/tbb.Let me know how that goes

Related

vcpkg using local install of boost instead of vcpkg install

I am trying to build with cmake and vcpkg. I installed some packages including boost (iostreams, serialization and system) with vcpkg. Additionally, I have a local install of boost without these components. When i try to build, I get the following error:
C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.20/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
C:/dev/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
CMakeLists.txt:168 (FIND_PACKAGE)
The CMakeCache.txt has the following line:
//Path to a file.
Boost_INCLUDE_DIR:PATH=C:/boost/boost_1_66_0
which is the path to my local install. How can I get cmake to use the boost install from vcpkg?
EDIT:
To anoyone coming to this question in the future, I came across this PR where they apparently fixed the problem. However, I still get the same error when installing OpenMVS.

Cmake error: unsuitable Qt version

I'm trying to run cmake via cmd (Windows) on a project I downloaded from GitHub, using cmake.
However, I'm getting the following error:
-- Found unsuitable Qt version "5.6.2" from C:/Anaconda2/Library/bin/qmake.exe
CMake Error at 3rdParty/FindMatlab-rwp.cmake:50 (MESSAGE):
Generator not compatible: MinGW Makefiles
Call Stack (most recent call first):
CMakeLists.txt:427 (find_package)
Any ideas what might be wrong? I tried to find info about the Qt mentioned, but I came up with nothing.

qttorch Build Error Ubuntu 14.04

I'm trying to install qttorch package on Ubuntu 14.04,
but I get this error during installation:
CMake Warning at /usr/share/cmake-3.2/Modules/FindQt4.cmake:626 (message):
/usr/bin/qmake reported QT_INSTALL_LIBS as "/usr/lib/x86_64-linux-gnu" but
QtCore could not be found there. Qt is NOT installed correctly for the
target build environment.
Call Stack (most recent call first):
CMakeLists.txt:38 (FIND_PACKAGE)
CMake Error at /usr/share/cmake-3.2/Modules/FindQt4.cmake:634 (message):
Could NOT find QtCore. Check
/tmp/luarocks_qtlua-scm-1-2765/qtlua/build/CMakeFiles/CMakeError.log for
more details.
Call Stack (most recent call first):
CMakeLists.txt:38 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_qtlua-scm-1-2765/qtlua/build/CMakeFiles/CMakeOutput.log".
Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/qtlua-scm-1.rockspec - Build error: Failed building.
Is libqtcore4 the right package for QTCore? or is there another package that should be installed?
because it's already installed in "/usr/lib/x86_64-linux-gnu" as qmake reported!
I also tried reinstalling it, but still the same error!!
In most Linux distributions the packages are split between development and none-development parts. Usually the normal package only includes the shared library, data and executables while the dev package adds headers, static libraries and build tools like qmake. I assume this split is done to save space.
For ubuntu the dev packages usually has the -dev suffix. So try if a libqtcore4-dev package exists. Otherwise, libqt4-dev should include it.

Make Qt5 default for Cmake

I am trying to build amarok in my ubuntu 12. I have installed Qt5 and Qt4.8.1 both in my PC. When I am trying to build and I am getting the following error in Cmake.
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find Qt4: Found unsuitable version "4.8.2", but required is at least "4.8.3" (found /usr/bin/qmake) Call Stack (most recent call first): /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:313 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-2.8/Modules/FindQt4.cmake:1393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:83 (find_package)
You need to use the Qt5 specific CMake functions, as documented on the Qt5 CMake documentation page:
cmake_minimum_required(VERSION 2.8.11)
find_package(Qt5Core)
Then there isn't any Qt 4 involved. Anywhere.

Attempting to compile with cmake

I'm attempting to compile a program with dependencies in Cmake and Qt (on Mountain Lion). The code
cmake build
returns
CMake Error at /Applications/CMake 2.8-12.app/Contents/share/cmake-2.8/Modules/FindQt4.cmake:1386 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:195 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
The current Qt version is 5.1.1, which I have installed in ~/bin/ and I'm not sure how to get Cmake to find it.
The error is saying this code requires Qt 4.x then for what are you wandering? it is due to line FIND_PACKAGE(Qt4 REQUIRED) though Cmake version should support Qt5 but may be your CmakeList is not proper written for that.
Follow this document to correct your CmakeList.