Skip to content

Commit

Permalink
Add vrep shared library code
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham-kumar1410 committed Jun 8, 2018
1 parent 56b7818 commit d25b982
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 36 deletions.
42 changes: 21 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,26 @@ set(PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set (CMAKE_C_STANDARD 99) # Require C99
set (CMAKE_CXX_STANDARD 17) # Require C++17

#V-REP Config
################################################################################

if (EXISTS "$ENV{VREP}")
message(STATUS "Found VREP")
set (VREP_ROOT "$ENV{VREP}" CACHE "VREP root dir" STRING)
set (VREP_PATH "$ENV{VREP}/programming" CACHE "The VREP build path" STRING)
set (VREP_SOURCES
${VREP_PATH}/remoteApi/extApi.h ${VREP_PATH}/remoteApi/extApiPlatform.h ${VREP_PATH}/include/shared_memory.h
${VREP_PATH}/remoteApi/extApi.c ${VREP_PATH}/common/shared_memory.c ${VREP_PATH}/remoteApi/extApiPlatform.c
)
include_directories (${VREP_PATH}/remoteApi ${VREP_PATH}/include)
add_definitions( -Dpthread )
add_definitions (-DNON_MATLAB_PARSING)
add_definitions (-DMAX_EXT_API_CONNECTIONS=255)
add_library (vrep_lib SHARED ${VREP_SOURCES})
else()
message(FATAL_ERROR "Can't detect V-REP installation. Have you exported the VREP environment variable to the corresponding path?")
endif()

#MRPT Lib
################################################################################
find_package(MRPT REQUIRED graphslam)
Expand Down Expand Up @@ -120,24 +140,4 @@ configure_file(cmake/${PROJECT_NAME}ConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" @ONLY)
# TODO - How to use it
configure_file(cmake/${PROJECT_NAME}ConfigVersion.hpp.in
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hpp" @ONLY)

#V-REP Config
################################################################################

if (EXISTS "$ENV{VREP}")
message(STATUS "Found VREP")
set (VREP_ROOT "$ENV{VREP}" CACHE "VREP root dir" STRING)
set (VREP_PATH "$ENV{VREP}/programming" CACHE "The VREP build path" STRING)
set (VREP_SOURCES
${VREP_PATH}/remoteApi/extApi.h ${VREP_PATH}/remoteApi/extApiPlatform.h ${VREP_PATH}/include/shared_memory.h
${VREP_PATH}/remoteApi/extApi.c ${VREP_PATH}/common/shared_memory.c ${VREP_PATH}/remoteApi/extApiPlatform.c
)
include_directories (${VREP_PATH}/remoteApi ${VREP_PATH}/include)
add_definitions( -Dpthread )
add_definitions (-DNON_MATLAB_PARSING)
add_definitions (-DMAX_EXT_API_CONNECTIONS=255)
add_library (vrep_lib SHARED ${VREP_SOURCES})
else()
message(FATAL_ERROR "Can't detect V-REP installation. Have you exported the VREP environment variable to the corresponding path?")
endif()
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hpp" @ONLY)
26 changes: 11 additions & 15 deletions conversions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,22 @@ set(CONVERT_TEST_NAME mrpt_vrep_bridge_conversions_test)
######################################################

if (BUILD_TESTING)
set(convertTest_sources
include/vrep_conversion.h vrep_conversion.cpp test/runTests.cpp test/convertTest.cpp
)
add_executable(${CONVERT_TEST_NAME} ${convertTest_sources})
target_link_libraries(${CONVERT_TEST_NAME}
gtest pthread ${MRPT_LIBS}
set(convertTest_sources
include/vrep_conversion.h vrep_conversion.cpp test/runTests.cpp test/convertTest.cpp
)
add_executable(${CONVERT_TEST_NAME} ${convertTest_sources})
target_link_libraries(${CONVERT_TEST_NAME}
gtest pthread ${MRPT_LIBS}
)
set_target_properties(${CONVERT_TEST_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${test_output_directory}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${test_output_directory}
)
add_test(NAME ${CONVERT_TEST_NAME} COMMAND
${test_output_directory}/${CONVERT_TEST_NAME})
${test_output_directory}/${CONVERT_TEST_NAME})
endif()

set (SOURCES
include/vrep_conversion.h vrep_conversion.cpp
)
set (SOURCES include/vrep_conversion.h vrep_conversion.cpp)
include_directories (include)
add_library (conversion_lib SHARED ${SOURCES})
target_link_libraries(
conversion_lib ${MRPT_LIBS}
)
target_link_libraries( conversion_lib ${MRPT_LIBS} )

0 comments on commit d25b982

Please sign in to comment.