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: cmake issues with google test repo download, qt5 path finding #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
78 changes: 39 additions & 39 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
# Source/Include files
include_directories(".")
include_directories("include/" ) # common includes
include_directories("/usr/local/include/lcm/") # lcm includes
include_directories("include/") # common includes
include_directories("/usr/local/include/lcm/") # lcm includes
include_directories("../lcm-types/cpp/")
include_directories("../third-party/inih") # inih includes
include_directories("../third-party/osqp/include") # osqp includes
include_directories("../third-party/inih") # inih includes
include_directories("../third-party/osqp/include") # osqp includes
include_directories("../third-party/ParamHandler")
include_directories("/usr/local/include/eigen3") # lcm includes
include_directories("/usr/include/eigen3") # lcm includes
include_directories("FootstepPlanner")
include_directories(${CMAKE_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})
file(GLOB_RECURSE sources "src/*.cpp") # common library cpp files
file(GLOB_RECURSE sources "src/*.cpp") # common library cpp files

# Library
add_library(biomimetics SHARED ${sources}) # produce a library used by sim/robot
add_library(biomimetics SHARED ${sources}) # produce a library used by sim/robot
target_link_libraries(biomimetics inih dynacore_param_handler JCQP osqp)

if(CMAKE_SYSTEM_NAME MATCHES Linux)
# Pull in Google Test
include(CTest)
if (CMAKE_VERSION VERSION_LESS 3.2)
set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
else()
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif()
include(DownloadProject.cmake)
download_project(PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
${UPDATE_DISCONNECTED_IF_AVAILABLE}
QUIET
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include"
"${gmock_SOURCE_DIR}/include")
endif()

# Test
file(GLOB_RECURSE test_sources "test/test_*.cpp") # test cpp files
add_executable(test-common ${test_sources})
target_link_libraries(test-common gtest gmock_main lcm rt inih osqp dynacore_param_handler pthread biomimetics)
target_link_libraries(test-common Goldfarb_Optimizer)
target_link_libraries(test-common JCQP)


add_test(NAME example_test COMMAND test-common)

# Pull in Google Test
include(CTest)

if(CMAKE_VERSION VERSION_LESS 3.2)
set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
else()
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif()

include(DownloadProject.cmake)
download_project(PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
${UPDATE_DISCONNECTED_IF_AVAILABLE}
QUIET
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})

if(CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include"
"${gmock_SOURCE_DIR}/include")
endif()

# Test
file(GLOB_RECURSE test_sources "test/test_*.cpp") # test cpp files
add_executable(test-common ${test_sources})
target_link_libraries(test-common gtest gmock_main lcm rt inih osqp dynacore_param_handler pthread biomimetics)
target_link_libraries(test-common Goldfarb_Optimizer)
target_link_libraries(test-common JCQP)

add_test(NAME example_test COMMAND test-common)
endif(CMAKE_SYSTEM_NAME MATCHES Linux)

# Our libraries
add_subdirectory(FootstepPlanner)

2 changes: 1 addition & 1 deletion common/DownloadProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
# include(DownloadProject)
# download_project(PROJ googletest
# GIT_REPOSITORY https://github.com/google/googletest.git
# GIT_TAG master
# GIT_TAG main
# UPDATE_DISCONNECTED 1
# QUIET
# )
Expand Down
1 change: 1 addition & 0 deletions file_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 2 additions & 2 deletions scripts/find_qt_path.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#/bin/bash

QT_VER="$(ls ~/Qt/ | grep 5 -m1)"
QT_VER="$(ls ~/Qt* | grep 5 -m1)"

printf "${HOME}/Qt/${QT_VER}/gcc_64/"
printf "${HOME}/Qt${QT_VER}/${QT_VER}/gcc_64/"

6 changes: 6 additions & 0 deletions scripts/lcm-log2smat/find_qt_path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#/bin/bash

QT_VER="$(ls ~/Qt* | grep 5 -m1)"

