Add cmake format (#4618)

* Support CMakeify operation

* Run Cmakeify

* Update cmakeify.sh

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
Zach H 2022-05-08 15:22:43 -04:00 committed by GitHub
parent 3e90f109a2
commit a95b338c80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1132 additions and 815 deletions

View file

@ -2,7 +2,7 @@
#
# provides the protobuf interfaces
SET(PROTO_FILES
set(PROTO_FILES
admin_commands.proto
card_attributes.proto
color.proto
@ -162,21 +162,21 @@ SET(PROTO_FILES
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS})
set(cockatrice_protocol_LIBS ${PROTOBUF_LIBRARIES})
if (UNIX)
set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lpthread)
endif (UNIX)
if(UNIX)
set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lpthread)
endif(UNIX)
target_link_libraries(cockatrice_protocol ${cockatrice_protocol_LIBS})
# ubuntu uses an outdated package for protobuf, 3.1.0 is required
if(${Protobuf_VERSION} VERSION_LESS "3.1.0")
# remove unused parameter and misleading indentation warnings when compiling to avoid errors
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wno-unused-parameter -Wno-misleading-indentation")
message(WARNING "Older protobuf version found (${Protobuf_VERSION} < 3.1.0), "
"disabled the warnings 'unused-parameter' and 'misleading-indentation' for protobuf generated code "
"to avoid compilation errors.")
# remove unused parameter and misleading indentation warnings when compiling to avoid errors
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-unused-parameter -Wno-misleading-indentation")
message(WARNING "Older protobuf version found (${Protobuf_VERSION} < 3.1.0), "
"disabled the warnings 'unused-parameter' and 'misleading-indentation' for protobuf generated code "
"to avoid compilation errors."
)
endif()