Comment faire un lien google protobuf bibliothèques via cmake sur linux?

Je suis en train de faire la même façon que je l'ai fait pour boost :

find_package(Boost COMPONENTS system filesystem REQUIRED)                                                    
find_package(ProtocolBuffers)                                                                                

## Compiler flags                                                                                            
if(CMAKE_COMPILER_IS_GNUCXX)                                                                                 
    set(CMAKE_CXX_FLAGS "-O2")                                                                               
    set(CMAKE_EXE_LINKER_FLAGS "-lsqlite3 -lrt -lpthread")                                                   
endif()                                                                                                      

target_link_libraries(complex                                                                                
  ${Boost_FILESYSTEM_LIBRARY}                                                                                
  ${Boost_SYSTEM_LIBRARY}                                                                                    
  ${PROTOBUF_LIBRARY}                                                                                        
)  

(googlé ça quelque part), mais a obtenu de mauvais de sortie:

CMake Warning at complex/CMakeLists.txt:18 (find_package):
  Could not find module FindProtocolBuffers.cmake or a configuration file for
  package ProtocolBuffers.

  Adjust CMAKE_MODULE_PATH to find FindProtocolBuffers.cmake or set
  ProtocolBuffers_DIR to the directory containing a CMake configuration file
  for ProtocolBuffers.  The file will have one of the following names:

    ProtocolBuffersConfig.cmake
    protocolbuffers-config.cmake

Comment puis-je lier avec cmake? ou peut-être que j'ai même pouvez compiler .proto fichier en utilisant cmake?

InformationsquelleAutor cnd | 2012-04-04