[vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017

Elvis Stansvik elvis.stansvik at orexplore.com
Sun Aug 19 08:00:10 EDT 2018


2018-08-19 12:13 GMT+02:00 Andras Lasso <lasso at queensu.ca>:
> You need to specify a 64-bit generator in CMake if you want to build a
> 64-bit application.

Yes, I finally figured out my mistake. Thanks!

Elvis

>
> Andras
> ________________________________
> From: Elvis Stansvik <elvis.stansvik at orexplore.com>
> Sent: Sunday, August 19, 2018 10:54 AM
> To: VTK Users
> Subject: Re: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1
> and VTK 8.1.1 on Win 10/MSVC 2017
>
> 2018-08-19 10:45 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
>> 2018-08-19 10:05 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
>>> Hey all,
>>>
>>> In the past it was worked for us to depend on VTK 8.1 with
>>>
>>>     find_package(VTK 8.1 ....)
>>>
>>> But now I'm having trouble with a setup like this:
>>>
>>>     - Windows 10
>>>     - CMake 3.12.1
>>>     - VTK 8.1.1
>>>
>>> The error I get when configuring our project is:
>>>
>>> -- Selecting Windows SDK version 10.0.17134.0 to target Windows
>>> 10.0.16299.
>>> CMake Error at CMakeLists.txt:29 (find_package):
>>>   Could not find a configuration file for package "VTK" that is
>>> compatible
>>>   with requested version "8.1".
>>>
>>>   The following configuration files were considered but not accepted:
>>>
>>>     C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake,
>>> version: 8.1.1 (64bit)
>>>
>>> This is nonsensical to me. Version 8.1.1 (which was found) should be
>>> able to satisfy 8.1.
>>
>> By digging in VTKConfigVersion.cmake I've found out that this is due
>> to some 32/64 bit mismatch (would be nice with a better error
>> message).
>>
>> I.e. this check is failing:
>>
>> # check that the installed version has the same 32/64bit-ness as the
>> one which is currently searching:
>> if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
>>   math(EXPR installedBits "8 * 8")
>>   set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
>>   set(PACKAGE_VERSION_UNSUITABLE TRUE)
>> endif()
>
> So ${CMAKE_SIZEOF_VOID_P} is 4 on this computer (just printed it with
> message(..)), despite
>
> 1) CMake is installed from cmake-3.12.1-win64-x64.msi
> 2) The computer is 64 bit
> 3) The OS is 64 bit
> 4) It's run in a MSVC native x64 command prompt
>
> Is this a CMake bug? Or should the check above be rewritten somehow?
>
> Elvis
>
>>
>> I'll try to figure out where I went wrong, but I'm pretty sure
>> everything has been done in a MSVC 64-bit native command prompt, and
>> the machine is 64-bit.
>>
>> Elvis
>>
>>>
>>> Just to test, I set the dependency in our CMakeLists.txt to exactly
>>> 8.1.1, and got:
>>>
>>> -- Selecting Windows SDK version 10.0.17134.0 to target Windows
>>> 10.0.16299.
>>> CMake Error at CMakeLists.txt:29 (find_package):
>>>   Could not find a configuration file for package "VTK" that is
>>> compatible
>>>   with requested version "8.1.1".
>>>
>>>   The following configuration files were considered but not accepted:
>>>
>>>     C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake,
>>> version: 8.1.1 (64bit)
>>>
>>> Which makes it obvious something is not right.
>>>
>>> For reference, cmake was invoked like
>>>
>>>     cmake
>>> -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst
>>> ..
>>>
>>> where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of
>>> VTK.
>>>
>>> Any ideas? Was there some change in CMake recently that could have caused
>>> this?
>>>
>>> Many thanks in advance,
>>> Elvis
> _______________________________________________
> Powered by
> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585462737&sdata=83h1ptlXTNaPMoYKBlnIDdiI0GcQZ%2BTk7aoUOH6%2BcKE%3D&reserved=0
>
> Visit other Kitware open-source projects at
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=snPd2d0Lz3yK8gx70%2BGP%2FrsysC259odxCi78gbth4Ro%3D&reserved=0
>
> Please keep messages on-topic and check the VTK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=VwPEkjGzeuHP8M8%2FPmUnUjJ2J9L6Ix71C%2FlVnxDeIFw%3D&reserved=0
>
> Search the list archives at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=aLdQIAKjm8yNuOVYelhvKeenVmljp6aPSsgqv94q53c%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=nwkOPmpamQWMns5cbibwKELToXugVVoEe7x810Va%2FRs%3D&reserved=0


More information about the vtkusers mailing list