Skip to content

Commit

Permalink
Fix workflows.
Browse files Browse the repository at this point in the history
Find Python3 instead of Python (to work with py-build-cmake)
Do not generate pb2 files for eCAL protos.
  • Loading branch information
KerstinKeller committed Aug 11, 2023
1 parent 65c3e5d commit 31f99e5
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 169 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
-DBUILD_APPS=ON \
-DBUILD_SAMPLES=ON \
-DBUILD_TIME=ON \
-DBUILD_PY_BINDING=OFF \
-DBUILD_PY_BINDING=ON \
-DBUILD_CSHARP_BINDING=OFF \
-DBUILD_ECAL_TESTS=ON \
-DECAL_INCLUDE_PY_SAMPLES=OFF \
Expand All @@ -86,7 +86,9 @@ jobs:
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
-DPython_FIND_STRATEGY=LOCATION \
-DPython_FIND_REGISTRY=NEVER
sudo mkdir /etc/ecal
sudo cp "$GITHUB_WORKSPACE/ecal/core/cfg/ecal.ini" /etc/ecal
shell: bash
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-ubuntu-20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
-DBUILD_APPS=ON \
-DBUILD_SAMPLES=ON \
-DBUILD_TIME=ON \
-DBUILD_PY_BINDING=OFF \
-DBUILD_PY_BINDING=ON \
-DBUILD_STANDALONE_PY_WHEEL=ON \
-DBUILD_CSHARP_BINDING=OFF \
-DBUILD_ECAL_TESTS=ON \
Expand All @@ -92,7 +92,8 @@ jobs:
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu \
-DPython_FIND_VIRTUALENV=ONLY
sudo mkdir /etc/ecal
sudo cp "$GITHUB_WORKSPACE/ecal/core/cfg/ecal.ini" /etc/ecal
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
-DBUILD_APPS=ON \
-DBUILD_SAMPLES=ON \
-DBUILD_TIME=ON \
-DBUILD_PY_BINDING=OFF \
-DBUILD_PY_BINDING=ON \
-DBUILD_STANDALONE_PY_WHEEL=ON \
-DBUILD_CSHARP_BINDING=OFF \
-DBUILD_ECAL_TESTS=ON \
Expand All @@ -92,7 +92,8 @@ jobs:
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu \
-DPython_FIND_VIRTUALENV=ONLY
sudo mkdir /etc/ecal
sudo cp "$GITHUB_WORKSPACE/ecal/core/cfg/ecal.ini" /etc/ecal
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ set(eCAL_VERSION ${eCAL_VERSION_STRING})
include(helper_functions/ecal_add_functions)
include(helper_functions/ecal_helper_functions)
include(helper_functions/ecal_install_functions)
include(helper_functions/ecal_python_functions)

if(MSVC)
set(eCAL_PLATFORM_TOOLSET ${CMAKE_VS_PLATFORM_TOOLSET})
Expand Down
6 changes: 3 additions & 3 deletions app/app_pb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
ecal_install_library(${PROJECT_NAME})

if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
#protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
#target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
#set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER app/app_pb)
112 changes: 0 additions & 112 deletions cmake/helper_functions/ecal_python_functions.cmake

This file was deleted.

83 changes: 50 additions & 33 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,68 @@

class eCALConan(ConanFile):
name = "ecal"
settings = "os", "compiler", "arch", "build_type"
settings = "os", "compiler", "arch"
license = "BSD-3-Clause"
generators = "virtualenv"
build_requires = "cmake/3.21.1"
generators = "virtualenv", "virtualrunenv"
python_requires = {"cmake-presets-generator/0.1.0@ild/stable", "conancontifile/0.0.19@ild/stable"}

def build_requirements(self):
self.build_requires("doxygen/1.9.1")
self.build_requires("doxygen/[*]@ild/stable")
self.build_requires("cmake/[*]@ild/stable")
self.build_requires("cmake/[*]@ild/stable")

def requirements(self):
self.requires("hdf5/1.10.6")
self.requires("protobuf/3.17.1")
self.requires("libcurl/7.78.0")
self.requires("qt/5.15.2")
self.requires("spdlog/1.9.2")
#self.requires("tclap/1.2.4")
#self.requires("asio/1.19.2")
self.requires("gtest/1.11.0")
self.requires("tinyxml2/8.0.0")
self.requires("openssl/1.1.1l", override=True)

