Skip to content

Commit

Permalink
Merge branch 'hotfix/172'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeljaik committed May 18, 2017
2 parents 0caf2cd + de755b6 commit b0f04f4
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
64 changes: 64 additions & 0 deletions cmake/Modules/FindGUROBI.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#### Adapted from http://www.openflipper.org/svnrepo/CoMISo/trunk/CoMISo/cmake/FindGUROBI.cmake


# - Try to find GUROBI
# Once done this will define
# GUROBI_FOUND - System has Gurobi
# GUROBI_INCLUDE_DIRS - The Gurobi include directories
# GUROBI_LIBRARIES - The libraries needed to use Gurobi

if (GUROBI_INCLUDE_DIR)
# in cache already
set(GUROBI_FOUND TRUE)
set(GUROBI_INCLUDE_DIRS ${GUROBI_INCLUDE_DIR} )
set(GUROBI_LIBRARIES ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY} )
else (GUROBI_INCLUDE_DIR)

find_path(GUROBI_INCLUDE_DIR
NAMES gurobi_c++.h
PATHS "$ENV{GUROBI_HOME}/include"
"/Library/gurobi502/mac64/include"
"C:\\libs\\gurobi502\\include"
)
find_library( GUROBI_LIBRARY
NAMES gurobi
gurobi702
gurobi701
gurobi70
gurobi45
gurobi46
gurobi50
gurobi51
gurobi52
gurobi55
gurobi56
gurobi60
gurobi65
PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi701/mac64/lib"
"C:\\libs\\gurobi70\\lib"
)

find_library( GUROBI_CXX_LIBRARY
NAMES gurobi_c++
PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi70/mac64/lib"
"C:\\libs\\gurobi70\\lib"
)

set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
# It is very important
set(GUROBI_LIBRARIES ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY})

# use c++ headers as default
# set(GUROBI_COMPILER_FLAGS "-DIL_STD" CACHE STRING "Gurobi Compiler Flags")

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(GUROBI DEFAULT_MSG
GUROBI_LIBRARY GUROBI_CXX_LIBRARY GUROBI_INCLUDE_DIR)

mark_as_advanced(GUROBI_INCLUDE_DIR GUROBI_LIBRARY GUROBI_CXX_LIBRARY)

endif(GUROBI_INCLUDE_DIR)
11 changes: 10 additions & 1 deletion ocra-icub-clients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ add_subdirectory(example-client)
add_subdirectory(stepping-demo)
add_subdirectory(task-operations-demo)
add_subdirectory(sitting-demo)
add_subdirectory(walking-client)
add_subdirectory(standing-demo)

find_package(GUROBI)
if (GUROBI_FOUND)
if(NOT WIN32)
string(ASCII 27 Esc)
endif()
message("${Esc}[1;35m -- Gurobi was found in your system. adding walking-client! ${Esc}[m")
add_subdirectory(walking-client)
endif()

# add_subdirectory(your-client)

0 comments on commit b0f04f4

Please sign in to comment.