View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012188CMakeModulespublic2011-05-13 11:232012-01-19 09:59
Reportersutasu 
Assigned ToPhilip Lowman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSubuntuOS Version11.04
Product VersionCMake 2.8.4 
Target VersionCMake 2.8.5Fixed in VersionCMake 2.8.5 
Summary0012188: FindBoost: ${Boost_LIBRARIES} contains extra 'optimized' and 'debug' key words making impossible install
Description'optimized' and 'debug' key words are present in ${Boost_LIBRARIES} variable making impossible to use it in install command
Steps To ReproduceFollowing test case fails:

cmake_minimum_required(VERSION 2.6)
project( test )
set (Boost_REALPATH "1")
find_package(Boost REQUIRED system date_time filesystem thread regex)
message("${Boost_LIBRARIES}")
add_executable (test test.cpp )
target_link_libraries (test ${Boost_LIBRARIES} )
install ( FILES ${Boost_LIBRARIES} DESTINATION bin )
install ( TARGETS test DESTINATION bin )
include (CPack)


$ cmake .. -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.42.0
-- Found the following Boost libraries:
-- system
-- date_time
-- filesystem
-- thread
-- regex
optimized;/usr/lib/libboost_system.so.1.42.0;debug;/usr/lib/libboost_system.so.1
.42.0;optimized;/usr/lib/libboost_date_time.so.1.42.0;debug;/usr/lib/libboost_da
te_time.so.1.42.0;optimized;/usr/lib/libboost_filesystem.so.1.42.0;debug;/usr/li
b/libboost_filesystem.so.1.42.0;optimized;/usr/lib/libboost_thread.so.1.42.0;deb
ug;/usr/lib/libboost_thread.so.1.42.0;optimized;/usr/lib/libboost_regex.so.1.42.
0;debug;/usr/lib/libboost_regex.so.1.42.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/stanislav/cmake_test/build



$ make
Scanning dependencies of target test
[100%] Building CXX object CMakeFiles/test.dir/test.cpp.o
Linking CXX executable test
[100%] Built target test


$ cpack -G TGZ CPackConfig.cmake
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: test
CPack: - Install project: test
CMake Error at /home/stanislav/cmake_test/build/cmake_install.cmake:36 (FILE):
  file INSTALL cannot find "/home/stanislav/cmake_test/optimized".

CPack Error: Error when generating package: test
Additional Informationtest case attached
TagsNo tags attached.
Attached Filestgz file icon tst.tgz [^] (546 bytes) 2011-05-13 11:23
? file icon FindBoost.cmake [^] (52,179 bytes) 2011-05-26 01:30

 Relationships
related to 0012887closedPhilip Lowman FindBoost: ${Boost_LIBRARIES} contains extra 'optimized' and 'debug' key words making impossible install 

  Notes
(0026612)
Philip Lowman (developer)
2011-05-26 01:34

Thank you for including the test code in your report. The Boost_REALPATH work was contributed from another user and I hadn't messed around with packaging things with CPack.

The easiest workaround is obviously just to remove the debug & optimized keywords from the _LIBRARIES variable if you aren't using boost debug libraries.
list(REMOVE_ITEM Boost_LIBRARIES debug)
list(REMOVE_ITEM Boost_LIBRARIES optimized)

As a more long-term fix of the workaround, I've attached the following version where I omit the debug/optimized keywords if debug & release filenames are detected but end up being the same. I believe this was the goal of the code all along so I'm not sure if something broke here or if it never worked at all.

I'll plan on checking this in.

These kludges only work if you don't have separate debug libraries. If you actually had to package based on build type and dependent libraries there probably is a better way. You could check on the CMake mailing list for suggestions here.
(0026618)
sutasu (reporter)
2011-05-26 10:34

My project broke on transitioning from ubuntu 10.10 to 11.04 and I had to use similar workaround.
Now with the new file is works. I think that this fix is good enough since it will cover most of the cases when you need to build/pack pure debug or release product. Thank you
(0027765)
David Cole (manager)
2011-11-11 10:45

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-05-13 11:23 sutasu New Issue
2011-05-13 11:23 sutasu File Added: tst.tgz
2011-05-26 00:57 Philip Lowman Assigned To => Philip Lowman
2011-05-26 00:57 Philip Lowman Status new => assigned
2011-05-26 01:30 Philip Lowman File Added: FindBoost.cmake
2011-05-26 01:34 Philip Lowman Note Added: 0026612
2011-05-26 10:34 sutasu Note Added: 0026618
2011-06-15 08:29 Philip Lowman Priority high => normal
2011-06-15 08:29 Philip Lowman Severity major => minor
2011-06-15 08:29 Philip Lowman Status assigned => resolved
2011-06-15 08:29 Philip Lowman Resolution open => fixed
2011-06-15 08:29 Philip Lowman Fixed in Version => CMake 2.8.5
2011-06-15 08:29 Philip Lowman Target Version => CMake 2.8.5
2011-11-11 10:45 David Cole Note Added: 0027765
2011-11-11 10:45 David Cole Status resolved => closed
2012-01-19 09:59 Brad King Relationship added related to 0012887


Copyright © 2000 - 2018 MantisBT Team