0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00
sqlpp11/tests/CMakeLists.txt
Markus Elfring c227d46cf4 Bug #14: Completed quoting for parameters of some CMake commands
A wiki article pointed out that whitespace will only be preserved for parameters
in CMake commands if passed strings will be appropriately quoted or escaped.
http://cmake.org/Wiki/CMake/Language_Syntax#CMake_splits_arguments_unless_you_use_quotation_marks_or_escapes.

Quoting was added so that more places should also handle file names correctly
which contain space characters or semicolons eventually.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2014-09-01 19:17:03 +02:00

28 lines
936 B
CMake

macro (build_and_run arg)
# Add headers to sources to enable file browsing in IDEs
include_directories("${CMAKE_BINARY_DIR}/tests")
add_executable("${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_LIST_DIR}/Sample.h")
add_test("${arg}" "${arg}")
endmacro ()
build_and_run(BooleanExpressionTest)
build_and_run(InterpretTest)
build_and_run(InsertTest)
build_and_run(RemoveTest)
build_and_run(UpdateTest)
build_and_run(SelectTest)
build_and_run(SelectTypeTest)
build_and_run(FunctionTest)
build_and_run(PreparedTest)
build_and_run(Minimalistic)
build_and_run(ResultTest)
# if you want to use the generator, you can do something like this:
#find_package(PythonInterp REQUIRED)
#add_custom_command(
# OUTPUT "${CMAKE_CURRENT_LIST_DIR}/Sample.h"
# COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/scripts/ddl2cpp" "${CMAKE_CURRENT_LIST_DIR}/sample.sql" Sample test
# DEPENDS "${CMAKE_CURRENT_LIST_DIR}/sample.sql"
# VERBATIM)