diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebd59c896..bd7092256 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,3 +85,25 @@ jobs: # Test python packages python -c "import wearables" python -c "import hde" + + - name: Test standalone build of bindings + shell: bash -l {0} + run: | + cd bindings + mkdir -p build + cd build + cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DBUILD_TESTING:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON \ + -DHDE_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON .. + cmake --build . --config ${{ matrix.build_type }} + ctest --output-on-failure -C ${{ matrix.build_type }} . + cmake --install . --config ${{ matrix.build_type }} + + - name: Check install of standalone build of bindings + shell: bash -l {0} + run: | + # Test python packages + python -c "import wearables" + python -c "import hde" + + diff --git a/CMakeLists.txt b/CMakeLists.txt index 461a7d12d..fb8a0a330 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ # SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(HumanDynamicsEstimation LANGUAGES CXX - VERSION 4.0.2) + VERSION 4.0.3) # ===================== # PROJECT CONFIGURATION @@ -43,11 +43,7 @@ include(AddWarningsConfigurationToTarget) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Shared/Dynamic or Static library? -if(MSVC) - option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" OFF) -else() - option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" ON) -endif() +option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index a34237d89..d6b837e33 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -21,6 +21,8 @@ if(HDE_BINDINGS_BUILD_STANDALONE) find_package(WearableData REQUIRED) find_package(HumanDynamicsEstimation REQUIRED) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" ON) endif() if(HDE_COMPILE_PYTHON_BINDINGS) @@ -53,7 +55,7 @@ if(HDE_COMPILE_PYTHON_BINDINGS) file(APPEND ${GENERATION_LOCATION_OF_INIT_PY_FILE}/__init__.py "# for example if the library to find are already found in the proper location in a conda\n") file(APPEND ${GENERATION_LOCATION_OF_INIT_PY_FILE}/__init__.py "if(library_dll_path != os.path.join(os.environ.get('CONDA_PREFIX', ''),'Library','bin') and library_dll_path != os.path.join(os.environ.get('CONDA_PREFIX', ''),'bin')):\n") file(APPEND ${GENERATION_LOCATION_OF_INIT_PY_FILE}/__init__.py " if(os.path.exists(library_dll_path)):\n") - file(APPEND ${GENERATION_LOCATION_OF_INIT_PY_FILE}/__init__.py " os.add_dll_directory(library_dll_path)$\n") + file(APPEND ${GENERATION_LOCATION_OF_INIT_PY_FILE}/__init__.py " os.add_dll_directory(library_dll_path)\n") file(APPEND ${GENERATION_LOCATION_OF_INIT_PY_FILE}/__init__.py "\n") endif() diff --git a/devices/Paexo/test-application/CMakeLists.txt b/devices/Paexo/test-application/CMakeLists.txt index 7e3e4ac78..0986d027f 100644 --- a/devices/Paexo/test-application/CMakeLists.txt +++ b/devices/Paexo/test-application/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(PaexoTestApplication) find_package(IWear REQUIRED) diff --git a/interfaces/IWear/CMakeLists.txt b/interfaces/IWear/CMakeLists.txt index 598feaa59..f0347c097 100644 --- a/interfaces/IWear/CMakeLists.txt +++ b/interfaces/IWear/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(IWear LANGUAGES CXX VERSION ${PROJECT_VERSION}) include(GNUInstallDirs) diff --git a/msgs/yarp/thrift/CMakeLists.txt b/msgs/yarp/thrift/CMakeLists.txt index 0b4630507..71b83b251 100644 --- a/msgs/yarp/thrift/CMakeLists.txt +++ b/msgs/yarp/thrift/CMakeLists.txt @@ -29,8 +29,6 @@ add_library(${PROJECT_NAME}::${LIBRARY_TARGET_NAME} ALIAS ${LIBRARY_TARGET_NAME} install(TARGETS ${LIBRARY_TARGET_NAME} EXPORT ${PROJECT_NAME} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hde/msgs") @@ -63,8 +61,6 @@ add_library(${PROJECT_NAME}::${LIBRARY_TARGET_NAME} ALIAS ${LIBRARY_TARGET_NAME} install(TARGETS ${LIBRARY_TARGET_NAME} EXPORT ${PROJECT_NAME} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hde/msgs") @@ -97,8 +93,6 @@ add_library(${PROJECT_NAME}::${LIBRARY_TARGET_NAME} ALIAS ${LIBRARY_TARGET_NAME} install(TARGETS ${LIBRARY_TARGET_NAME} EXPORT ${PROJECT_NAME} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hde/msgs") set(LIBRARY_TARGET_NAME HumanWrenchMsg) @@ -129,6 +123,4 @@ add_library(${PROJECT_NAME}::${LIBRARY_TARGET_NAME} ALIAS ${LIBRARY_TARGET_NAME} install(TARGETS ${LIBRARY_TARGET_NAME} EXPORT ${PROJECT_NAME} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hde/msgs")