File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ if(UNIX) # Darwing or Linux
2626 set (Protobuf_LIBRARY "/usr/local/opt/protobuf/lib/libprotobuf.dylib" )
2727 # find_path(Protobuf_INCLUDE_DIR NAMES google/protobuf/service.h)
2828 # find_library(Protobuf_LIBRARY NAMES protobuf)
29+ # find_package(Protobuf REQUIRED)
2930 message (STATUS "Protobuf version: ${Protobuf_VERSION} " )
3031 message (STATUS "Protobuf include dir: ${Protobuf_INCLUDE_DIR} " )
3132 message (STATUS "Protobuf libraries: ${Protobuf_LIBRARY} " )
@@ -72,6 +73,15 @@ add_executable(${PROJECT_NAME} openapi_cpp_test/openapi_cpp_test.cpp)
7273# headers search paths ...
7374set (HEADER_SEARCH_PATHS ${CPPREST_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ${TIGERAPI_INCLUDE_DIR} ${Protobuf_INCLUDE_DIR} )
7475
76+ # 在 HEADER_SEARCH_PATHS 如果有 /opt/homebrew/include, 则将其移到最后(因为其中的protobuf是homebrew的, 会优先于自定义的protobuf)
77+ if (HEADER_SEARCH_PATHS MATCHES "/opt/homebrew/include" )
78+ list (REMOVE_ITEM HEADER_SEARCH_PATHS "/opt/homebrew/include" )
79+ list (APPEND HEADER_SEARCH_PATHS "/opt/homebrew/include" )
80+ endif ()
81+ message (HEADER_SEARCH_PATHS " ${HEADER_SEARCH_PATHS} " )
82+
83+
84+
7585# library search paths ...
7686if (APPLE )
7787 set (OPENSSL_LIBS "${OPENSSL_LIBRARIES} " )
You can’t perform that action at this time.
0 commit comments