aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md29
1 files changed, 27 insertions, 2 deletions
diff --git a/README.md b/README.md
index 35bf550..b0eb182 100644
--- a/README.md
+++ b/README.md
@@ -20,8 +20,11 @@ It follows the standard as described here:
20Using This Library 20Using This Library
21------------------ 21------------------
22 22
23### Using CMake 23### Using CMake
24Once the library has been installed, add to your project `CMakeLists.txt` : 24
25#### Use installed library
26
27Once the library has been installed (for example by compiling from source or installing it via a package manager), add to your project `CMakeLists.txt` :
25~~~cmake 28~~~cmake
26... 29...
27find_package(dlfcn-win32 REQUIRED) 30find_package(dlfcn-win32 REQUIRED)
@@ -45,6 +48,28 @@ target_link_libraries(<target> ${CMAKE_DL_LIBS})
45 48
46When cross-compiling you might want to set [`CMAKE_CROSSCOMPILING_EMULATOR`](https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html) to the path of wine to run tests. 49When cross-compiling you might want to set [`CMAKE_CROSSCOMPILING_EMULATOR`](https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html) to the path of wine to run tests.
47 50
51#### Download and build library as part of CMake build
52
53If you do not have installed and you do not want to install the library, you can also download and build it using [CMake's FetchContent module](https://cmake.org/cmake/help/latest/module/FetchContent.html). Just add in your CMake project:
54~~~cmake
55...
56if (WIN32)
57 include(FetchContent)
58 FetchContent_Declare(
59 dlfcn-win32
60 GIT_REPOSITORY "https://github.com/dlfcn-win32/dlfcn-win32.git"
61 GIT_TAG "v1.5.0"
62 SYSTEM
63 )
64 FetchContent_MakeAvailable(dlfcn-win32)
65 set(CMAKE_DL_LIBS dlfcn-win32::dl)
66endif ()
67...
68target_link_libraries(<target> ${CMAKE_DL_LIBS})
69...
70~~~
71
72
48Authors 73Authors
49------- 74-------
50 75