MantisBT - CMake
View Issue Details
0008529CMakeModulespublic2009-02-12 23:452010-11-09 22:57
Philip Lowman 
Philip Lowman 
normalminoralways
closedfixed 
CMake-2-6 
CMake 2.8.3CMake 2.8.3 
0008529: FindBoost is unable to detect Boost libraries compiled against STLport
As reported on the CMake mailing list, FindBoost is unable to detect Boost libraries compiled against STLport.

http://www.boost.org/doc/libs/1_38_0/more/getting_started/windows.html#library-naming [^]
Filenames:

boost_date_time-vc80-mt-gdp-1_38.dll
boost_date_time-vc80-mt-gdp-1_38.lib
boost_date_time-vc80-mt-gdp.lib
boost_date_time-vc80-mt-p-1_38.dll
boost_date_time-vc80-mt-p-1_38.lib
boost_date_time-vc80-mt-p.lib
boost_thread-vc80-mt-gdp-1_38.dll
boost_thread-vc80-mt-gdp-1_38.lib
boost_thread-vc80-mt-gdp.lib
boost_thread-vc80-mt-p-1_38.dll
boost_thread-vc80-mt-p-1_38.lib
boost_thread-vc80-mt-p.lib
libboost_date_time-vc80-mt-gdp-1_38.lib
libboost_date_time-vc80-mt-gdp.lib
libboost_date_time-vc80-mt-p-1_38.lib
libboost_date_time-vc80-mt-p.lib
libboost_date_time-vc80-mt-sgdp-1_38.lib
libboost_date_time-vc80-mt-sgdp.lib
libboost_date_time-vc80-mt-sp-1_38.lib
libboost_date_time-vc80-mt-sp.lib
libboost_date_time-vc80-sgdp-1_38.lib
libboost_date_time-vc80-sgdp.lib
libboost_date_time-vc80-sp-1_38.lib
libboost_date_time-vc80-sp.lib
libboost_thread-vc80-mt-gdp-1_38.lib
libboost_thread-vc80-mt-gdp.lib
libboost_thread-vc80-mt-p-1_38.lib
libboost_thread-vc80-mt-p.lib
libboost_thread-vc80-mt-sgdp-1_38.lib
libboost_thread-vc80-mt-sgdp.lib
libboost_thread-vc80-mt-sp-1_38.lib
libboost_thread-vc80-mt-sp.lib
No tags attached.
diff FindBoost.cmake.diff (1,186) 2009-02-13 08:44
https://public.kitware.com/Bug/file/2053/FindBoost.cmake.diff
? FindBoost.cmake (48,989) 2010-09-08 00:27
https://public.kitware.com/Bug/file/3361/FindBoost.cmake
Issue History
2009-02-12 23:45Philip LowmanNew Issue
2009-02-13 08:44Mike JacksonFile Added: FindBoost.cmake.diff
2009-02-13 08:45Mike JacksonNote Added: 0014924
2009-02-13 09:40Philip LowmanNote Added: 0014926
2009-07-18 10:49Philip LowmanStatusnew => assigned
2009-07-18 10:49Philip LowmanAssigned To => Philip Lowman
2010-09-08 00:27Philip LowmanNote Added: 0022124
2010-09-08 00:27Philip LowmanFile Added: FindBoost.cmake
2010-09-10 08:42Philip LowmanETAnone => < 1 day
2010-09-10 08:42Philip LowmanTarget Version => CMake 2.8.3
2010-09-12 22:28Philip LowmanNote Added: 0022195
2010-09-12 22:28Philip LowmanStatusassigned => resolved
2010-09-12 22:28Philip LowmanFixed in Version => CMake 2.8.3
2010-09-12 22:28Philip LowmanResolutionopen => fixed
2010-11-09 22:57Philip LowmanStatusresolved => closed

Notes
(0014924)
Mike Jackson   
2009-02-13 08:45   
Patch attached. Please try this out.
(0014926)
Philip Lowman   
2009-02-13 09:40   
I considered the same patch. Because _boost_ABI_TAG is not used during RELEASE you would miss this case below:


boost_thread-vc80-mt-p-1_38.lib
boost_thread-vc80-mt-p.lib

One approach would be to make _boost_ABI_TAG be what it should be, the ABI tags, and get rid of _boost_STATIC_TAG. I haven't done much work here but I was thinking building up two versions of the ABI_TAG, one for RELEASE and one for DEBUG incrementally in the order the options are defined by Boost...


  set( _boost_ABI_TAG "-")
  set( _boost_ABI_TAG_DEBUG "-")
  # Build the ABI tag in the following order
  # "s" => linking statically to the C++ standard library and compiler
  # runtime support libraries (MSVC)
  if(WIN32 AND Boost_USE_STATIC_LIBS )
    set( _boost_ABI_TAG "${_boost_ABI_TAG}s")
    set( _boost_ABI_TAG_DEBUG "${_boost_ABI_TAG_DEBUG}s")
  endif()
  # "g" => using debug versions of the standard and runtime support
  # libraries
  if(WIN32 AND MSVC)
    set( _boost_ABI_TAG_DEBUG "${_boost_ABI_TAG_DEBUG}g")
  endif()
  # "y" => using special debug build of Python
  # libraries
etc.

Then the actual find_library check could be simplified and the code would also be far more readable. Please feel free to complete the patch if you like this approach and have time.
(0022124)
Philip Lowman   
2010-09-08 00:27   
I have implemented the approach I suggested on 2009-02-13 primarily to fix another issue (0011160). Adding support for STLport was trivial. Attached is a preliminary version for testing.
(0022195)
Philip Lowman   
2010-09-12 22:28   
Fix will be in CMake 2.8.3 RC1