summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2021-05-22 15:29:58 +0200
committerSebastian Pipping <sebastian@pipping.org>2021-05-22 19:07:49 +0200
commit100bc7072ca63a9053b4e34b80d084896cfb143e (patch)
tree1d6b26534f7d057732620caf886ad35f3e85b7f0
parentcaaf43470d360af7d76ee6a5f337c962831ce0f6 (diff)
downloadlibexpat-git-100bc7072ca63a9053b4e34b80d084896cfb143e.tar.gz
README.md: Make CMake config mode example more clear
-rw-r--r--expat/README.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/expat/README.md b/expat/README.md
index b56390eb..0d539881 100644
--- a/expat/README.md
+++ b/expat/README.md
@@ -45,7 +45,7 @@ This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake
Notice the *uppercase* `EXPAT` in the following example:
```cmake
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.0) # or 3.10, see below
project(hello VERSION 1.0.0)
@@ -55,12 +55,12 @@ add_executable(hello
hello.c
)
-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
- target_link_libraries(hello PUBLIC EXPAT::EXPAT)
-else()
- target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS})
- target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES})
-endif()
+# a) for CMake >=3.10 (see CMake's FindEXPAT docs)
+target_link_libraries(hello PUBLIC EXPAT::EXPAT)
+
+# b) for CMake >=3.0
+target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS})
+target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES})
```
### b) Config Mode