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

CARLA C++ client example/easy_import_cmake_include #7652

Open
xavisolesoft opened this issue May 15, 2024 · 3 comments
Open

CARLA C++ client example/easy_import_cmake_include #7652

xavisolesoft opened this issue May 15, 2024 · 3 comments

Comments

@xavisolesoft
Copy link
Contributor

xavisolesoft commented May 15, 2024

Problem

Currently, we do not have any example about how to link CARLA C++ client with a C++ application.
I have tried to do it by my self quickly but was not trivial as after adding all the next header files I was still having build issues:

add_compile_definitions(ASIO_NO_EXCEPTIONS,
                        BOOST_NO_EXCEPTIONS,
                        LIBCARLA_NO_EXCEPTIONS,
                        PUGIXML_NO_EXCEPTIONS,
                        BOOST_DISABLE_ABI_HEADERS,
                        BOOST_NO_RTTI,
                        BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)

target_link_libraries(CarlaStudio PRIVATE C:/programing/carlaUE5/Build/LibCarla/carla-client.lib)
include_directories(C:/programing/carlaUE5/LibCarla/source
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/asio/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/config/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/throw_exception/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/assert/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/align/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/geometry/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/range/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/preprocessor/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/mpl/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/type_traits/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/iterator/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/static_assert/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/numeric/conversion/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/core/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/rational/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/utility/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/integer/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/multiprecision/include
                    C:/programing/carlaUE5/Build/_deps/boost-src/libs/math/include


                    C:/programing/carlaUE5/Build/_deps/rpclib-src/include)

Proposed solution

My proposal is to create some cmake file that can be included to any C++ project if possible; and anyway create a sample project about how to link with CARLA C++ client.

@MarcelPiNacy-CVC
Copy link

I agree, we also should explicitly handle the case of installing with CMake.

@xavisolesoft
Copy link
Contributor Author

Add the end we need to include some of the headers included here to CARLA UE5 plugin:
https://github.com/carla-simulator/carla/blob/ue5-dev/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Carla.Build.cs#L128

@xavisolesoft
Copy link
Contributor Author

I agree, we also should explicitly handle the case of installing with CMake.

You mean installing the CARLA C++ client with all the headers to be able to distribute it out of the box of CARLA?
It could make sense for CARLA Release, to prevent the customers to download and build all CARLA to implement a C++ client application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants