Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake propblem with boost #945

Open
karimnorouzi opened this issue Sep 6, 2022 · 2 comments
Open

CMake propblem with boost #945

karimnorouzi opened this issue Sep 6, 2022 · 2 comments

Comments

@karimnorouzi
Copy link

I get this weierd propblem with boost:

CMake Error at C:/.../cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: system date_time log filesystem thread
program_options) (found suitable version "1.74.0", minimum required is
"1.74.0")
Call Stack (most recent call first):
C:/.../cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/cmake-3.22.0-windows-x86_64/share/cmake-3.22/Modules/FindBoost.cmake:2360 (find_package_handle_standard_args)
CMakeLists.txt:139 (FIND_PACKAGE)

@redboltz
Copy link
Owner

redboltz commented Sep 7, 2022

It seems that the issue is caused by your environment.
cmake couldn't find boost on your environment.

Here is my way to find boost on Azure build pipelines.
I'm not cmake expert it is extremelty difficult for me but the following setting might help you.

- powershell: |
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.78.0/boost_1_78_0-msvc-14.2-64.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=C:\hostedtoolcache\windows\Boost\1.78.0\x86_64"
displayName: 'install boost'
- powershell: |
git submodule update --init --recursive
if (!$?) {
return Write-Error "git submodule update --init --recursive failed"
}
mkdir build
cd build
$env:CL="/D_WIN32_WINNT#0x0601 /DBOOST_THREAD_VERSION#3 /DBOOST_ALLOW_DEPRECATED_HEADERS /DBOOST_ASIO_NO_DEPRECATED"
$env:BOOST_ROOT="C:\hostedtoolcache\windows\Boost\1.78.0\x86_64"
$env:PATH="$env:BOOST_ROOT\lib64-msvc-14.2;"+$env:PATH
cmake -A x64 -DMQTT_USE_TLS=$(MQTT_USE_TLS) -DMQTT_USE_WS=$(MQTT_USE_WS) -DMQTT_USE_STR_CHECK=$(MQTT_USE_STR_CHECK) -DMQTT_TEST_1=$(MQTT_TEST_1) -DMQTT_TEST_2=$(MQTT_TEST_2) -DMQTT_TEST_3=$(MQTT_TEST_3) -DMQTT_TEST_4=$(MQTT_TEST_4) -DMQTT_TEST_5=$(MQTT_TEST_5) -DMQTT_TEST_6=$(MQTT_TEST_6) -DMQTT_TEST_7=$(MQTT_TEST_7) -DMQTT_BUILD_EXAMPLES=$(MQTT_BUILD_EXAMPLES) ..

See
https://cmake.org/cmake/help/latest/module/FindBoost.html

@ineffective
Copy link

@karimnorouzi I am by no means an expert on CMake build files and boost, but it seems that all libraries that can't be found are libraries that are not header-only, that is regular library (static or dynamic) is required. I would check if you have installed them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants