Vcpkg: How to make a 64bit build of some cmake project?

Created on 5 Dec 2018  路  2Comments  路  Source: microsoft/vcpkg

I have some cmake project using some 3rd party library (available as a vcpkg package), say zeromq.

I installed the x64 version of it (vcpkg install zeromq:x64-windows), and if I go to build my project, it complains about zeromq not available:

C:\Development\myproject\build> cmake -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ..
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.14393.
-- The C compiler identification is MSVC 19.16.27024.1
-- The CXX compiler identification is MSVC 19.16.27024.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
...
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package):
  Could not find a configuration file for package "ZeroMQ" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    C:/vcpkg/installed/x64-windows/share/zeromq/ZeroMQConfig.cmake, version: 4.3.1 (64bit)

So I tryed to specify the VCPKG_TARGET_TRIPLET, but I get this result:

C:\Development\myproject\build> cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ..
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.14393.
-- The C compiler identification is MSVC 19.16.27024.1
-- The CXX compiler identification is MSVC 19.16.27024.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
...
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package):
  Could not find a configuration file for package "ZeroMQ" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    C:/vcpkg/installed/x64-windows/share/zeromq/ZeroMQConfig.cmake, version: 4.3.1 (64bit)

What is the proper way to build a project in 64 bit mode via cmake?

Most helpful comment

-DCMAKE_GENERATOR_PLATFORM=x64
-DCMAKE_CL_64=1 
-Ax64

cmake .. -LA -DCMAKE_INSTALL_PREFIX:PATH="../Rel" -DCMAKE_CL_64=1 -DVCPKG_TARGET_TRIPLET=x64-windows-static -G"Visual Studio 15 2017" -Ax64 -Wno-dev -DCMAKE_PREFIX_PATH="E:/tools/vcpkg/installed/x64-windows-static" -DCMAKE_TOOLCHAIN_FILE="E:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_GENERATOR_PLATFORM=x64

msbuild /p:Platform=x64

cmake --build . -- /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:TargetPlatformVersion="10.0.17134.0" /p:VcpkgTriplet=x86-windows-static

All 2 comments

Not a vcpkg issue and this is also not stackoverflow.

If you do not now how to use cmake correctly I urge you to read the manual/docs and simply pass the correct generator ( -G "Visual Studio 15 2017 Win64" ) or use the gui of cmake where a list of generators is displayed. Also a search in the web should have answered your question.

So please close this issue.

-DCMAKE_GENERATOR_PLATFORM=x64
-DCMAKE_CL_64=1 
-Ax64

cmake .. -LA -DCMAKE_INSTALL_PREFIX:PATH="../Rel" -DCMAKE_CL_64=1 -DVCPKG_TARGET_TRIPLET=x64-windows-static -G"Visual Studio 15 2017" -Ax64 -Wno-dev -DCMAKE_PREFIX_PATH="E:/tools/vcpkg/installed/x64-windows-static" -DCMAKE_TOOLCHAIN_FILE="E:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_GENERATOR_PLATFORM=x64

msbuild /p:Platform=x64

cmake --build . -- /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:TargetPlatformVersion="10.0.17134.0" /p:VcpkgTriplet=x86-windows-static

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oahzuw picture oahzuw  路  3Comments

ThinkalVB picture ThinkalVB  路  3Comments

cskrisz picture cskrisz  路  3Comments

ghost picture ghost  路  3Comments

madkoala picture madkoala  路  3Comments