summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/example-project/CMakeLists.txt11
-rw-r--r--scripts/example-project/example.cpp3
-rw-r--r--scripts/wabt-config.cmake.in5
3 files changed, 19 insertions, 0 deletions
diff --git a/scripts/example-project/CMakeLists.txt b/scripts/example-project/CMakeLists.txt
new file mode 100644
index 00000000..0ff3bb32
--- /dev/null
+++ b/scripts/example-project/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.16)
+project(example CXX)
+
+enable_testing()
+
+find_package(wabt REQUIRED)
+
+add_executable(example example.cpp)
+target_link_libraries(example PRIVATE wabt::wabt)
+
+add_test(NAME example COMMAND example)
diff --git a/scripts/example-project/example.cpp b/scripts/example-project/example.cpp
new file mode 100644
index 00000000..680b99e3
--- /dev/null
+++ b/scripts/example-project/example.cpp
@@ -0,0 +1,3 @@
+#include <wabt/ir.h>
+
+int main () {}
diff --git a/scripts/wabt-config.cmake.in b/scripts/wabt-config.cmake.in
index 56e8bf8e..d66ff676 100644
--- a/scripts/wabt-config.cmake.in
+++ b/scripts/wabt-config.cmake.in
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.8)
@PACKAGE_INIT@
+if ("@HAVE_OPENSSL_SHA_H@")
+ include(CMakeFindDependencyMacro)
+ find_dependency(OpenSSL)
+endif ()
+
include("${CMAKE_CURRENT_LIST_DIR}/wabt-targets.cmake")
check_required_components(wabt)