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:
parent
e32d7d0e12
commit
413ac8804c
@ -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
5
test_scripts/sample.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include <Sample.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue
Block a user