This commit is contained in:
Vlad Vesa 2023-02-23 21:20:39 +00:00 committed by GitHub
commit befee21c91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 64 additions and 43 deletions

View file

@ -7,8 +7,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: sudo apt install -y cmake g++-5 gcc-5
- name: cmake
@ -26,8 +24,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: sudo apt install -y cmake gcc g++
- name: cmake
@ -41,8 +37,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: sudo apt install -y cmake gcc g++
- name: cmake
@ -56,8 +50,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: sudo apt install -y cmake clang-3.9
- name: cmake
@ -75,8 +67,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: sudo apt install -y cmake clang
- name: cmake
@ -94,8 +84,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: sudo apt install -y cmake clang
- name: cmake
@ -113,8 +101,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: brew install cmake
- name: cmake
@ -128,8 +114,6 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: brew install cmake
- name: cmake

2
.gitignore vendored
View file

@ -18,3 +18,5 @@ compile_commands.json
[._]s[a-w][a-z]
*.cppr
*.hr
cmake-build-debug
deps

9
.gitmodules vendored
View file

@ -1,9 +0,0 @@
[submodule "src/cppgtfs"]
path = src/cppgtfs
url = https://github.com/ad-freiburg/cppgtfs.git
[submodule "src/xml"]
path = src/xml
url = https://github.com/patrickbr/pfxml.git
[submodule "src/configparser"]
path = src/configparser
url = https://git.patrickbrosi.de/patrick/configparser

14
.pkg Normal file
View file

@ -0,0 +1,14 @@
[cppgtfs]
url=git@github.com:vesavlad/cppgtfs.git
branch=add-propper-cmake-project-definition
commit=69dcdbf392b30777dbfc943c6ca512f33df8eac6
[config-parser]
url=git@github.com:vesavlad/config-parser.git
branch=master
commit=f96586a5522312fc4d1d8aa67cc5b7ec9039a825
[pfxml]
url=git@github.com:patrickbr/pfxml.git
branch=master
commit=c7202d1435b6a4d460fc38b59ca131620b204c4f

View file

@ -1,6 +1,7 @@
cmake_minimum_required (VERSION 2.8)
project (pfaedle)
include(cmake/pkg.cmake)
if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
@ -63,14 +64,6 @@ else()
set(VERSION_GIT_FULL "${VERSION_GIT}-${VERSION_GIT_IS_DIRTY}")
endif()
# Download submodules if needed
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/src/configparser/.git OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/cppgtfs/.git OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/xml/.git)
execute_process(
COMMAND git submodule update --init --recursive
)
endif()
add_subdirectory(src)
# tests

40
cmake/pkg.cmake Normal file
View file

@ -0,0 +1,40 @@
set(pkg-bin "${CMAKE_BINARY_DIR}/dl/pkg")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(pkg-url "pkg")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(pkg-url "pkg.exe")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(pkg-url "pkgosx")
else()
message(STATUS "Not downloading pkg tool. Using pkg from PATH.")
set(pkg-bin "pkg")
endif()
if (pkg-url)
if (NOT EXISTS ${pkg-bin})
message(STATUS "Downloading pkg binary from https://github.com/motis-project/pkg/releases/latest/download/${pkg-url}")
file(DOWNLOAD "https://github.com/motis-project/pkg/releases/latest/download/${pkg-url}" ${pkg-bin})
if (UNIX)
execute_process(COMMAND chmod +x ${pkg-bin})
endif()
else()
message(STATUS "Pkg binary located in project.")
endif()
endif()
message(STATUS "${pkg-bin} -l -h -f")
execute_process(
COMMAND ${pkg-bin} -l -h -f
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps")
add_subdirectory(deps)
endif()
set_property(
DIRECTORY
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/.pkg"
)

View file

@ -10,6 +10,4 @@ include_directories(
add_subdirectory(util)
add_subdirectory(pfaedle)
add_subdirectory(cppgtfs)
add_subdirectory(configparser)
add_subdirectory(shapevl)

@ -1 +0,0 @@
Subproject commit ca166b3446d5bb8b5fb8c6f637ca3f9cb0a8ff3b

@ -1 +0,0 @@
Subproject commit 192272f4ab542e75ffad9b545be5cc68e5599828

View file

@ -17,8 +17,9 @@ configure_file (
add_executable(pfaedle ${pfaedle_main})
add_library(pfaedle_dep ${pfaedle_SRC})
target_link_libraries(pfaedle_dep PRIVATE ad_cppgtfs pfxml configparser)
include_directories(pfaedle_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src)
target_link_libraries(pfaedle pfaedle_dep util configparser ad_cppgtfs -lpthread ${LIBZIP_LIBRARY})
target_link_libraries(pfaedle pfaedle_dep util configparser -lpthread ${LIBZIP_LIBRARY})
add_subdirectory(tests)

View file

@ -18,7 +18,7 @@
#include "ad/cppgtfs/Parser.h"
#include "ad/cppgtfs/Writer.h"
#include "ad/cppgtfs/gtfs/flat/Agency.h"
#include "ad/util/CsvWriter.h"
#include "ad/cppgtfs/util/CsvWriter.h"
#include "pfaedle/gtfs/Writer.h"
using ad::cppgtfs::Parser;

View file

@ -24,7 +24,7 @@
#include "util/Misc.h"
#include "util/Nullable.h"
#include "util/log/Log.h"
#include "xml/pfxml.h"
#include "pfxml/pfxml.h"
using ad::cppgtfs::gtfs::Stop;
using pfaedle::osm::BlockSearch;

View file

@ -25,7 +25,7 @@
#include "util/Nullable.h"
#include "util/geo/Geo.h"
#include "util/xml/XmlWriter.h"
#include "xml/pfxml.h"
#include "pfxml/pfxml.h"
namespace pfaedle {
namespace osm {

View file

@ -12,6 +12,7 @@ include_directories(
add_executable(shapevl ${shapevl_main})
add_library(shapevl_dep ${shapevl_SRC})
target_link_libraries(shapevl_dep PUBLIC ad_cppgtfs)
include_directories(shapevl_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src)
target_link_libraries(shapevl shapevl_dep util ad_cppgtfs -lpthread ${LIBZIP_LIBRARY})
target_link_libraries(shapevl shapevl_dep util -lpthread ${LIBZIP_LIBRARY})

@ -1 +0,0 @@
Subproject commit ee9210828b1d1f81fb9ff9f3b7da87327c3390e6