[CMake] Linking Boost on Linux on 64bit host and 32bit

Knox, Kent Kent.Knox at amd.com
Thu Nov 4 11:27:43 EDT 2010


Hi Andreas~

[Andreas]
Did you try to print out the value of Boost_LIBRARIES? Does that contain the proper absolute path to the boost library? Are you actually using that variable for your target_link_libraries call? The make-output looks like either the variable doesn't get the right value which shouldn't happen as its set using find_library or you're not using the variable but instead simply pass "program_options" to the target_link_libraries call. Oh and whats the value of Boost_program_options_LIBRARY?

[Kent]
To answer your questions, one at a time:

[Andreas] Did you try to print out the value of Boost_LIBRARIES?
-- Boost_LIBRARIES: /usr/lib/libboost_program_options-mt.a

[Kent] That looks wrong right there, I would expect it to be pointing to the value of my BOOST_ROOT and BOOST_LIBRARYDIR.

[Andreas] Are you actually using that variable for your target_link_libraries call?
IF( WIN32 )
	target_link_libraries( clAmd.Client clAmd.Runtime ${Boost_LIBRARIES} OpenCL.lib )
ELSEIF( UNIX )
	message( STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}" )
	message( STATUS "Boost_program_options_LIBRARY: ${Boost_program_options_LIBRARY}" )
	target_link_libraries( clAmd.Client clAmd.Runtime ${Boost_LIBRARIES} OpenCL.so )
ENDIF()

[Andreas] Oh and whats the value of Boost_program_options_LIBRARY?
-- Boost_program_options_LIBRARY:

[Kent] Nothing was set





More information about the CMake mailing list