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

46 lines
1.3 KiB
CMake
Raw Normal View History

2016-04-05 08:18:09 +01:00
set( MYDDAS_YPP
myddas.ypp
myddas_assert_predicates.ypp
myddas_top_level.ypp
myddas_errors.ypp
myddas_prolog2sql.ypp
myddas_mysql.ypp
myddas_postgres.ypp
myddas_sqlite3.ypp
myddas_util_predicates.ypp
myddas_prolog2sql_optimizer.ypp )
set (MYDDAS_YAP "")
2016-04-10 14:21:17 +01:00
2016-04-05 08:18:09 +01:00
function(cpp_compile output filename)
get_filename_component(base ${filename} NAME_WE)
set(base_abs ${CMAKE_CURRENT_BINARY_DIR}/${base})
set(outfile ${base_abs}.yap)
set(${output} ${${output}} ${outfile} PARENT_SCOPE)
2016-04-10 14:21:17 +01:00
IF(MSVC)
add_custom_command(
OUTPUT ${outfile}
COMMAND ${CMAKE_C_COMPILER} ${MYDDAS_FLAGS} /EP /P ${outfile} ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
else()
add_custom_command(
OUTPUT ${outfile}
2016-04-05 08:18:09 +01:00
COMMAND ${CMAKE_C_COMPILER} ${MYDDAS_FLAGS} -x c -E -P -w ${CMAKE_CURRENT_SOURCE_DIR}/${filename} -o ${outfile}
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
2016-04-10 14:21:17 +01:00
ENDIF(MSVC)
set_source_files_properties(${outfile} PROPERTIES GENERATED TRUE)
2016-04-05 08:18:09 +01:00
endfunction()
foreach(file ${MYDDAS_YPP})
2016-04-10 14:21:17 +01:00
cpp_compile( MYDDAS_YAP ${file})
2016-04-05 08:18:09 +01:00
#message("outfiles=${MYDDAS_YAP}\n")
endforeach()
2016-04-12 16:22:53 +01:00
Add_custom_target (plmyddas ALL DEPENDS ${MYDDAS_YPP} ${MYDDAS_YAP} ) # WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
2016-04-05 08:18:09 +01:00
install(FILES ${MYDDAS_YAP}
DESTINATION ${libpl}
2016-04-12 16:22:53 +01:00
)