Skip to content

Commit fb20e22

Browse files
committed
Extended README.md and restructured CMake configuration
1 parent a66912e commit fb20e22

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

CMakeLists.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
cmake_minimum_required(VERSION 2.6)
2-
32
project (xodr)
3+
include(FindXercesC)
44

55
# STATIC library output directory
66
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
77

8-
add_library(libXodr STATIC src/OpenDRIVE_1.4H.cpp)
8+
add_library(xodr STATIC src/OpenDRIVE_1.4H.cpp)
9+
set_property(TARGET xodr PROPERTY POSITION_INDEPENDENT_CODE ON)
910

10-
find_path(XSD_INCLUDE xsd)
11-
find_path(XERCES_INCLUDE xercesc)
12-
find_library(XERCES_LIB xerces-c_3.lib)
11+
find_package(XercesC REQUIRED)
12+
find_path(XSD_INCLUDE_DIR xsd)
1313

14-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${XSD_INCLUDE} ${XERCES_INCLUDE})
14+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${XSD_INCLUDE_DIR} ${XercesC_INCLUDE_DIR})
1515

16-
target_link_libraries(libXodr "${XERCES_LIB}")
16+
target_link_libraries(${PROJECT_NAME} ${XercesC_LIBRARY})

README.md

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
# xodr
2-
Easily accessible C++ object structure of OpenDRIVE.
2+
Easily accessible C++ object structure of OpenDRIVE automatically generated from the [OpenDRIVE XSD schema](http://opendrive.org/download.html). Currently only OpenDRIVE 1.4 is supported.
3+
4+
## Building
5+
### Dependencies
6+
Make sure to meet the dependencies in advande. **xodr** depends on
7+
- [CodeSynthesis XSD](http://codesynthesis.com/products/xsd/) in conjunction with
8+
- [Xerces-C++](https://xerces.apache.org/xerces-c/)
9+
### Building on Unix
10+
With CMake as plattform-independent build tool **xodr** can be configured for various native build environments. An exemplary configuration for Make under Unix:
11+
```
12+
cd xodr
13+
mkdir build
14+
cd build
15+
cmake ..
16+
```
17+
To build the project afterwards run
18+
```
19+
make
20+
```
21+
If everything went fine you will find the resulting library in the `lib/` folder of the project root.
322

423
## Source Code Generation
5-
The C++ class structure can been automatically generated, e.g., using the XML data binding tool `xsd` from [CodeSynthesis XSD](http://codesynthesis.com/products/xsd/). The code used here in `xodr` was generated as follows:
24+
For convenience the underlying OpenDRIVE schema is provided in `schema/` but can be obtained from the [OpenDRIVE download section](http://opendrive.org/download.html) in recent and previous versions. The C++ class structure was generated with [CodeSynthesis XSD](http://codesynthesis.com/products/xsd/) and can be automatically re-generated using the XML data binding tool `xsd`. The code used in **xodr** was generated with `xsd` version 4.0.0 as follows:
625
```
7-
xsd cxx-tree --hxx-suffix .h --cxx-suffix .cpp --reserved-name access=parkingSpace_access --reserved-name link=lane_link OpenDRIVE_1.4H.xsd
26+
xsd cxx-tree --hxx-suffix .h --cxx-suffix .cpp --reserved-name access=parkingSpace_access --reserved-name link=lane_link schema/OpenDRIVE_1.4H.xsd
827
```
28+
## Licence
29+
Due to XSD's [FLOSS Exception](http://www.codesynthesis.com/projects/xsd/FLOSSE) the generated code is includable in various Free/Libre and Open Source Software projects, see [XSD Licence](http://www.codesynthesis.com/products/xsd/license.xhtml).

0 commit comments

Comments
 (0)