0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00
sqlpp11/tests/mysql/usage/CMakeLists.txt

30 lines
993 B
CMake
Raw Normal View History

find_package(Threads REQUIRED)
macro(build_and_run arg)
2021-08-15 22:17:35 +08:00
add_executable(Sqlpp11MySQL${arg} ${arg}.cpp)
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE Threads::Threads)
2021-08-15 22:17:35 +08:00
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)