Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ else()
endif()

find_package(Boost REQUIRED CONFIG COMPONENTS date_time iostreams thread)
find_package(LibArchive REQUIRED)

link_directories(${LibOSRM_LIBRARY_DIRS})
add_executable(osrm-example example.cpp)

find_package(LibOSRM REQUIRED)

set(LibOSRM_LINKABLE_LIBRARIES ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
set(LibOSRM_LINKABLE_LIBRARIES ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES} LibArchive::LibArchive)
list(REMOVE_DUPLICATES LibOSRM_LINKABLE_LIBRARIES)
target_link_libraries(osrm-example ${LibOSRM_LINKABLE_LIBRARIES})
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
Expand Down
6 changes: 3 additions & 3 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ cd example/
mkdir build && cd build/
cmake ..
cmake --build .
./osrm-example ../test/data/mld/monaco.osrm
./osrm-example ../../test/data/mld/monaco.osrm
```

The expected output is the distance and duration of the route set in the `example.cpp`.

### `example.js`

To run this module in Node.js you need to install [node-cmake](https://www.npmjs.com/package/node-cmake) in the project's repo root level and pass the flag `-DENABLE_NODE_BINDINGS=On` when building the main project.
To run this module in Node.js you need to pass the flag `-DENABLE_NODE_BINDINGS=On` when building the main project.

Refer to the sub-section on preparing test data for the application in this document.

Expand All @@ -48,7 +48,7 @@ You can reliably change the thread pool size of the process by setting the `UV_T
UV_THREADPOOL_SIZE=16 node example.js
```

See https://nodejs.org/docs/latest-v18.x/api/os.html#osavailableparallelism for more info.
See https://nodejs.org/docs/latest-v20.x/api/os.html#osavailableparallelism for more info.

Then you can test it with:

Expand Down
Loading