mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-24 13:20:13 +00:00
add CMakeLists
This commit is contained in:
parent
0260a13f1c
commit
f177e9c235
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1 @@
|
||||
*.out
|
||||
callgrind.out.*
|
||||
Makefile
|
||||
build/*
|
||||
|
8
CMakeLists.txt
Normal file
8
CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
enable_testing()
|
||||
project(toml11)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR})
|
||||
add_definitions(-std=c++11)
|
||||
|
||||
add_subdirectory(tests)
|
20
tests/CMakeLists.txt
Normal file
20
tests/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
set(TEST_NAMES
|
||||
test_traits
|
||||
# test_value
|
||||
)
|
||||
|
||||
add_definitions("-Wall -Wpedantic")
|
||||
|
||||
set(test_library_dependencies)
|
||||
find_library(BOOST_UNITTEST_FRAMEWORK_LIBRARY boost_unit_test_framework)
|
||||
if (BOOST_UNITTEST_FRAMEWORK_LIBRARY)
|
||||
add_definitions(-DBOOST_TEST_DYN_LINK)
|
||||
add_definitions(-DUNITTEST_FRAMEWORK_LIBRARY_EXIST)
|
||||
set(test_library_dependencies boost_unit_test_framework)
|
||||
endif()
|
||||
|
||||
foreach(TEST_NAME ${TEST_NAMES})
|
||||
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
|
||||
target_link_libraries(${TEST_NAME} ${test_library_dependencies})
|
||||
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
|
||||
endforeach(TEST_NAME)
|
Loading…
Reference in New Issue
Block a user