12345678910111213141516171819202122232425262728293031 |
- cmake_minimum_required(VERSION 2.8.7)
- include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
- if(NOT COMPILER_SUPPORTS_CXX11)
- message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
- endif()
- # compile flags
- # set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
- # set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2")
- # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g")
- # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_REENTRANT -fPIC -Wall -Werror")
- set(CNSTREAM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
- set(LIBRARY_OUTPUT_PATH ${CNSTREAM_ROOT_DIR}/lib)
- set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/)
- set(CMAKE_MODULE_PATH ${CNSTREAM_ROOT_DIR}/cmake)
- # ---[ rapidjson
- include_directories(${CNSTREAM_ROOT_DIR}/3rdparty/)
- include_directories(${CNSTREAM_ROOT_DIR}/framework/core/include)
- include_directories(${CNSTREAM_ROOT_DIR}/framework/request/include)
- aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/core/src core_srcs)
- aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/request/src request_srcs)
- add_library(gsd_core SHARED ${core_srcs} ${request_srcs})
- target_link_libraries(gsd_core dl pthread ${CNRT_LIBS} ${GFLAGS_LIBRARIES})
|