[CMake] Removing debug and optimized prefixes

Rolf Eike Beer eike at sf-mail.de
Thu Aug 15 09:16:04 EDT 2013


Am 15.08.2013 14:03, schrieb Alvaro Aguilera:
> Thank you for responding.
> 
> I found out that the problem was in the FindProtobuf module shipped 
> with
> opensuse.
> As a workaround I'm using the following line after 
> find_package(Protobuf):
> 
> list(REMOVE_ITEM PROTOBUF_LIBRARIES "debug" "optimized")
> 
> Here are the calls to add_library() and target_link_libraries(), just
> for the record:
> 
> --------------------------
> add_library(
>     mytarget SHARED
>     some-code.cpp
>     "${PROTO_SRCS}"
>     "${PROTO_HDRS}"
> )
> 
> target_link_libraries(
>     mytarget
>     "${PROTOBUF_LIBRARIES}"
>     "${Boost_LIBRARIES}"
> )

Remove the quotes, then it will work.

target_link_libraries(
     mytarget
     ${PROTOBUF_LIBRARIES}
     ${Boost_LIBRARIES}
)

Greetings,

Eike


More information about the CMake mailing list