0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 12:51:13 +08:00
sqlpp11/tests/mysql/usage/CMakeLists.txt
2021-08-15 16:51:27 +02:00

30 lines
993 B
CMake

find_package(Threads REQUIRED)
macro(build_and_run arg)
add_executable(Sqlpp11MySQL${arg} ${arg}.cpp)
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE Threads::Threads)
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE sqlpp11::sqlpp11)
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE MySQL::MySQL)
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE date::date)
if(${arg} STREQUAL "JsonTest")
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE MySQL::MySQL)
endif()
if(NOT MSVC)
target_compile_options(Sqlpp11MySQL${arg} PRIVATE -Wall -Wextra -pedantic)
endif()
add_test(${arg} Sqlpp11MySQL${arg})
endmacro()
build_and_run(JsonTest)
build_and_run(CustomQuery)
build_and_run(DateTimeTest)
build_and_run(SampleTest)
build_and_run(SelectTest)
build_and_run(UnionTest)
build_and_run(DynamicSelectTest)
build_and_run(MoveConstructorTest)
build_and_run(PreparedTest)
build_and_run(TruncatedTest)
build_and_run(UpdateTest)
build_and_run(RemoveTest)