2020-02-24 21:13:38 +08:00
2020-03-12 14:08:46 +08:00
option ( TARS_MYSQL "option for mysql" ON )
2020-02-24 21:13:38 +08:00
option ( TARS_SSL "option for ssl" OFF )
option ( TARS_HTTP2 "option for http2" OFF )
option ( TARS_PROTOBUF "option for protocol" OFF )
2020-04-06 21:09:28 +08:00
option ( TARS_GPERF "option for gperf" OFF )
2020-02-24 21:13:38 +08:00
2020-03-12 17:46:15 +08:00
IF ( UNIX )
FIND_PACKAGE ( ZLIB )
IF ( NOT ZLIB_FOUND )
2020-03-31 15:06:04 +08:00
SET ( ERRORMSG "zlib library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake." )
2020-03-12 17:46:15 +08:00
IF ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
2020-03-31 15:06:04 +08:00
SET ( ERRORMSG ${ ERRORMSG } "On Debian/Ubuntu, package name is zlib1g-dev(apt-get install zlib1g-dev), on Redhat/Centos and derivates it is zlib-devel (yum install zlib-devel)." )
2020-03-12 17:46:15 +08:00
ENDIF ( )
MESSAGE ( FATAL_ERROR ${ ERRORMSG } )
ENDIF ( )
2020-03-31 15:06:04 +08:00
2020-03-12 17:46:15 +08:00
ENDIF ( UNIX )
2020-02-26 12:05:15 +08:00
if ( TARS_MYSQL )
add_definitions ( -DTARS_MYSQL=1 )
2020-04-06 21:09:28 +08:00
endif ( )
2020-02-27 11:59:25 +08:00
2020-04-06 21:09:28 +08:00
if ( TARS_GPERF )
add_definitions ( -DTARS_GPERF=1 )
2020-02-26 12:05:15 +08:00
endif ( )
2020-02-24 21:13:38 +08:00
2020-02-26 12:05:15 +08:00
if ( TARS_SSL )
add_definitions ( -DTARS_SSL=1 )
endif ( )
2020-02-24 21:13:38 +08:00
2020-02-26 12:05:15 +08:00
if ( TARS_HTTP2 )
add_definitions ( -DTARS_HTTP2=1 )
endif ( )
2020-02-24 21:13:38 +08:00
2020-02-26 12:05:15 +08:00
if ( TARS_PROTOBUF )
add_definitions ( -DTARS_PROTOBUF=1 )
endif ( )
2020-02-24 21:13:38 +08:00
#-------------------------------------------------------------
set ( THIRDPARTY_PATH "${CMAKE_BINARY_DIR}/src" )
2020-02-25 10:14:27 +08:00
set ( LIB_MYSQL )
set ( LIB_HTTP2 )
set ( LIB_SSL )
set ( LIB_CRYPTO )
set ( LIB_PROTOBUF )
2020-03-10 10:42:12 +08:00
set ( LIB_GTEST )
2020-02-24 21:13:38 +08:00
#-------------------------------------------------------------
add_custom_target ( thirdparty )
include ( ExternalProject )
2020-04-06 21:09:28 +08:00
if ( TARS_GPERF )
set ( GPERF_DIR_INC "${THIRDPARTY_PATH}/gpref/include" )
set ( GRPEF_DIR_LIB "${THIRDPARTY_PATH}/gpref/lib" )
include_directories ( ${ GPERF_DIR_INC } )
link_directories ( ${ GRPEF_DIR_LIB } )
if ( UNIX )
set ( LIB_GPERF "profiler" )
ExternalProject_Add ( ADD_ ${ LIB_GPERF }
U R L h t t p s : / / t a r s - t h i r d p a r t - 1 3 0 0 9 1 0 3 4 6 . c o s . a p - g u a n g z h o u . m y q c l o u d . c o m / / s r c / g p e r f t o o l s - 2 . 7 . t a r . g z
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
C O N F I G U R E _ C O M M A N D . / c o n f i g u r e - - p r e f i x = $ { C M A K E _ B I N A R Y _ D I R } / s r c / g p r e f - - d i s a b l e - s h a r e d - - d i s a b l e - d e b u g a l l o c
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / g p r e f - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e
# INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config release --target install
U R L _ M D 5 c 6 a 8 5 2 a 8 1 7 e 9 1 6 0 c 7 9 b d b 2 d 3 1 0 1 b 4 6 0 1
)
add_dependencies ( thirdparty ADD_ ${ LIB_GPERF } )
INSTALL ( FILES ${ CMAKE_BINARY_DIR } /src/gpref/bin/pprof
P E R M I S S I O N S O W N E R _ E X E C U T E O W N E R _ W R I T E O W N E R _ R E A D G R O U P _ E X E C U T E G R O U P _ R E A D
D E S T I N A T I O N t h i r d p a r t y / b i n / )
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/gpref/lib DESTINATION thirdparty )
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/gpref/include/gperftools DESTINATION thirdparty/include )
endif ( UNIX )
endif ( TARS_GPERF )
2020-03-10 10:42:12 +08:00
set ( LIB_GTEST "libgtest" )
2020-03-27 19:26:42 +08:00
if ( WIN32 )
ExternalProject_Add ( ADD_CURL
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / c u r l - 7 . 6 9 . 1 . t a r . g z
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / c u r l
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / c u r l - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e
I N S T A L L _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e - - t a r g e t i n s t a l l
U R L _ M D 5 b 9 b b 5 e 1 1 d 5 7 9 4 2 5 1 5 4 a 9 f 9 7 e d 4 4 b e 9 b 8
)
add_dependencies ( thirdparty ADD_CURL )
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/curl/ DESTINATION thirdparty )
endif ( WIN32 )
2020-03-10 10:42:12 +08:00
if ( WIN32 )
ExternalProject_Add ( ADD_ ${ LIB_GTEST }
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / r e l e a s e - 1 . 1 0 . 0 . z i p
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / g t e s t
2020-03-10 10:42:12 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / g t e s t - l i b
B U I L D _ I N _ S O U R C E 1
2020-03-24 21:49:16 +08:00
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e
I N S T A L L _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e - - t a r g e t i n s t a l l
2020-03-10 10:42:12 +08:00
U R L _ M D 5 8 2 3 5 8 a f f d d 7 a b 9 4 8 5 4 c 8 e e 7 3 a 1 8 0 f c 5 3
)
else ( )
ExternalProject_Add ( ADD_ ${ LIB_GTEST }
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / r e l e a s e - 1 . 1 0 . 0 . t a r . g z
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / g t e s t
2020-03-10 10:42:12 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / g t e s t - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e
U R L _ M D 5 e c d 1 f a 6 5 e 7 d e 7 0 7 c d 5 c 0 0 b d a c 5 6 0 2 2 c d
)
endif ( )
2020-03-10 19:24:43 +08:00
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/gtest/ DESTINATION thirdparty )
2020-03-10 10:42:12 +08:00
add_dependencies ( thirdparty ADD_ ${ LIB_GTEST } )
2020-02-26 12:05:15 +08:00
if ( TARS_PROTOBUF )
2020-02-26 10:16:18 +08:00
set ( PROTOBUF_DIR_INC "${THIRDPARTY_PATH}/protobuf/include" )
set ( PROTOBUF_DIR_LIB "${THIRDPARTY_PATH}/protobuf/lib" )
2020-02-28 09:37:06 +08:00
set ( PROTOBUF_DIR_LIB64 "${THIRDPARTY_PATH}/protobuf/lib64" )
2020-02-25 10:14:27 +08:00
include_directories ( ${ PROTOBUF_DIR_INC } )
link_directories ( ${ PROTOBUF_DIR_LIB } )
2020-02-28 09:37:06 +08:00
link_directories ( ${ PROTOBUF_DIR_LIB64 } )
2020-02-25 10:14:27 +08:00
2020-02-26 12:05:15 +08:00
if ( WIN32 )
2020-02-26 18:32:49 +08:00
set ( LIB_PROTOC "libprotoc" )
set ( LIB_PROTOBUF "libprotobuf" )
2020-02-25 10:14:27 +08:00
2020-02-26 12:05:15 +08:00
ExternalProject_Add ( ADD_ ${ LIB_PROTOBUF }
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / p r o t o b u f - c p p - 3 . 1 1 . 3 . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } c m a k e - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / p r o t o b u f - D C M A K E _ B U I L D _ T Y P E = R e l e a s e - D B U I L D _ S H A R E D _ L I B S = O N
2020-02-26 12:05:15 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / p r o t o b u f - l i b
B U I L D _ I N _ S O U R C E 1
2020-03-24 21:49:16 +08:00
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e
I N S T A L L _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e - - t a r g e t i n s t a l l
2020-02-26 12:05:15 +08:00
U R L _ M D 5 f b 5 9 3 9 8 3 2 9 0 0 2 c 9 8 d 4 d 9 2 2 3 8 3 2 4 c 4 1 8 7
)
else ( )
2020-02-26 18:32:49 +08:00
set ( LIB_PROTOC "protoc" )
set ( LIB_PROTOBUF "protobuf" )
2020-02-26 12:05:15 +08:00
ExternalProject_Add ( ADD_ ${ LIB_PROTOBUF }
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / p r o t o b u f - c p p - 3 . 1 1 . 3 . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } c m a k e - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / p r o t o b u f - D B U I L D _ S H A R E D _ L I B S = O F F
2020-02-26 12:05:15 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / p r o t o b u f - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e
U R L _ M D 5 f b 5 9 3 9 8 3 2 9 0 0 2 c 9 8 d 4 d 9 2 2 3 8 3 2 4 c 4 1 8 7
)
endif ( )
2020-03-10 19:24:43 +08:00
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/protobuf/ DESTINATION thirdparty )
2020-02-24 21:13:38 +08:00
2020-02-25 10:14:27 +08:00
add_dependencies ( thirdparty ADD_ ${ LIB_PROTOBUF } )
2020-02-24 21:13:38 +08:00
2020-02-26 12:05:15 +08:00
endif ( )
2020-02-24 21:13:38 +08:00
2020-02-25 18:04:35 +08:00
2020-02-26 12:05:15 +08:00
if ( TARS_SSL )
2020-02-27 17:16:51 +08:00
set ( SSL_DIR "${THIRDPARTY_PATH}/openssl" )
2020-02-26 10:16:18 +08:00
set ( SSL_DIR_INC "${THIRDPARTY_PATH}/openssl/include/" )
set ( SSL_DIR_LIB "${THIRDPARTY_PATH}/openssl/lib" )
2020-02-25 18:04:35 +08:00
include_directories ( ${ SSL_DIR_INC } )
link_directories ( ${ SSL_DIR_LIB } )
2020-02-26 12:05:15 +08:00
if ( WIN32 )
2020-02-25 18:04:35 +08:00
set ( LIB_SSL "libssl" )
set ( LIB_CRYPTO "libcrypto" )
ExternalProject_Add ( ADD_ ${ LIB_SSL }
2020-02-26 12:05:15 +08:00
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / o p e n s s l - 1 . 1 . 1 d . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-02-26 18:32:49 +08:00
C O N F I G U R E _ C O M M A N D p e r l C o n f i g u r e - - p r e f i x = $ { C M A K E _ B I N A R Y _ D I R } / s r c / o p e n s s l V C - W I N 6 4 A n o - a s m
2020-02-26 12:05:15 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / o p e n s s l - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D n m a k e
2020-02-27 22:07:29 +08:00
I N S T A L L _ C O M M A N D n m a k e i n s t a l l
2020-02-26 12:05:15 +08:00
U R L _ M D 5 3 b e 2 0 9 0 0 0 d b c 7 e 1 b 9 5 b c d f 4 7 9 8 0 a 3 b a a
)
else ( )
2020-02-25 18:04:35 +08:00
set ( LIB_SSL "ssl" )
set ( LIB_CRYPTO "crypto" )
ExternalProject_Add ( ADD_ ${ LIB_SSL }
2020-02-26 12:05:15 +08:00
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / o p e n s s l - 1 . 1 . 1 d . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
C O N F I G U R E _ C O M M A N D . / c o n f i g - - p r e f i x = $ { C M A K E _ B I N A R Y _ D I R } / s r c / o p e n s s l n o - s h a r e d
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / o p e n s s l - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e
U R L _ M D 5 3 b e 2 0 9 0 0 0 d b c 7 e 1 b 9 5 b c d f 4 7 9 8 0 a 3 b a a
)
endif ( )
2020-03-10 19:24:43 +08:00
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/openssl/ DESTINATION thirdparty )
2020-02-26 12:05:15 +08:00
2020-02-25 18:04:35 +08:00
add_dependencies ( thirdparty ADD_ ${ LIB_SSL } )
2020-02-26 12:05:15 +08:00
endif ( )
2020-02-25 18:04:35 +08:00
2020-02-26 12:05:15 +08:00
if ( TARS_MYSQL )
2020-02-26 10:16:18 +08:00
set ( MYSQL_DIR_INC "${THIRDPARTY_PATH}/mysql/include" )
set ( MYSQL_DIR_LIB "${THIRDPARTY_PATH}/mysql/lib" )
2020-02-25 10:14:27 +08:00
include_directories ( ${ MYSQL_DIR_INC } )
link_directories ( ${ MYSQL_DIR_LIB } )
2020-02-24 21:13:38 +08:00
2020-02-26 12:05:15 +08:00
if ( WIN32 )
2020-02-25 10:14:27 +08:00
set ( LIB_MYSQL "libmysql" )
2020-02-27 22:07:29 +08:00
2020-02-27 17:16:51 +08:00
ExternalProject_Add ( ADD_ ${ LIB_MYSQL }
2020-02-27 22:07:29 +08:00
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / m y s q l - c o n n e c t o r - c - 6 . 1 . 1 1 - s r c . z i p
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-27 17:16:51 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / m y s q l - D B U I L D _ C O N F I G = m y s q l _ r e l e a s e
2020-02-27 17:16:51 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / m y s q l - l i b
B U I L D _ I N _ S O U R C E 1
2020-03-24 21:49:16 +08:00
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e
I N S T A L L _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e - - t a r g e t i n s t a l l
2020-02-27 22:07:29 +08:00
U R L _ M D 5 6 2 d e 0 1 b e f f c 4 8 3 4 8 7 0 8 c 9 8 3 a 5 8 5 b 4 d c 1
2020-02-27 17:16:51 +08:00
)
2020-02-26 12:05:15 +08:00
else ( )
2020-02-25 10:14:27 +08:00
set ( LIB_MYSQL "mysqlclient" )
2020-02-27 22:07:29 +08:00
2020-02-27 17:16:51 +08:00
ExternalProject_Add ( ADD_ ${ LIB_MYSQL }
2020-02-27 22:07:29 +08:00
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / m y s q l - c o n n e c t o r - c - 6 . 1 . 1 1 - s r c . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
2020-02-25 10:14:27 +08:00
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / m y s q l - D D E F A U L T _ C H A R S E T = u t f 8 - D D E F A U L T _ C O L L A T I O N = u t f 8 _ g e n e r a l _ c i - D D I S A B L E _ S H A R E D = 1
2020-02-25 10:14:27 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / m y s q l - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e m y s q l c l i e n t
2020-02-27 22:07:29 +08:00
U R L _ M D 5 9 8 c a 2 0 7 1 f 9 d 4 c 6 b 7 3 1 4 6 c c 0 4 5 5 f 6 b 9 1 4
2020-02-25 10:14:27 +08:00
)
2020-02-26 12:05:15 +08:00
endif ( )
2020-02-25 21:00:54 +08:00
2020-03-04 10:33:14 +08:00
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/mysql/lib DESTINATION thirdparty )
2020-03-04 10:50:29 +08:00
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/mysql/include/ DESTINATION thirdparty/include/mysql )
2020-02-24 21:13:38 +08:00
2020-02-25 10:14:27 +08:00
add_dependencies ( thirdparty ADD_ ${ LIB_MYSQL } )
2020-02-26 12:05:15 +08:00
endif ( )
2020-02-24 21:13:38 +08:00
2020-02-27 22:07:29 +08:00
2020-02-26 12:05:15 +08:00
if ( TARS_HTTP2 )
2020-02-25 10:14:27 +08:00
2020-02-26 10:16:18 +08:00
set ( NGHTTP2_DIR_INC "${THIRDPARTY_PATH}/nghttp2/include/" )
set ( NGHTTP2_DIR_LIB "${THIRDPARTY_PATH}/nghttp2/lib" )
2020-02-28 09:37:06 +08:00
set ( NGHTTP2_DIR_LIB64 "${THIRDPARTY_PATH}/nghttp2/lib64" )
2020-02-25 10:14:27 +08:00
include_directories ( ${ NGHTTP2_DIR_INC } )
link_directories ( ${ NGHTTP2_DIR_LIB } )
2020-02-28 09:37:06 +08:00
link_directories ( ${ NGHTTP2_DIR_LIB64 } )
2020-02-27 22:07:29 +08:00
set ( LIB_HTTP2 "nghttp2_static" )
2020-02-25 10:14:27 +08:00
2020-02-26 12:05:15 +08:00
if ( WIN32 )
2020-02-25 10:14:27 +08:00
ExternalProject_Add ( ADD_ ${ LIB_HTTP2 }
2020-02-26 12:05:15 +08:00
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / n g h t t p 2 - 1 . 4 0 . 0 . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / n g h t t p 2 - D E N A B L E _ L I B _ O N L Y = O N - D E N A B L E _ S T A T I C _ L I B = O N
2020-02-26 12:05:15 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / n g h t t p 2 - l i b
B U I L D _ I N _ S O U R C E 1
2020-03-24 21:49:16 +08:00
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e
I N S T A L L _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d . - - c o n f i g r e l e a s e - - t a r g e t i n s t a l l
2020-02-26 12:05:15 +08:00
U R L _ M D 5 5 d f 3 7 5 b b d 5 3 2 f c a a 7 c d 4 0 4 4 b 5 4 b 1 1 8 8 d
)
else ( )
2020-02-25 10:14:27 +08:00
ExternalProject_Add ( ADD_ ${ LIB_HTTP2 }
2020-02-26 12:05:15 +08:00
U R L h t t p : / / c d n . t a r s y u n . c o m / s r c / n g h t t p 2 - 1 . 4 0 . 0 . t a r . g z
2020-03-04 10:33:14 +08:00
D O W N L O A D _ D I R $ { C M A K E _ S O U R C E _ D I R } / d o w n l o a d
2020-02-26 12:05:15 +08:00
P R E F I X $ { C M A K E _ B I N A R Y _ D I R }
I N S T A L L _ D I R $ { C M A K E _ S O U R C E _ D I R }
2020-03-24 21:49:16 +08:00
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } . - D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ B I N A R Y _ D I R } / s r c / n g h t t p 2 - D E N A B L E _ L I B _ O N L Y = O N - D E N A B L E _ S T A T I C _ L I B = O N
2020-02-26 12:05:15 +08:00
S O U R C E _ D I R $ { C M A K E _ B I N A R Y _ D I R } / s r c / n g h t t p 2 - l i b
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e
U R L _ M D 5 5 d f 3 7 5 b b d 5 3 2 f c a a 7 c d 4 0 4 4 b 5 4 b 1 1 8 8 d
)
endif ( )
2020-03-10 19:24:43 +08:00
INSTALL ( DIRECTORY ${ CMAKE_BINARY_DIR } /src/nghttp2/ DESTINATION thirdparty )
2020-02-24 21:13:38 +08:00
2020-02-25 10:14:27 +08:00
add_dependencies ( thirdparty ADD_ ${ LIB_HTTP2 } )
2020-02-24 21:13:38 +08:00
2020-02-27 22:07:29 +08:00
endif ( )
2020-02-24 21:13:38 +08:00
2020-02-25 10:14:27 +08:00
message ( "----------------------------------------------------" )
message ( "TARS_MYSQL: ${TARS_MYSQL}" )
message ( "TARS_HTTP2: ${TARS_HTTP2}" )
message ( "TARS_SSL: ${TARS_SSL}" )
message ( "TARS_PROTOBUF: ${TARS_PROTOBUF}" )
2020-04-06 21:09:28 +08:00
message ( "TARS_GPERF: ${TARS_GPERF}" )