printf "${HOME}/Qt${QT_VER}/${QT_VER}/gcc_64/"

78 changes: 0 additions & 78 deletions scripts/network_config.py

This file was deleted.

38 changes: 0 additions & 38 deletions scripts/setup_network_mc.py

This file was deleted.

38 changes: 18 additions & 20 deletions sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ project(sim)

SET(CMAKE_INCLUDE_CURRENT_DIR ON)


execute_process(COMMAND ${CMAKE_SOURCE_DIR}/scripts/find_qt_path.sh OUTPUT_VARIABLE CMAKE_PREFIX_PATH_1)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH_1})
# message("CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")

# message("CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
if(POLICY CMP0071)
cmake_policy(SET CMP0071 OLD)
endif()

# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)

# Create code from a list of Qt designer ui files
set(CMAKE_AUTOUIC ON)
find_package(Qt5Core CONFIG REQUIRED)
Expand All @@ -23,20 +23,20 @@ message(STATUS ${QtCore_location})
find_package(Qt5Gui CONFIG REQUIRED)

set(QOBJECT_HEADERS
include/Graphics3D.h
include/GameController.h
include/SimControlPanel.h
include/JoystickTest.h)
# include/main_window.h
# include/gamepad_monitor.h
# include/spi_debug.h)

include/Graphics3D.h
include/GameController.h
include/SimControlPanel.h
include/JoystickTest.h)

# include/main_window.h
# include/gamepad_monitor.h
# include/spi_debug.h)
QT5_WRAP_CPP(tst_hdr_moc ${QOBJECT_HEADERS})

include_directories("include/")
include_directories("../common/include/")
include_directories("../lcm-types/cpp")
include_directories("/usr/local/include/lcm/") # lcm includes
include_directories("/usr/local/include/lcm/") # lcm includes
include_directories("../third-party/ParamHandler")
include_directories(${CMAKE_BINARY_DIR})
file(GLOB sources "src/*.cpp")
Expand All @@ -50,16 +50,14 @@ find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})

add_executable(sim ${sources} ${tst_hdr_moc})
target_link_libraries(sim biomimetics pthread lcm inih dynacore_param_handler
Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Gamepad ${QT_LIBRARIES} ${OPENGL_LIBRARIES})
target_link_libraries(sim biomimetics pthread lcm inih dynacore_param_handler
Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Gamepad ${QT_LIBRARIES} ${OPENGL_LIBRARIES})

if (CMAKE_SYSTEM_NAME MATCHES Linux)
if(CMAKE_SYSTEM_NAME MATCHES Linux)
target_link_libraries(sim rt ${GLUT_glut_LIBRARIES})
include (CheckIncludeFileCXX)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
include(CheckIncludeFileCXX)
endif(CMAKE_SYSTEM_NAME MATCHES Linux)

if (APPLE)
if(APPLE)
target_link_libraries(sim "-framework GLUT")
endif (APPLE)


endif(APPLE)
12 changes: 6 additions & 6 deletions user/MIT_Controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ include_directories(SYSTEM "../../third-party/qpOASES/include")
include_directories("../../third-party/ParamHandler")

include_directories("../../lcm-types/cpp")
include_directories("/usr/local/include/lcm/") # lcm includes
include_directories("/usr/local/include/eigen3") # lcm includes
include_directories("/usr/local/include/lcm/") # lcm includes
include_directories("/usr/include/eigen3") # lcm includes
include_directories(${CMAKE_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})

file(GLOB_RECURSE sources
"./*.cpp"
"FSM_States/*.cpp"
"Controllers/BalanceController/*.cpp"
"Controllers/convexMPC/*.cpp")
"./*.cpp"
"FSM_States/*.cpp"
"Controllers/BalanceController/*.cpp"
"Controllers/convexMPC/*.cpp")

add_subdirectory(Controllers/WBC)
add_subdirectory(Controllers/WBC_Ctrl)
Expand Down