mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-14 16:20:45 +00:00
README.md: Make CMake config mode example more clear
This commit is contained in:
parent
caaf43470d
commit
100bc7072c
1 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue