move dependencies to use pkg

This commit is contained in:
Vlad Vesa 2023-02-23 17:36:24 +02:00
parent 97cd3e988d
commit 9f23a5f7c0
5 changed files with 46 additions and 5 deletions

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "src/configparser"]
path = src/configparser
url = https://git.patrickbrosi.de/patrick/configparser

5
.pkg
View file

@ -3,6 +3,11 @@
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

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,5 +10,4 @@ include_directories(
add_subdirectory(util)
add_subdirectory(pfaedle)
add_subdirectory(configparser)
add_subdirectory(shapevl)

View file

@ -17,7 +17,7 @@ configure_file (
add_executable(pfaedle ${pfaedle_main})
add_library(pfaedle_dep ${pfaedle_SRC})
target_link_libraries(pfaedle_dep PRIVATE ad_cppgtfs pfxml)
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 -lpthread ${LIBZIP_LIBRARY})