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

Convert package to a pure CMake package #285

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Commits on Jun 14, 2023

  1. Convert package to a pure CMake package

    cherry-picking commit 4d5be00 from @cottsay
    See: wjwwood#209 (comment)
    
     Author:    Scott K Logan <[email protected]>
     Date:      Wed Jul 3 13:24:15 2019 -0700
    
    Conflicts:
    	CMakeLists.txt
    	package.xml
    	tests/CMakeLists.txt
    
    Signed-off-by: Alex Moriarty <[email protected]>
    cottsay authored and moriarty committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    3025939 View commit details
    Browse the repository at this point in the history
  2. compile with -fPIC and bump cmake version

    This couldn't be cherry-picked because but essentially the same change
    from the ros2 branch here:
    tylerjw@d8d1606
    
    Fixes this error:
    
    ```
    /usr/bin/ld: /home/alex/ros/h/robotiq/install/serial/lib/libserial.a(serial.cc.o): relocation R_X86_64_PC32 against symbol `_ZTVN6serial6SerialE' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: bad value
    ```
    
    Signed-off-by: Alex Moriarty <[email protected]>
    moriarty committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    380c4e4 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2023

  1. cmake: Use cmake >= 3.5, add project setup.

    Cmake made major changes in the 2.x -> 3.0 switch, keeping the 2.x
    compatiblity just isn't worth it. Since serial anyway doesn't build on
    versions before xenial, use xenial's cmake at 3.5 as baseline.
    
    Cherry-pick from PR wjwwood#231
    
     Conflicts:
    	CMakeLists.txt
     Author:    Alec Leamas <[email protected]>
     Date:      Tue Sep 22 13:08:46 2020 +0200
    
    Gbp-Pq: Name 0001-cmake-Use-cmake-3.5-add-project-setup.patch
    Signed-off-by: Alex Moriarty <[email protected]>
    leamas authored and moriarty committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    c9da89d View commit details
    Browse the repository at this point in the history
  2. cmake: Add defined so-version and public header to lib.

    Adding a so-version means defining an ABI level. This level is decoupled
    from the ordinary version, even a major version change doesn't
    necessarily mean that the so-version should change (and thus have all
    dependencies to be rebuilt).
    
    Adding the public header to clarify the setup.
    
    Note: cherry-pick from PR wjwwood#231
    
     Conflicts:
    	CMakeLists.txt
     Author:    Alec Leamas <[email protected]>
     Date:      Tue Sep 22 13:28:04 2020 +0200
    
    Gbp-Pq: Name 0002-cmake-Add-defined-so-version-and-public-header-to-li.patch
    Signed-off-by: Alex Moriarty <[email protected]>
    leamas authored and moriarty committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    61da1e2 View commit details
    Browse the repository at this point in the history
  3. cmake: option BUILD_SHARED_LIBS ON

    Default to building as a shared libary
    
    Signed-off-by: Alex Moriarty <[email protected]>
    moriarty committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    40d2950 View commit details
    Browse the repository at this point in the history
  4. cmake: CMAKE_POSITION_INDEPENDENT_CODE

    - remove set BUILD_SHARED_LIBS ON
    - set CMAKE_POSITION_INDEPENDENT_CODE ON if undefined
    
    When setting BUILD_SHARED_LIBS if user set it to off linking would fail.
    Adding the suggetion from pull request review, which seems to work in
    both cases
    
        colcon build --cmake-args "-DBUILD_SHARED_LIBS=ON"
        colcon build --cmake-args "-DBUILD_SHARED_LIBS=OFF"
    
    Signed-off-by: Alex Moriarty <[email protected]>
    moriarty committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    48f14ce View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2023

  1. cmake minimum 3.16

    Bump cmake to oldest version currently used by tier 1 or 2 supported ROS
    platform.
    
    https://www.ros.org/reps/rep-2000.html#humble-hawksbill-may-2022-may-2027
    https://www.ros.org/reps/rep-0003.html#noetic-ninjemys-may-2020-may-2025
    
    Signed-off-by: Alex Moriarty <[email protected]>
    moriarty committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    7b7f62b View commit details
    Browse the repository at this point in the history
  2. remove PROJ_SOVERSION variable

    this is only used once and it makes it easier to read or grep for
    
    Signed-off-by: Alex Moriarty <[email protected]>
    moriarty committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    2a76e1a View commit details
    Browse the repository at this point in the history
  3. set project language to CXX

    Co-authored-by: Chris Thrasher <[email protected]>
    moriarty and ChrisThrasher committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    2528dcf View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2023

  1. Depend on GTest via its imported targets

    - Find and use GTest as imported target GTest::GTest
    - Note:
      - GTest::GTest is available from CMake 3.5 and depricated in 3.20 but
        still available in latest version.
      - GTest::gtest added in CMake 3.20
    
    Signed-off-by: Alex Moriarty <[email protected]>
    moriarty committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    f60d49d View commit details
    Browse the repository at this point in the history