Created
June 24, 2024 10:42
-
-
Save ramajd/0c6ae50993c9e6213a6cc041b6e97b1b to your computer and use it in GitHub Desktop.
Oracle Pro*C macro for CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro(compile_proc) | |
set(options) | |
set(oneValueArgs ARG) | |
set(multiValueArgs FILES) | |
cmake_parse_arguments(ARGUMENT "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}") | |
foreach(procfile ${ARGUMENT_FILES}) | |
add_custom_command( | |
OUTPUT ${procfile}.cpp | |
COMMAND | |
LD_LIBRARY_PATH=${ORACLE_HOME} ${ORACLE_HOME}/sdk/proc | |
DEFINE=UNIX DEFINE=Linux DEFINE=PROC SQLCHECK=SYNTAX LTYPE=NONE MODE=ORACLE LINES=YES CODE=CPP CPP_SUFFIX=cpp DEF_SQLCODE=YES | |
include=/usr/lib/clang/17/include/ | |
include=${CMAKE_CURRENT_SOURCE_DIR} | |
iname=${CMAKE_CURRENT_SOURCE_DIR}/${procfile} | |
oname=${CMAKE_CURRENT_BINARY_DIR}/${procfile}.cpp | |
DEPENDS | |
${procfile} | |
COMMENT "Pre-Compile ${procfile}" | |
) | |
list(APPEND "${ARGUMENT_ARG}" ${procfile}.cpp) | |
endforeach() | |
endmacro(compile_proc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment