Hi Robert,

at least for the boost libraries, it was already a dirty workaround:

Boost encodes the used toolset into the library names. Toolset v120 generated a 
filename called libboost_system-vc120-mt-gd-1_63 for example. 

In FindCollada.cmake, it is searched by using 
libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_63. It pretends to refer to the 
COLLADA_BUILDNAME, but actually it uses the toolset  encoded in the filename 
(vc120) by suffixing a "0". This does not longer work as v141 does not end with 
"0".


Here are some background information from the VS world:

Visual Studio release name is different from Visual C (VC) release name. For 
example, VS 2013 is often referred to as MSVC12 ( Visual C 12 compiler)

Each compiler version uses a different toolset.  Until VS 2015, you suffix the 
VS version with "0", and you got the platform toolset. (VS2013 -> VC12 -> v120; 
VS2015->VC14->v140). 
However, since VS 2017 this does not work any longer because its toolset is 
called v141.

Why not a new number for a new Visual Studion release? Because v141 is binary 
compatible with 140, therefore namend 141. [1]


However, 141 and 140 are binary compatible, not identical. Since other 
libraries encode the toolset version in the libraryname (which makes perfectly 
sense), we need a mechanism to find this files. CMakes current design decision 
not to provide [2] a corresponding MSVC Variable for VS 2017 is very bad. It 
does not allow to differentiate between 140 and 141. Finally it prevents us to 
continue  the search logic currently used in FindCollada.cmake

So what should we do in FindCollada.cmake?
Just adding the suffix to the BUILD_COLLADA variable to match the full toolset 
will likely brake same search pathes like ${COLLADA_DOM_ROOT}/build/ or     
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4 if the are used on windows. 

To make things even more confusing, there is a fuzzyness in the naming 
conventions:
The toolset is cleary prefixed with a "v" like "v120", but many projects use 
"vc" as a prefix. Therefor I introduced the Variable 
CMAKE_VS_PLATFORM_TOOLSET_VC_PREFIXED, wich outputs the toolset with a VC 
prefix as it is used by boost (e.g. vc141 for Visual Studio 2017).

What do you think?

Torben



[1] 
https://blogs.msdn.microsoft.com/vcblog/2017/03/07/binary-compatibility-and-pain-free-upgrade-why-moving-to-visual-studio-2017-is-almost-too-easy/
 
[2] 
http://cmake.3232098.n2.nabble.com/MSVC15-variable-available-for-Visual-Studio-2017-td7594850.html
 (both posts)

-----Ursprüngliche Nachricht-----
Von: osg-submissions [mailto:[email protected]] 
Im Auftrag von Robert Osfield
Gesendet: Mittwoch, 5. April 2017 10:55
An: OpenSceneGraph Submissions <[email protected]>
Betreff: Re: [osg-submissions] Update to FindCollada.cmake

Hi Torben,

I feel that VS specific mechanisms should be wrapped up into more cross 
platform ones where possible so the bulk of the Find script isn't related to VS 
specific CMake variable, instead having these platform specific Cmake variables 
localized.  I.e. what the COLLADA_BUILDNAME has been doing just fine for years.

Robert.

On 5 April 2017 at 08:36, Torben Dannhauer <[email protected]> wrote:
> Hm ok, what is your suggested way to decouple the platform toolset from the 
> MSVC version in the CMake files? This is relatively new in VS and it will 
> take some time until all CMake projects adapt it and use a different approach 
> than the current MSVC version...
> Since collada seems to be unmaintained, I double there will be any adaption..
>
> One solution would be to guard it, something like this:
>
> IF(APPLE)
>     SET(COLLADA_BUILDNAME "mac")
> ELSEIF(MINGW)
>     SET(COLLADA_BUILDNAME "mingw")
> ELSEIF(MSVC14)
>     SET(COLLADA_BUILDNAME "vc14")
> ELSEIF(MSVC12)
>     SET(COLLADA_BUILDNAME "vc12")
> ELSEIF(MSVC11)
>     SET(COLLADA_BUILDNAME "vc11")
> ELSEIF(MSVC10)
>     SET(COLLADA_BUILDNAME "vc10")
> ELSEIF(MSVC90)
>     SET(COLLADA_BUILDNAME "vc9")
> ELSEIF(MSVC80)
>     SET(COLLADA_BUILDNAME "vc8")
> ELSE(APPLE)
>   SET(COLLADA_BUILDNAME "linux")
> ENDIF(APPLE)
>
> IF (CMAKE_VS_PLATFORM_TOOLSET)
>         string(REPLACE "v" "vc" CMAKE_VS_PLATFORM_TOOLSET_VC_PREFIXED 
> ${CMAKE_VS_PLATFORM_TOOLSET}) ELSE
>         set(CMAKE_VS_PLATFORM_TOOLSET_VC_PREFIXED $( 
> COLLADA_BUILDNAME)) ENDIF
>
> Torben
>
>
> -----Ursprüngliche Nachricht-----
> Von: osg-submissions 
> [mailto:[email protected]] Im Auftrag 
> von Robert Osfield
> Gesendet: Mittwoch, 5. April 2017 09:29
> An: OpenSceneGraph Submissions 
> <[email protected]>
> Betreff: Re: [osg-submissions] Update to FindCollada.cmake
>
> HI Torben,
>
> I just added a :
>
>    MESSAGE("CMAKE_VS_PLATFORM_TOOLSET = " 
> ${CMAKE_VS_PLATFORM_TOOLSET})
>
> And it's blank.  My guess is it's not defined - I'm under Linux so I can't 
> imagine a VS specific CMake variable being relevant.
>
> Robert.
>
>
>
>
> On 5 April 2017 at 08:20, Torben Dannhauer <[email protected]> wrote:
>> Indeed, time is running fast. :))
>>
>> Regarding CMake:
>>
>> Strange, the relevant line is this:
>>
>> string(REPLACE "v" "vc" CMAKE_VS_PLATFORM_TOOLSET_VC_PREFIXED
>> ${CMAKE_VS_PLATFORM_TOOLSET})
>>
>> For me it seems that REPLACE has exactly 4 arguments. What is your 
>> content of ${CMAKE_VS_PLATFORM_TOOLSET} ?
>>
>> Torben
>>
>> -----Ursprüngliche Nachricht-----
>> Von: osg-submissions
>> [mailto:[email protected]] Im Auftrag 
>> von Robert Osfield
>> Gesendet: Mittwoch, 5. April 2017 09:03
>> An: OpenSceneGraph Submissions
>> <[email protected]>
>> Betreff: Re: [osg-submissions] Update to FindCollada.cmake
>>
>> HI Torben,
>>
>> On 5 April 2017 at 07:55, Torben Dannhauer <[email protected]> wrote:
>>> Hi Robert, thanks for the feedback! Can you try the current Cmake release?
>>
>> I don't have a particular old version of cmake - using the one that 
>> came with Kubuntu 16.04., Forcing users to use recent cmake releases 
>> will affect lots of users so it's not something I'm willing to do 
>> this close to new stable release.  If we do require a big step up in 
>> cmake version then it'd need to be some very significant functionality.
>>
>>> I'll look into it as soon as my daughter sleeps (~30min).
>>
>> Ahhh that takes me back, way back :-)
>>
>> My three daughters put themselves to bed now, one typically after I 
>> go to bed  - she's 18 in a couple months, jikes I must be getting old...
>>
>> Cheers,
>> Robert.
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.
>> org
>>
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscen
>> e
>> graph.org
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscene
> graph.org
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscene
> graph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to