Skip to content
Snippets Groups Projects
Commit 7c05fcd4 authored by Patrick MADELA's avatar Patrick MADELA
Browse files

Update conan and cmake recipes for this multimodule project

parent 3b50c95b
No related branches found
No related tags found
No related merge requests found
add_subdirectory(GalilAxisPlugin)
add_subdirectory(SimulatedAxisPlugin)
\ No newline at end of file
file(GLOB_RECURSE sources
src/*.cpp
)
set(includedirs
src
)
add_library(GalilAxisPlugin ${sources})
target_include_directories(GalilAxisPlugin PRIVATE ${includedirs})
target_link_libraries(GalilAxisPlugin PRIVATE PluginsInterface)
target_link_libraries(GalilAxisPlugin PRIVATE yat4tango::yat4tango)
if(MAJOR_VERSION)
set_target_properties(GalilAxisPlugin PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${MAJOR_VERSION})
endif()
install (TARGETS GalilAxisPlugin LIBRARY DESTINATION ${LIB_INSTALL_DIR})
file(GLOB_RECURSE sources
src/*.cpp
)
set(includedirs
src
)
add_library(SimulatedAxisPlugin ${sources})
target_include_directories(SimulatedAxisPlugin PRIVATE ${includedirs})
target_link_libraries(SimulatedAxisPlugin PRIVATE PluginsInterface)
target_link_libraries(SimulatedAxisPlugin PRIVATE yat4tango::yat4tango)
if(MAJOR_VERSION)
set_target_properties(SimulatedAxisPlugin PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${MAJOR_VERSION})
endif()
install (TARGETS SimulatedAxisPlugin LIBRARY DESTINATION ${LIB_INSTALL_DIR})
file(GLOB_RECURSE sources
src/*.cpp
)
set(includedirs
src
)
add_executable(${EXECUTABLE_NAME} ${sources})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${includedirs})
target_link_libraries(${EXECUTABLE_NAME} PRIVATE PluginsInterface)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE yat4tango::yat4tango)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(${EXECUTABLE_NAME} PRIVATE crashreporting2::crashreporting2)
endif()
install(TARGETS ${EXECUTABLE_NAME} DESTINATION "." RUNTIME DESTINATION bin)
cmake_minimum_required(VERSION 3.15)
project(${PROJECT_NAME} CXX)
find_package(cpptango CONFIG REQUIRED)
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
find_package(yat4tango CONFIG REQUIRED)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
find_package(crashreporting2 CONFIG)
endif()
add_compile_definitions(PROJECT_NAME=${PROJECT_NAME})
add_compile_definitions(PROJECT_VERSION=${PROJECT_VERSION})
add_compile_definitions(actuatorSystem_PROJECT_VERSION=${PROJECT_VERSION})
file(GLOB_RECURSE sources
src/*.cpp
)
set(includedirs
src
)
add_executable(${EXECUTABLE_NAME} ${sources})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${includedirs})
target_link_libraries(${EXECUTABLE_NAME} PRIVATE cpptango::cpptango)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(${EXECUTABLE_NAME} PRIVATE crashreporting2::crashreporting2)
endif()
install(TARGETS ${EXECUTABLE_NAME} DESTINATION "." RUNTIME DESTINATION bin)
add_subdirectory(ActuatorPlugins)
add_subdirectory(ActuatorSystem)
add_subdirectory(PluginInterfaces)
add_library(PluginsInterface INTERFACE)
target_include_directories(PluginsInterface INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
......@@ -17,10 +17,10 @@ class ActuatorSystemRecipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
exports_sources = "CMakeLists.txt", "src/*"
exports_sources = "CMakeLists.txt", "ActuatorPlugins/*", "ActuatorSystem/*", "PluginInterfaces/*"
def requirements(self):
self.requires("cpptango/[>=9.0]@soleil/stable")
self.requires("yat4tango/[>=1.0]@soleil/stable")
if self.settings.os == "Linux":
self.requires("crashreporting2/[>=1.0]@soleil/stable")
......@@ -31,9 +31,13 @@ class ActuatorSystemRecipe(ConanFile):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
major, minor, patch = map(int, self.version.split('.'))
tc.variables["PROJECT_NAME"] = self.name
tc.variables["PROJECT_VERSION"] = self.version
tc.variables["EXECUTABLE_NAME"] = self.executable
tc.variables["MAJOR_VERSION"] = major
tc.variables["MINOR_VERSION"] = minor
tc.variables["PATCH_VERSION"] = patch
tc.generate()
def build(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment