forked from alliedmodders/hl2sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: correct
set_target_properties
ones
- Loading branch information
Showing
4 changed files
with
40 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
if(NOT PROTOBUF_DIR) | ||
message(FATAL_ERROR "PROTOBUF_DIR is empty") | ||
endif() | ||
|
||
set(PROTOBUF_NAME "protobuf") | ||
set(PROTOBUF_LIB_NAME "lib${PROTOBUF_NAME}") | ||
set(PROTOBUF_BINARY_DIR "${PROTOBUF_NAME}") | ||
|
||
set(${PROTOBUF_NAME}_INSTALL OFF CACHE BOOL "Install protobuf binaries and files") | ||
set(${PROTOBUF_NAME}_BUILD_TESTS OFF CACHE BOOL "Build tests") | ||
add_subdirectory(${PROTOBUF_DIR} ${PROTOBUF_BINARY_DIR}) | ||
set_target_properties(${PROTOBUF_LIB_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF) | ||
if(WIN32) | ||
set_target_properties(${PROTOBUF_LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
endif() | ||
if(NOT PROTOBUF_DIR) | ||
message(FATAL_ERROR "PROTOBUF_DIR is empty") | ||
endif() | ||
|
||
set(PROTOBUF_NAME "protobuf") | ||
set(PROTOBUF_LIB_NAME "lib${PROTOBUF_NAME}") | ||
set(PROTOBUF_BINARY_DIR "${PROTOBUF_NAME}") | ||
|
||
set(${PROTOBUF_NAME}_INSTALL OFF CACHE BOOL "Install protobuf binaries and files") | ||
set(${PROTOBUF_NAME}_BUILD_TESTS OFF CACHE BOOL "Build tests") | ||
|
||
add_subdirectory(${PROTOBUF_DIR} ${PROTOBUF_BINARY_DIR}) | ||
|
||
set_target_properties(${PROTOBUF_LIB_NAME} PROPERTIES | ||
CXX_STANDARD 11 | ||
CXX_STANDARD_REQUIRED ON | ||
CXX_EXTENSIONS OFF | ||
) | ||
|
||
if(WIN32) | ||
set_target_properties(${PROTOBUF_LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters