12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- cmake_minimum_required(VERSION 3.0)
- project(ex1
- VERSION 0.1
- LANGUAGES CXX)
- if (NOT CMAKE_BUILD_TYPE)
-
- set(CMAKE_BUILD_TYPE RelWithDebInfo)
- message("==> CMAKE_BUILD_TYPE empty. Changing it to Debug.")
- else()
- message("==> CMAKE_BUILD_TYPE == ${CMAKE_BUILD_TYPE}.")
- endif()
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
- add_definitions("-std=c++11")
- set(Boost_USE_STATIC_LIBS ON)
- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
- conan_basic_setup()
- set(CMAKE_CXX_STANDARD 17)
- set(CMAKE_CXX_EXTENSIONS ON)
- if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
- message("***")
- message("*** ERROR/MISSING *** please run: git clone https://github.com/google/googletest.git --depth 1")
- message("***")
- endif()
- add_subdirectory(googletest)
- option(gtest_build_samples "Build gtest's sample programs." OFF)
- option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
- add_executable(test-galaxy test-galaxy.cpp galaxy.cpp config.cpp utils.cpp buysell.cpp)
- add_dependencies(test-galaxy gtest)
- target_link_libraries(test-galaxy gtest_main ${CONAN_LIBS})
- add_executable(test-director test-director.cpp galaxy.cpp utils.cpp buysell.cpp director.cpp dispatchers.cpp boxes.cpp scripts.cpp config.cpp ansicolor.cpp)
- add_dependencies(test-director gtest)
- target_link_libraries(test-director gtest_main ${CONAN_LIBS})
- enable_testing()
- add_test(NAME test-galaxy
- COMMAND test-galaxy)
- add_test(NAME test-director
- COMMAND test-director)
- ADD_EXECUTABLE( twproxy twproxy.cpp utils.cpp session.cpp boxes.cpp director.cpp galaxy.cpp dispatchers.cpp scripts.cpp buysell.cpp config.cpp ansicolor.cpp)
- TARGET_LINK_LIBRARIES( twproxy ${CONAN_LIBS} pthread)
|