def configure(self):
if self.settings.os == "Windows":
self.options["qt"].shared = True
self.options["qt"].qtwinextras = True
#self.requires("asio/[*]@ild/stable"")
#self.requires("tclap/[*]@ild/stable"")
self.requires("capnproto/[*]@ild/stable")
self.requires("cmakefunctions/[*]@ild/stable")
self.requires("curl/[*]@ild/stable")
self.requires("fineftp-server/[*]@ild/stable")
self.requires("flatbuffers/[*]@ild/stable")
self.requires("ftxui/[*]@ild/stable")
self.requires("gtest/[*]@ild/stable")
self.requires("hdf5/[*]@ild/stable")
self.requires("openssl/1.1.1i@ild/stable")
self.requires("protobuf/3.23.4@ild/stable")
self.requires("qt/[*]@ild/stable")
self.requires("qwt/[*]@ild/stable")
self.requires("recycle/[*]@ild/stable")
self.requires("simpleini/[*]@ild/stable")
self.requires("spdlog/[*]@ild/stable")
self.requires("tcp-pubsub/[*]@ild/stable")
self.requires("termcolor/[*]@ild/stable")
self.requires("tinyxml2/[*]@ild/stable")
self.requires("udpcap/[*]@ild/stable")
self.requires("yaml-cpp/[*]@ild/stable")

def generate(self):
# Don't generate the config files for doxygen. They don't work properlyexit
self.deps_cpp_info["doxygen"].set_property("cmake_find_mode", "none")
cmake = CMakeDeps(self)
cmake.generate()

tc = CMakeToolchain(self)
CMakePresets = self.python_requires["cmake-presets-generator"].module.CMakePresets
cmake_folder = self.recipe_folder
tc = CMakePresets(self, cmake_folder=".")
# customize toolchain "tc"
tc.variables["BUILD_DOCS"] = "ON"
tc.variables["BUILD_ECAL_TESTS"] = "ON"
tc.variables["BUILD_PY_BINDING"] = "ON"
tc.variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = "ON"
tc.variables["HAS_CAPNPROTO"] = "ON"
tc.variables["HAS_FLATBUFFERS"] = "ON"
tc.variables["ECAL_INCLUDE_PY_SAMPLES"] = "ON"
tc.variables["ECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_CURL"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_SPDLOG"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_FINEFTP"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_FTXUI"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_GTEST"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_PROTOBUF"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_HDF5"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_PROTOBUF"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_QWT"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_RECYCLE"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_RECYCLE"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_SPDLOG"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_TCP_PUBSUB"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_TERMCOLOR"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_TINYXML2"] = "OFF"
tc.variables["BUILD_DOCS"] = "ON"
tc.variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = "ON"
if self.settings.os == "Windows":
tc.variables["Protobuf_PROTOC_EXECUTABLE"] = os.path.join(self.deps_cpp_info["protobuf"].rootpath, "bin", "protoc.exe").replace('\\', '/')
else:
tc.variables["Protobuf_PROTOC_EXECUTABLE"] = os.path.join(self.deps_cpp_info["protobuf"].rootpath, "bin", "protoc")
tc.variables["ECAL_THIRDPARTY_BUILD_UDPCAP"] = "OFF"
tc.variables["ECAL_THIRDPARTY_BUILD_YAML-CPP"] = "OFF"
tc.generate()


Expand Down
6 changes: 3 additions & 3 deletions contrib/ecaltime/ecaltime_pb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
ecal_install_library(${PROJECT_NAME})

if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
#protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
#target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
#set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER contrib/ecaltime/ecaltime_pb)
6 changes: 3 additions & 3 deletions ecal/core_pb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
ecal_install_library(${PROJECT_NAME})

if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
#protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
#target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
#set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER ecal/core_pb)
5 changes: 2 additions & 3 deletions lang/python/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@

project(_ecal_core_py)

find_package(Python COMPONENTS Development Interpreter)
find_package(Python3 REQUIRED COMPONENTS Development.Module)
find_package(Protobuf REQUIRED)

set(ecal_lang_py_src
src/ecal_wrap.cxx
)

ecal_add_python_module(${PROJECT_NAME} SOURCES ${ecal_lang_py_src} PYTHON_CODE ${CMAKE_CURRENT_SOURCE_DIR}/ecal)
Python3_add_library(${PROJECT_NAME} MODULE ${ecal_lang_py_src})

target_link_libraries(${PROJECT_NAME}
PRIVATE
Python::Python
eCAL::core
eCAL::core_pb
)
Expand Down
7 changes: 2 additions & 5 deletions lang/python/ecalhdf5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,21 @@

project(_ecal_hdf5_py)

find_package(Python COMPONENTS Development)
find_package(Python3 REQUIRED COMPONENTS Development.Module)

set(ecal_lang_py_src
src/ecalhdf5_wrap.cxx
)

ecal_add_python_module(${PROJECT_NAME} SOURCES ${ecal_lang_py_src} PYTHON_CODE ${CMAKE_CURRENT_SOURCE_DIR}/ecal)
Python3_add_library(${PROJECT_NAME} MODULE ${ecal_lang_py_src})

target_link_libraries(${PROJECT_NAME}
PRIVATE
Python::Python
eCAL::hdf5
)

target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)

message(STATUS "Install dir: ${PY_BUILD_CMAKE_MODULE_NAME}")

install(TARGETS ${PROJECT_NAME}
EXCLUDE_FROM_ALL
COMPONENT python_modules
Expand Down

0 comments on commit 31f99e5

Please sign in to comment.