2015-04-27 05:56:42 +08:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2015-04-27 04:47:40 +08:00
|
|
|
|
|
|
|
project(json CXX)
|
|
|
|
|
2016-04-24 22:55:32 +08:00
|
|
|
add_library(${PROJECT_NAME} INTERFACE IMPORTED GLOBAL)
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
2015-04-27 04:47:40 +08:00
|
|
|
|
2016-04-24 22:55:32 +08:00
|
|
|
set(UNIT_TEST_NAME "json_unit")
|
|
|
|
add_executable(${UNIT_TEST_NAME}
|
|
|
|
"test/catch.hpp" "test/unit.cpp")
|
|
|
|
set_target_properties(${UNIT_TEST_NAME} PROPERTIES
|
|
|
|
CXX_STANDARD 11
|
|
|
|
CXX_STANDARD_REQUIRED ON
|
|
|
|
COMPILE_DEFINITIONS "$<$<CXX_COMPILER_ID:MSVC>:_SCL_SECURE_NO_WARNINGS>"
|
|
|
|
COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>")
|
|
|
|
target_include_directories(${UNIT_TEST_NAME} PRIVATE "test")
|
|
|
|
target_link_libraries(${UNIT_TEST_NAME} ${PROJECT_NAME})
|