From df1897c37c70b6c7cc2d2e5d92530a30b129c67a Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@fit.cvut.cz>
Date: Tue, 25 Jan 2022 16:47:38 +0100
Subject: [PATCH] aql: configure header for standard library files location

Let's start working on a standard library [1]. The idea is that we
bundle some aql files with predefined functions (and procedures) and we
load them when aql prompt starts.

So let's prepare a configuration file with a location for the scripts.
The location is currently only in local dev tree. We will later change
that to some /usr/share or /usr/lib location.

[1] https://gitlab.fit.cvut.cz/algorithms-library-toolkit/automata-library/issues/221
---
 aql2/CMakeLists.txt      | 8 ++++++++
 aql2/src/aql.h.in        | 4 ++++
 aql2/src/stdlib/.gitkeep | 0
 3 files changed, 12 insertions(+)
 create mode 100644 aql2/src/aql.h.in
 create mode 100644 aql2/src/stdlib/.gitkeep

diff --git a/aql2/CMakeLists.txt b/aql2/CMakeLists.txt
index 2354f94aff..1a2f809958 100644
--- a/aql2/CMakeLists.txt
+++ b/aql2/CMakeLists.txt
@@ -29,3 +29,11 @@ if(FETCH_NEW_TCLAP)
 	target_include_directories(aql2 SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/tclap-src/include/) # There are many warnings inside tclap, use -isystem instead of -I
 endif()
 # hack end
+
+# stdlib
+set(STDLIB_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/stdlib")
+configure_file(
+	${CMAKE_CURRENT_SOURCE_DIR}/src/aql.h.in
+	${CMAKE_CURRENT_BINARY_DIR}/aql.h
+	)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
diff --git a/aql2/src/aql.h.in b/aql2/src/aql.h.in
new file mode 100644
index 0000000000..8fb03c9f30
--- /dev/null
+++ b/aql2/src/aql.h.in
@@ -0,0 +1,4 @@
+#pragma once
+
+#define STDLIB_DIRECTORY "@STDLIB_DIRECTORY@"
+
diff --git a/aql2/src/stdlib/.gitkeep b/aql2/src/stdlib/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
-- 
GitLab