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

Fix some CMake issues #1310

Merged
merged 4 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 21 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,53 +135,33 @@ include(CPack)

find_package(LibXml2 REQUIRED)
find_package(QuickHull REQUIRED)
find_package(SDL)
if ( NOT SDL_FOUND )
message(WARNING "Package SDL is not found!")
endif( NOT SDL_FOUND )
find_package(OpenGL)
if ( NOT OPENGL_FOUND )
message(WARNING "Package OpenGL is not found!")
endif( NOT OPENGL_FOUND )
find_package(GLUT)
if ( NOT GLUT_FOUND )
message(WARNING "Package GLUT is not found!")
endif( NOT GLUT_FOUND )
include(FindPkgConfig)
pkg_check_modules(OpenCV opencv)
if (NOT OpenCV_FOUND)
pkg_check_modules(OpenCV opencv-2.3.1)

option(USE_HRPSYSUTIL "Build hrpsysUtil" ON)

if(USE_HRPSYSUTIL)
find_package(SDL REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
pkg_check_modules(OpenCV opencv)
if (NOT OpenCV_FOUND)
pkg_check_modules(OpenCV opencv4)
pkg_check_modules(OpenCV opencv-2.3.1)
if (NOT OpenCV_FOUND)
message(WARNING "opencv not found")
pkg_check_modules(OpenCV opencv4)
if (NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV is required to build hrpsysUtil")
endif()
endif()
endif()
endif()
pkg_check_modules(GLEW glew)
if (NOT GLEW_FOUND)
message(WARNING "Package GLEW is not found")
endif()
find_package(PCL)
if(OpenCV_FOUND AND OPENGL_FOUND AND GLEW_FOUND AND GLUT_FOUND AND SDL_FOUND)
if(APPLE)
if(PCL_FOUND) # qhull is included in pcl
set(USE_HRPSYSUTIL true)
else()
set(USE_HRPSYSUTIL false)
endif()
else()
set(USE_HRPSYSUTIL true)
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})
pkg_check_modules(GLEW glew)
if (NOT GLEW_FOUND)
message(FATAL_ERROR "GLEW is required to build hrpsysUtil")
endif()
else()
set(USE_HRPSYSUTIL false)
endif()

include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})
if(NOT QNXNTO)
find_package(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})
find_package(PCL)
if(USE_HRPSYSUTIL AND APPLE AND NOT PCL_FOUND)
message(FATAL_ERROR "PCL is required to build hrpsysUtil on Apple platform")
endif()

execute_process(
Expand Down Expand Up @@ -226,7 +206,6 @@ if (NOT QNXNTO)
add_subdirectory(util)
endif()
add_subdirectory(sample)
add_subdirectory(test)

#if catkin environment
string(REGEX MATCH "catkin" need_catkin "$ENV{_}")
Expand Down
26 changes: 0 additions & 26 deletions cmake_modules/FindEigen.cmake

This file was deleted.

7 changes: 2 additions & 5 deletions sample/SampleRobot/rtc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@ add_custom_target(SampleComponentService.idl.compiled ALL DEPENDS SampleComponen
# plugins comps
set(comp_sources SampleComponent.cpp SampleComponent_impl.cpp SampleComponentServiceSk.cpp SampleComponentServiceDynSk.cpp)

add_library(SampleComponent SHARED ${comp_sources})
add_library(SampleComponent SHARED ${comp_sources} SampleComponentService.hh)
target_link_libraries(SampleComponent ${libs})
set_target_properties(SampleComponent PROPERTIES PREFIX "")
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_executable(SampleComponentComp SampleComponentComp.cpp ${comp_sources})
add_executable(SampleComponentComp SampleComponentComp.cpp ${comp_sources} SampleComponentService.hh)
target_link_libraries(SampleComponentComp ${libs})

set(target SampleComponent SampleComponentComp)

add_dependencies(SampleComponent SampleComponentService.hh)
add_dependencies(SampleComponentComp SampleComponentService.hh)

configure_file(samplerobot_sample_component.py.in ${CMAKE_CURRENT_BINARY_DIR}/samplerobot_sample_component.py)

install(PROGRAMS
Expand Down