From 413ac8804c23fca560b096f6b390b3fbae9362f2 Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 9 Jul 2016 19:48:24 +0200 Subject: [PATCH] Added test to compile a generated header --- test_scripts/CMakeLists.txt | 11 +++++++++++ test_scripts/sample.cpp | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 test_scripts/sample.cpp diff --git a/test_scripts/CMakeLists.txt b/test_scripts/CMakeLists.txt index 6872d574..fd3c482a 100644 --- a/test_scripts/CMakeLists.txt +++ b/test_scripts/CMakeLists.txt @@ -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() diff --git a/test_scripts/sample.cpp b/test_scripts/sample.cpp new file mode 100644 index 00000000..6f48646e --- /dev/null +++ b/test_scripts/sample.cpp @@ -0,0 +1,5 @@ +#include + +int main() +{ +}