24.09., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

CMakeLists.txt 1.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
cmake_minimum_required(VERSION 3.9)

# set the name of the module
set(ELSA_MODULE_NAME generators)
set(ELSA_MODULE_TARGET_NAME elsa_generators)
set(ELSA_MODULE_EXPORT_TARGET elsa_${ELSA_MODULE_NAME}Targets)


# list all the headers of the module
set(MODULE_HEADERS
        EllipseGenerator.h
        PhantomGenerator.h
        CircleTrajectoryGenerator.h)

# list all the code files of the module
set(MODULE_SOURCES
        EllipseGenerator.cpp
        PhantomGenerator.cpp
        CircleTrajectoryGenerator.cpp)


# build the module library
add_library(${ELSA_MODULE_TARGET_NAME} ${MODULE_HEADERS} ${MODULE_SOURCES})
add_library(elsa::${ELSA_MODULE_NAME} ALIAS ${ELSA_MODULE_TARGET_NAME})

26
target_link_libraries(${ELSA_MODULE_TARGET_NAME} PUBLIC elsa_core elsa_logging elsa_projectors)
27 28 29

target_include_directories(${ELSA_MODULE_TARGET_NAME}
        PUBLIC
30
        $<INSTALL_INTERFACE:include/elsa/${ELSA_MODULE_NAME}>
31 32 33 34 35 36
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
        )


# require C++17
target_compile_features(${ELSA_MODULE_TARGET_NAME} PUBLIC cxx_std_17)
37 38
# set -fPIC
set_target_properties(${ELSA_MODULE_TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
39 40 41 42 43 44 45


# build the tests (if enabled)
if(ELSA_TESTING)
    add_subdirectory(tests)
endif(ELSA_TESTING)

Nikola Dinev's avatar
Nikola Dinev committed
46 47 48 49 50 51
if (ELSA_BUILD_PYTHON_BINDINGS)
        GENERATE_BINDINGS(${ELSA_MODULE_TARGET_NAME}
                ${CMAKE_CURRENT_BINARY_DIR}/bind_${ELSA_MODULE_NAME}.cpp
                ""
                ${MODULE_SOURCES} CircleTrajectoryGenerator.h)
endif()
52 53 54 55 56 57

# register the module
registerComponent(${ELSA_MODULE_NAME})

# install the module
InstallElsaModule(${ELSA_MODULE_NAME} ${ELSA_MODULE_TARGET_NAME} ${ELSA_MODULE_EXPORT_TARGET})