aboutsummaryrefslogtreecommitdiff
path: root/mwe/dynlink/exec
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-09-28 14:45:53 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-09-28 14:45:53 +0200
commit506090032a07f2f3a74a44d8c8774cbdd252c947 (patch)
treeeb9cb129e39ba43a9460fc203538dfa84d138773 /mwe/dynlink/exec
parentf3eeedc91a04ca0651e0fe78a2119e7e3e38e391 (diff)
WIP ExternalProject test
Diffstat (limited to 'mwe/dynlink/exec')
-rw-r--r--mwe/dynlink/exec/CMakeLists.txt10
-rw-r--r--mwe/dynlink/exec/main.c3
2 files changed, 11 insertions, 2 deletions
diff --git a/mwe/dynlink/exec/CMakeLists.txt b/mwe/dynlink/exec/CMakeLists.txt
index 5335f0f..465b45e 100644
--- a/mwe/dynlink/exec/CMakeLists.txt
+++ b/mwe/dynlink/exec/CMakeLists.txt
@@ -5,12 +5,20 @@ set(CMAKE_CXX_STANDARD 20)
project(main C CXX)
+add_executable(main main.c)
+
# Since we have the source code for the test library, we might as well let
# CMake use it so it automatically picks up the interface headers and compiles
# the library for us. The same can be achieved manually, but is more code.
add_subdirectory(../lib test)
-add_executable(main main.c)
+# include(ExternalProject)
+# ExternalProject_Add(test_ext
+# SOURCE_DIR ../../lib
+# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX="${CMAKE_BINARY_DIR}/ext"
+# )
+# add_dependencies(main test_ext)
+# find_package(test REQUIRED)
# Make sure ld.so (linux) looks in the same folder as the final executable for
# the .so dependency
diff --git a/mwe/dynlink/exec/main.c b/mwe/dynlink/exec/main.c
index 2bbdc20..ea55feb 100644
--- a/mwe/dynlink/exec/main.c
+++ b/mwe/dynlink/exec/main.c
@@ -1,7 +1,8 @@
-#include <lib.h>
+#include <test.h>
int main() {
library_function();
return 0;
}
+