yaml-cpp

FORK: A YAML parser and emitter in C++
git clone https://git.neptards.moe/neptards/yaml-cpp.git
Log | Files | Refs | README | LICENSE

CMakeLists.txt (1535B)


      1 find_package(Threads REQUIRED)
      2 
      3 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
      4 set(BUILD_MOCK ON CACHE BOOL "" FORCE)
      5 set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
      6 
      7 add_subdirectory(
      8   "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.10.0"
      9   "${CMAKE_CURRENT_BINARY_DIR}/prefix")
     10 
     11 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.10.0/googletest/include")
     12 
     13 set(test-new-api-pattern "new-api/*.cpp")
     14 set(test-source-pattern "*.cpp" "integration/*.cpp" "node/*.cpp")
     15 if (CMAKE_VERSION VERSION_GREATER 3.11)
     16   list(INSERT test-new-api-pattern 0 CONFIGURE_DEPENDS)
     17   list(INSERT test-source-pattern 0 CONFIGURE_DEPENDS)
     18 endif()
     19 
     20 file(GLOB test-new-api-sources ${test-new-api-pattern})
     21 file(GLOB test-sources ${test-source-pattern})
     22 
     23 add_executable(yaml-cpp-tests "")
     24 target_sources(yaml-cpp-tests
     25   PRIVATE
     26     ${test-new-api-sources}
     27     ${test-sources})
     28 target_include_directories(yaml-cpp-tests
     29   PRIVATE
     30     ${CMAKE_CURRENT_SOURCE_DIR}/integration
     31     ${CMAKE_CURRENT_SOURCE_DIR}
     32     ${PROJECT_SOURCE_DIR}/src)
     33 target_compile_options(yaml-cpp-tests
     34   PRIVATE
     35     $<$<CXX_COMPILER_ID:Clang>:-Wno-c99-extensions -Wno-variadic-macros -Wno-sign-compare>
     36     $<$<CXX_COMPILER_ID:GNU>:-Wno-variadic-macros -Wno-sign-compare>)
     37 target_link_libraries(yaml-cpp-tests
     38   PRIVATE
     39     Threads::Threads
     40     yaml-cpp
     41     gmock)
     42 
     43 set_property(TARGET yaml-cpp-tests PROPERTY CXX_STANDARD_REQUIRED ON)
     44 if (NOT DEFINED CMAKE_CXX_STANDARD)
     45   set_target_properties(yaml-cpp-tests PROPERTIES CXX_STANDARD 11)
     46 endif()
     47 
     48 
     49 add_test(yaml-cpp::test yaml-cpp-tests)