[OGRE 2.x, CMake] VS2013 and Intel TBB don't found

Minor issues with the Ogre API that can be trivial to fix
hydexon
Gremlin
Posts: 164
Joined: Sun Apr 14, 2013 8:51 pm
x 10

[OGRE 2.x, CMake] VS2013 and Intel TBB don't found

Post by hydexon »

When i'm building Ogre 2.1 with Intel TBB seems CMake couldn't find it even if i setting up correctly the environment variables (worked previously with 2012), but after a quick search in the CMake modules of the distribution i find the problem:

in CMake/Packages/FindTBB.cmake at line 52 to 66

Code: Select all

if (WIN32 AND MSVC)
  set(COMPILER_PREFIX "vc7.1")
  if (MSVC_VERSION EQUAL 1400)
    set(COMPILER_PREFIX "vc8")
  endif ()
  if (MSVC_VERSION EQUAL 1500)
    set(COMPILER_PREFIX "vc9")
  endif ()
  if (MSVC_VERSION EQUAL 1600)
    set(COMPILER_PREFIX "vc10")
  endif ()
  if (MSVC_VERSION EQUAL 1700)
    set(COMPILER_PREFIX "vc11")
  endif ()
CMake stops to find until Visual Studio 2012, and isn't not found with the compiler of those selected above, will default to another or disabled, but is very easy to fix it doing this:

Code: Select all

if (WIN32 AND MSVC)
  set(COMPILER_PREFIX "vc7.1")
  if (MSVC_VERSION EQUAL 1400)
    set(COMPILER_PREFIX "vc8")
  endif ()
  if (MSVC_VERSION EQUAL 1500)
    set(COMPILER_PREFIX "vc9")
  endif ()
  if (MSVC_VERSION EQUAL 1600)
    set(COMPILER_PREFIX "vc10")
  endif ()
  if (MSVC_VERSION EQUAL 1700)
    set(COMPILER_PREFIX "vc11")
  endif ()
  if (MSVC_VERSION EQUAL 1800)
    set(COMPILER_PREFIX "vc12")
  endif ()
Which makes to detect Intel TBB again for Visual Studio 2013, and compile normally, i would do a pull request for that but never touched Mercurial, sorry, only use it to pull the recent changes.