Browse Source

Remove branching for downloaded and prebuilt protobuf

In generator
Viktor Kopp 6 years ago
parent
commit
a90c42269f
2 changed files with 3 additions and 5 deletions
  1. 2 0
      CMakeLists.txt
  2. 1 5
      src/generator/CMakeLists.txt

+ 2 - 0
CMakeLists.txt

@@ -11,6 +11,8 @@ if (NOT Protobuf_FOUND OR Protobuf_VERSION VERSION_LESS "3.0.0")
     )
     set(protobuf_BUILD_TESTS OFF CACHE BOOL "Disable protobuf tests build" FORCE)
     set(Protobuf_PROTOC_EXECUTABLE protoc)
+    set(Protobuf_PROTOC_LIBRARY libprotoc)
+    set(Protobuf_LIBRARIES "")
     add_subdirectory("${Protobuf_SOURCE_DIR}/cmake" ${Protobuf_BINARY_DIR})
 endif()
 

+ 1 - 5
src/generator/CMakeLists.txt

@@ -22,11 +22,7 @@ if(WIN32)
     target_link_libraries(${PROJECT_NAME} "${PROTOBUF_LIBRARIES_PATH}/libprotobuf.lib")
     target_link_libraries(${PROJECT_NAME} "${PROTOBUF_LIBRARIES_PATH}/libprotoc.lib")
 elseif(UNIX)
-    if(NOT Protobuf_FOUND)
-        target_link_libraries(${PROJECT_NAME} libprotoc)
-    else()
-        target_link_libraries(${PROJECT_NAME} ${Protobuf_LIBRARIES} ${Protobuf_PROTOC_LIBRARY})
-    endif()
+    target_link_libraries(${PROJECT_NAME} ${Protobuf_LIBRARIES} ${Protobuf_PROTOC_LIBRARY})
 endif()
 
 install(TARGETS ${PROJECT_NAME}