Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci #2

Merged
merged 2 commits into from
Jun 24, 2023
Merged

Ci #2

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
1 change: 0 additions & 1 deletion .github/workflows/macos-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:

- name: Install
run: |
brew install tinyxml2
sudo mkdir -p /opt/xodr && sudo chmod a+w /opt/xodr
cd ${{ github.workspace }} && python3 setup.py

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ubuntu-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Install
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt update
apt install -y python3-dev git pkg-config g++ cmake libtinyxml2-dev

- name: Build
run: |
bash -c "cd /workspace/${{ github.repository }} && python3 setup.py && source install/setup.bash && ./scripts/build.sh"

- name: Test
run: |
bash -c "cd /workspace/${{ github.repository }} && source install/setup.bash && ./scripts/run_tests.sh"
Expand Down
62 changes: 40 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,37 @@ pkg_check_modules(NanoFlann REQUIRED nanoflann)
pkg_check_modules(Cactus REQUIRED cactus>=1.1.0)

include_directories(
include ${Tinyxml2_INCLUDE_DIRS} ${OpenDriveCpp_INCLUDE_DIRS}
${NanoFlann_INCLUDE_DIRS} ${Cactus_INCLUDE_DIRS})

link_directories(${Tinyxml2_LIBRARY_DIRS} ${OpenDriveCpp_LIBRARY_DIRS}
${Cactus_LIBRARY_DIRS})

file(
GLOB
OPENDRIVE_ENGINE_SRCS
include
${Tinyxml2_INCLUDE_DIRS}
${OpenDriveCpp_INCLUDE_DIRS}
${NanoFlann_INCLUDE_DIRS}
${Cactus_INCLUDE_DIRS}
)

link_directories(
${Tinyxml2_LIBRARY_DIRS}
${OpenDriveCpp_LIBRARY_DIRS}
${Cactus_LIBRARY_DIRS}
)

file(GLOB OPENDRIVE_ENGINE_SRCS
"src/*.cc"
"src/common/*.cc"
"src/math/*.cc"
"src/geometry/*.cc"
"src/algo/kdtree/*.cc"
"src/algo/routing/*.cc")
"src/algo/routing/*.cc"
)

add_library(${TARGET_NAME} ${OPENDRIVE_ENGINE_SHARED_TYPE}
${OPENDRIVE_ENGINE_SRCS})
${OPENDRIVE_ENGINE_SRCS}
)

target_link_libraries(${TARGET_NAME} ${Tinyxml2_LIBRARIES}
${OpenDriveCpp_LIBRARIES} ${Cactus_LIBRARIES})
target_link_libraries(${TARGET_NAME}
${Tinyxml2_LIBRARIES}
${OpenDriveCpp_LIBRARIES}
${Cactus_LIBRARIES}
)

if(BUILD_OPENDRIVE_ENGINE_TEST)
add_subdirectory(tests)
Expand Down Expand Up @@ -84,26 +94,34 @@ write_basic_package_version_file(
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)

install(FILES "${PROJECT_BINARY_DIR}/pkgconfig/${TARGET_NAME}.pc"
DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig")
install(FILES
"${PROJECT_BINARY_DIR}/pkgconfig/${TARGET_NAME}.pc"
DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig"
)

install(EXPORT ${TARGET_NAME}-targets
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${TARGET_NAME}")
install(EXPORT
${TARGET_NAME}-targets
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${TARGET_NAME}"
)

install(FILES "${PROJECT_BINARY_DIR}/cmake/${TARGET_NAME}-config.cmake"
"${PROJECT_BINARY_DIR}/cmake/${TARGET_NAME}-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${TARGET_NAME}")
install(FILES
"${PROJECT_BINARY_DIR}/cmake/${TARGET_NAME}-config.cmake"
"${PROJECT_BINARY_DIR}/cmake/${TARGET_NAME}-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${TARGET_NAME}"
)

install(
DIRECTORY include/${TARGET_NAME}/
DESTINATION include/${TARGET_NAME}
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hpp")
PATTERN "*.hpp"
)

install(
TARGETS ${TARGET_NAME}
EXPORT ${TARGET_NAME}-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
RUNTIME DESTINATION bib
)
82 changes: 82 additions & 0 deletions packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"scripts": {
"before": [
""
],
"after": [
""
]
},
"dependencies": {
"setup": {
"addr": "https://github.com/minhanghuang/setup.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}"
]
},
"googletest": {
"addr": "https://github.com/google/googletest.git",
"commit": "v1.13.x",
"cmake_optione": [
"-DCMAKE_CXX_STANDARD=14",
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"tinyxml2": {
"addr": "https://github.com/leethomason/tinyxml2.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"cactus": {
"addr": "https://github.com/minhanghuang/cactus.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"cyclone": {
"addr": "https://github.com/minhanghuang/cyclone.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"opendrive-cpp": {
"addr": "https://github.com/minhanghuang/opendrive-cpp.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"yaml-cpp": {
"addr": "https://github.com/jbeder/yaml-cpp.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"nanoflann": {
"addr": "https://github.com/jlblancoc/nanoflann.git",
"cmake_optione": [
"-DBUILD_SHARED_LIBS=ON"
]
},
"json": {
"addr": "https://github.com/nlohmann/json.git",
"cmake_optione": [
"-DCMAKE_INSTALL_PREFIX={install_path}",
"-DBUILD_SHARED_LIBS=ON"
]
},
"opendrive-files": {
"addr": "https://github.com/minhanghuang/opendrive-files.git",
"cmake_optione": [
"-DBUILD_SHARED_LIBS=ON",
"-DCMAKE_INSTALL_PREFIX=/opt/xodr"
]
}
}
}
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function main() {
echo "--------------------- opendrive-engine build ------------------"
echo "---------------------------------------------------------------"
mkdir -p build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_OPENDRIVE_ENGINE_TEST=ON ..
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug ..
make -j4
}

Expand Down
Loading