CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. cmake_minimum_required(VERSION 2.8.7)
  2. include(CheckCXXCompilerFlag)
  3. CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
  4. if(NOT COMPILER_SUPPORTS_CXX11)
  5. message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
  6. endif()
  7. # compile flags
  8. # set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
  9. # set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2")
  10. # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g")
  11. # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_REENTRANT -fPIC -Wall -Werror")
  12. set(CNSTREAM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
  13. set(LIBRARY_OUTPUT_PATH ${CNSTREAM_ROOT_DIR}/lib)
  14. set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/)
  15. set(CMAKE_MODULE_PATH ${CNSTREAM_ROOT_DIR}/cmake)
  16. # ---[ rapidjson
  17. include_directories(${CNSTREAM_ROOT_DIR}/3rdparty/)
  18. include_directories(${CNSTREAM_ROOT_DIR}/framework/core/include)
  19. include_directories(${CNSTREAM_ROOT_DIR}/framework/request/include)
  20. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/core/src core_srcs)
  21. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/request/src request_srcs)
  22. add_library(gsd_core SHARED ${core_srcs} ${request_srcs})
  23. target_link_libraries(gsd_core dl pthread ${CNRT_LIBS} ${GFLAGS_LIBRARIES})