添加CMakeLists x64 linux分支,运行build.sh可以直接完成md, td动态库编译,

建立软链接至test目录,方便测试;
This commit is contained in:
lhzw 2016-02-13 21:42:47 +08:00
parent 2ff2ddd995
commit d98c0d990a
2 changed files with 37 additions and 5 deletions

View File

@ -7,7 +7,7 @@ if (CMAKE_COMPILER_IS_GNUC OR CMAKE_COMPILER_IS_GNUCXX)
endif ()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
option(USE_64BITS "comiple 64bits" ON)
if (USE_64BITS)
@ -16,7 +16,14 @@ if (USE_64BITS)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
endif()
set(CTPAPI_PATH ctpapi)
if (WIN32)
set(CTPAPI_PATH ctpapi)
elseif (UNIX)
message("Under unix: " ${CMAKE_SIZEOF_VOID_P})
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
set(CTPAPI_PATH ctpapi/x64_linux)
endif()
endif()
include_directories(${CTPAPI_PATH})
set(CTPAPI_LIBRARY )
find_library(CTPAPI_MD_LIBRARY
@ -47,17 +54,27 @@ if (BUILD_CTP_TD)
endif()
set(PYTHON_INCLUDE_PATH C:/Python27/include)
set(PYTHON_LIBRARY )
if (WIN32)
set(PYTHON_INCLUDE_PATH C:/Python27/include)
find_library(PYTHON_LIBRARY
NAMES python27
PATHS C:/Python27/libs)
include_directories(${PYTHON_INCLUDE_PATH})
else()
set(PYTHON_INCLUDE_PATH /usr/include/python2.7/)
find_library(PYTHON_LIBRARY
NAMES python2.7
PATHS /usr/lib/x86_64-linux-gnu)
include_directories(${PYTHON_INCLUDE_PATH})
endif()
# boostanaconda
set(Boost_USE_STATIC_LIBS ON) #boost
if (WIN32)
set(Boost_USE_STATIC_LIBS ON) #boost
endif()
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.57.0 COMPONENTS python thread date_time system chrono REQUIRED) # boost否者message(${Boost_LIBRARIES})
find_package(Boost 1.55.0 COMPONENTS python thread date_time system chrono REQUIRED) # boost否者message(${Boost_LIBRARIES})
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()

15
vn.ctp/build.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# Written by Suzhengchun on 20160213
set -e
BUILDDIR=build
rm -rf $BUILDDIR
if [ ! -f $BUILDDIR ]; then
mkdir -p $BUILDDIR
fi
pushd $BUILDDIR
cmake ..
make VERBOSE=1 -j 2
ln -fs `pwd`/lib/libvnctpmd.so ../vnctpmd/test
ln -fs `pwd`/lib/libvnctptd.so ../vnctptd/test
popd