Skip to content

Commit

Permalink
Cannelloni integration and cmake install.
Browse files Browse the repository at this point in the history
Signed-off-by: Remigiusz Kołłątaj <[email protected]>
  • Loading branch information
Remigiusz Kołłątaj committed Jan 3, 2018
1 parent c8835e9 commit e0e8388
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "3rdParty/rapidjson"]
path = 3rdParty/rapidjson
url = https://github.com/Tencent/rapidjson.git
[submodule "3rdParty/qtCannelloniCanBus"]
path = 3rdParty/qtCannelloniCanBus
url = https://github.com/tuvok/qtCannelloniCanBus.git
1 change: 1 addition & 0 deletions 3rdParty/qtCannelloniCanBus
Submodule qtCannelloniCanBus added at db0e87
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
#libnodes.so will be installed to CANdevStudio dir to not override other installations. Set RPATH accordingly
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/CANdevStudio)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)

Expand Down Expand Up @@ -79,8 +81,8 @@ configure_file(
include_directories(${CMAKE_BINARY_DIR}/generated)
# end of version Handling

add_subdirectory(3rdParty/spdlog)
add_subdirectory(3rdParty/nodeeditor)
add_subdirectory(3rdParty/qtCannelloniCanBus)
add_subdirectory(src/common)
add_subdirectory(src/gui)
add_subdirectory(src/components)
Expand All @@ -90,3 +92,11 @@ if(WITH_TESTS OR WITH_COVERAGE)
add_subdirectory(3rdParty/fakeit)
add_subdirectory(tests)
endif()

install(PROGRAMS ${CMAKE_BINARY_DIR}/lib/libnodes.so DESTINATION lib/CANdevStudio)

list(GET Qt5SerialBus_PLUGINS 0 SB_PLUGIN)
get_target_property(CAN_PLUGIN_PATH ${SB_PLUGIN} LOCATION)
get_filename_component(CAN_PLUGIN_PATH ${CAN_PLUGIN_PATH} PATH)

install(PROGRAMS ${CMAKE_BINARY_DIR}/3rdParty/qtCannelloniCanBus/libqtCannelloniCanBusPlugin.so DESTINATION ${CAN_PLUGIN_PATH})
4 changes: 2 additions & 2 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
find_package(Threads REQUIRED)

add_library(cds-common INTERFACE)
target_include_directories(cds-common INTERFACE ${CMAKE_SOURCE_DIR}/src/common)
target_link_libraries(cds-common INTERFACE spdlog ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(cds-common INTERFACE ${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/3rdParty/spdlog/include)
target_link_libraries(cds-common INTERFACE ${CMAKE_THREAD_LIBS_INIT})
2 changes: 2 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../components/")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdParty/rapidjson/include")
target_link_libraries(CANdevStudio Qt5::Widgets candevice canrawview canrawsender cds-common nodes projectconfig)
target_compile_definitions(CANdevStudio PRIVATE $<$<CONFIG:Debug>:CDS_DEBUG=true> $<$<NOT:$<CONFIG:Debug>>:CDS_DEBUG=false>)

install(TARGETS CANdevStudio RUNTIME DESTINATION bin)

0 comments on commit e0e8388

Please sign in to comment.