0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Added test to compile a generated header

This commit is contained in:
rbock 2016-07-09 19:48:24 +02:00
parent e32d7d0e12
commit 413ac8804c
2 changed files with 16 additions and 0 deletions

View File

@ -58,6 +58,17 @@ if (${PYTHONINTERP_FOUND})
"${CMAKE_CURRENT_BINARY_DIR}/fail"
test)
set(sqlpp.test.generated.sample "${CMAKE_CURRENT_BINARY_DIR}/Sample")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(
OUTPUT "${sqlpp.test.generated.sample}.h"
COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../scripts/ddl2cpp" "${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql" "${sqlpp.test.generated.sample}" test
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
VERBATIM)
add_executable(sqlpp.test.compiled.sample sample.cpp "${sqlpp.test.generated.sample}.h")
target_link_libraries(sqlpp.test.compiled.sample PRIVATE sqlpp11)
endif()
endif()

5
test_scripts/sample.cpp Normal file
View File

@ -0,0 +1,5 @@
#include <Sample.h>
int main()
{
}