Files
rippled/external/protobuf/test_package/CMakeLists.txt
Bronek Kozicki dd68fe0e2c Add external/protobuf
Only needed until this PR is merged
https://github.com/conan-io/conan-center-index/pull/27982
2025-07-24 09:33:35 +01:00

29 lines
897 B
CMake

cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)
find_package(protobuf CONFIG REQUIRED)
add_executable(${PROJECT_NAME} test_package.cpp)
if(CONAN_TEST_USE_CXXSTD_14)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
endif()
if (protobuf_LITE)
target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite)
target_compile_definitions(${PROJECT_NAME} PRIVATE CONANTEST_PROTOBUF_LITE=1)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf)
endif()
if(NOT TARGET protobuf::protoc)
message(FATAL_ERROR "protoc executable should have been defined as part of find_package(protobuf)")
endif()
if(NOT COMMAND protobuf_generate)
message(FATAL_ERROR "protobuf_generate should have been defined as part of find_package(protobuf)")
endif()