68 lines
1.3 KiB
CMake
68 lines
1.3 KiB
CMake
project(dbproxy)
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-std=gnu++11 -fsanitize=address -fno-omit-frame-pointer")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11")
|
|
|
|
include_directories(
|
|
AFTER
|
|
../../third_party/a8engine
|
|
/usr/include/mysql
|
|
/usr/include/jsoncpp
|
|
/usr/include/hiredis
|
|
../../third_party
|
|
.
|
|
)
|
|
|
|
link_directories(
|
|
/usr/lib64/mysql
|
|
/usr/local/lib
|
|
)
|
|
|
|
aux_source_directory(../../third_party/a8engine/a8
|
|
SRC_LIST
|
|
)
|
|
|
|
aux_source_directory(../../third_party/framework/cpp
|
|
SRC_LIST
|
|
)
|
|
|
|
aux_source_directory(.
|
|
SRC_LIST
|
|
)
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH
|
|
${PROJECT_BINARY_DIR}/../bin
|
|
)
|
|
|
|
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG "_DEBUG")
|
|
|
|
add_executable(
|
|
dbproxy ${SRC_LIST}
|
|
)
|
|
|
|
add_custom_target(script_pb_protocol ALL)
|
|
add_custom_command(TARGET script_pb_protocol
|
|
PRE_BUILD
|
|
# COMMAND python ../../tools/script/construct/build_script.py
|
|
COMMAND python ../tools/scripts/construct/build_pb.py
|
|
# COMMAND python ../../tools/script/construct/build_protocol.py
|
|
# COMMAND python ../../tools/script/construct/build_version_file.py
|
|
)
|
|
add_dependencies(dbproxy script_pb_protocol)
|
|
|
|
target_link_libraries(
|
|
dbproxy
|
|
pthread
|
|
mysqlclient
|
|
protobuf
|
|
rt
|
|
crypto
|
|
ssl
|
|
jsoncpp
|
|
curl
|
|
hiredis
|
|
tinyxml2
|
|
)
|