This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/myddas/pl/CMakeLists.txt

45 lines
1.6 KiB
CMake
Raw Normal View History

set(MYDDAS_YPP
myddas.ypp
myddas_assert_predicates.ypp
myddas_top_level.ypp
myddas_errors.ypp
myddas_prolog2sql.ypp
myddas_mysql.ypp
myddas_util_predicates.ypp
myddas_prolog2sql_optimizer.ypp)
set(MYDDAS_DRIVERS
2018-12-07 16:22:17 +00:00
myddas_driver.ypp
)
2018-12-07 16:22:17 +00:00
set(MYDDAS_DBMS sqlite3 postgres odbc)
2017-11-21 15:44:43 +00:00
2018-12-14 14:53:39 +00:00
if (ANDROID)
2018-12-07 16:22:17 +00:00
set (MYDDAS_PL_OUTDIR ${YAP_APP_DIR}/src/generated/assets/Yap )
2018-12-14 14:53:39 +00:00
else()
set (MYDDAS_PL_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
get_property(MYDDAS_FLAGS GLOBAL PROPERTY COMPILE_DEFINITIONS)
2018-12-14 14:53:39 +00:00
foreach (filename ${MYDDAS_YPP})
get_filename_component(base ${filename} NAME_WE)
2018-12-07 16:22:17 +00:00
set(base_abs ${MYDDAS_PL_OUTDIR}/${base})
set(outfile ${base_abs}.yap)
2019-01-09 09:32:09 +00:00
list(APPEND MYDDAS_YAP_FILES ${outfile})
2018-12-07 16:22:17 +00:00
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${MYDDAS_FLAGS} -x c -E -P -w ${CMAKE_CURRENT_SOURCE_DIR}/${filename} -o ${outfile}
2018-12-07 16:22:17 +00:00
)
set_source_files_properties(outfile PROPERTIES GENERATED TRUE)
endforeach ()
2018-12-14 14:53:39 +00:00
foreach (dbms ${MYDDAS_DBMS} )
2017-11-21 15:44:43 +00:00
set(outfile ${MYDDAS_PL_OUTDIR}/myddas_${dbms}.yap)
2019-01-09 09:32:09 +00:00
list(APPEND MYDDAS_YAP_FILES ${outfile})
2018-12-07 16:22:17 +00:00
execute_process(
COMMAND ${CMAKE_C_COMPILER} -D${dbms} -x c -E -P -w ${CMAKE_CURRENT_SOURCE_DIR}/myddas_driver.ypp -o ${outfile}
)
2016-04-05 08:18:09 +01:00
2018-12-07 16:22:17 +00:00
set_source_files_properties(outfile PROPERTIES GENERATED TRUE)
2016-04-05 08:18:09 +01:00
2018-12-07 16:22:17 +00:00
endforeach()
2019-01-09 09:32:09 +00:00
list(APPEND MYDDAS_YAP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite3/sqlitest.yap ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite3/chinook.db)
2017-10-11 02:24:15 +01:00
2019-01-09 09:32:09 +00:00
install(FILES ${MYDDAS_YAP_FILES} DESTINATION ${YAP_INSTALL_DATADIR})