Commit 055f2322 authored by Max Lyon's avatar Max Lyon

improve IPOPT finder add CGAL finder and update fixbundle accordingly

parent 76abf819
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
# This is the base directory for windows library search used in the finders we shipp.
set(CMAKE_WINDOWS_LIBS_DIR "c:/libs" CACHE STRING "Default Library search dir on windows." )
endif()
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
FIND_PACKAGE( CGAL REQUIRED CONFIG
HINTS $ENV{CGAL_DIR}
PATHS "${VS_SEARCH_PATH}/CGAL-4.13"
"${VS_SEARCH_PATH}/CGAL-4.12"
"${VS_SEARCH_PATH}/CGAL-4.7"
/usr/
../../External
"C:/libs/CGAL-3.6"
"C:/Program Files/CGAL-3.5"
"C:/Programme/CGAL-3.5"
"C:/libs/CGAL-3.5"
"C:/Program Files/CGAL-3.4"
"C:/Programme/CGAL-3.4"
"C:/libs/CGAL-3.4"
"C:/Programme/CGAL-3.9"
"C:/Program Files/CGAL-3.9"
"C:/Program Files (x86)/CGAL-3.9"
${module_file_path}/../../../External
PATH_SUFFIXES lib lib/cmake
NO_CMAKE_PATH # if CMAKE_PREFIX_PATH is set we find CGAL 4.12 instead of 4.13. I dont know why that is.
NO_CMAKE_ENVIRONMENT_PATH) # Set NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH to ignore CMAKE_PREFIX_PATH
if (CGAL_FOUND)
set(CGAL_BIN_DIRS ${CGAL_BIN_DIR} ${CGAL_BIN_DIR}\..\auxiliary\gmp\lib)
endif()
\ No newline at end of file
......@@ -48,8 +48,8 @@ if (WIN32)
"${VS_SEARCH_PATH}Ipopt-3.12.9/include/coin"
"${VS_SEARCH_PATH}Ipopt-3.12.4/Ipopt/MSVisualStudio/v8-ifort/installed/include/coin"
"${VS_SEARCH_PATH}Ipopt-3.11.9/Ipopt/MSVisualStudio/v8-ifort/installed/include/coin"
"C:\\libs\\Ipopt-3.8.2\\include\\coin"
${IPOPT_DIR}/include
"C:\\libs\\Ipopt-3.8.2\\include\\coin"
${IPOPT_DIR}/include
)
IF(IPOPT_INCLUDE_DIR)
......@@ -70,60 +70,68 @@ if (WIN32)
set ( IPOPT_LIBRARY "optimized;${IPOPT_LIBRARY_RELEASE};debug;${IPOPT_LIBRARY_DEBUG}" CACHE STRING "IPOPT Libraries" )
GET_FILENAME_COMPONENT(IPOPT_LIBRARY_DIR ${IPOPT_LIBRARY_RELEASE} PATH )
MARK_AS_ADVANCED(IPOPT_LIBRARY_DIR)
GET_FILENAME_COMPONENT(IPOPT_LIBRARY_DIR ${IPOPT_LIBRARY_RELEASE} PATH )
MARK_AS_ADVANCED(IPOPT_LIBRARY_DIR)
SET(IPOPT_FOUND TRUE)
SET(IPOPT_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
SET(IPOPT_INCLUDE_DIRS ${IPOPT_INCLUDE_DIR})
SET(IPOPT_LIBRARY_DIRS ${IPOPT_LIBRARY_DIR})
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
# Todo, set right version depending on build type (debug/release)
#GET_FILENAME_COMPONENT( IPOPT_LIBRARY_DIR ${GLEW_LIBRARY} PATH )
#GET_FILENAME_COMPONENT( IPOPT_LIBRARY_DIRS ${GLEW_LIBRARY} PATH )
ELSE(IPOPT_INCLUDE_DIR)
SET(IPOPT_FOUND FALSE)
SET(IPOPT_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
SET(IPOPT_INCLUDE_DIRS ${IPOPT_INCLUDE_DIR})
ENDIF(IPOPT_INCLUDE_DIR)
ELSE( WIN32 )
find_path(IPOPT_INCLUDE_DIR NAMES IpNLP.hpp
PATHS "$ENV{IPOPT_HOME}/include/coin"
"/usr/include/coin"
"~/sw/Ipopt-3.12.4-installed/include/coin"
)
find_library( IPOPT_LIBRARY
ipopt
PATHS "$ENV{IPOPT_HOME}/lib"
"/usr/lib" )
HINTS "$ENV{IPOPT_HOME}/lib"
PATHS
"/usr/lib"
"~/sw/Ipopt-3.12.4-installed/lib"
)
#wrong config under Debian workaround
add_definitions( -DHAVE_CSTDDEF )
# set optional path to HSL Solver for dynamic usage
find_path(IPOPT_HSL_LIBRARY_DIR
NAMES libhsl.so
libhsl.dylib
PATHS "$ENV{IPOPT_HSL_LIBRARY_PATH}"
HINTS "$ENV{IPOPT_HSL_LIBRARY_PATH}"
"$ENV{HOME}/opt/HSL/lib"
)
# find HSL library for fixed linking of solvers
# find HSL library for fixed linking of solvers
find_library( IPOPT_HSL_LIBRARY
coinhsl
PATHS "$ENV{IPOPT_HOME}/lib"
"/usr/lib" )
coinhsl hsl
HINTS "$ENV{IPOPT_HSL_LIBRARY_PATH}"
"$ENV{IPOPT_HOME}/lib"
PATHS "/usr/lib" )
set(IPOPT_LIBRARY_DIRS "${IPOPT_LIBRARY_DIR}" )
set(IPOPT_INCLUDE_DIRS "${IPOPT_INCLUDE_DIR}" )
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
IF( IPOPT_HSL_LIBRARY_DIR)
IF( NOT IPOPT_FIND_QUIETLY )
message ( "IPOPT_HSL_LIBRARY_DIR found at ${IPOPT_HSL_LIBRARY_DIR} ")
ENDIF()
set(IPOPT_LIBRARY_DIR ${IPOPT_HSL_LIBRARY_DIR})
LIST( APPEND IPOPT_LIBRARY_DIRS "${IPOPT_HSL_LIBRARY_DIR}")
ENDIF(IPOPT_HSL_LIBRARY_DIR)
set(IPOPT_INCLUDE_DIRS "${IPOPT_INCLUDE_DIR}" )
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
IF(IPOPT_HSL_LIBRARY)
LIST( APPEND IPOPT_LIBRARIES "${IPOPT_HSL_LIBRARY}")
......
......@@ -27,4 +27,4 @@ include (BundleUtilities)
file (GLOB _plugins "@CMAKE_BINARY_DIR@/Build/Plugins/*.dll")
# fix all dependencies
fixup_bundle ("@CMAKE_BINARY_DIR@/Build/@OPENFLIPPER_PRODUCT_STRING@.exe" "${_plugins}" "@OMP_PATH@;@GLUT_LIBRARY_DIR@;@Qwt5_Qt4_LIBRARY_DIR@;@GLEW_LIBRARY_DIR@;@QT_BINARY_DIR@;@FTGL_LIBRARY_DIRS@;@FREETYPE_LIBRARY_DIR@;@NITE2_LIBRARY_DIR@;@OPENNI2_LIBRARY_DIR@;@QWT6_LIBRARY_DIR@;@ASSIMP_LIBRARY_DIR@;@CGAL_BIN_DIR@;@GUROBI_BIN_DIR@;@IPOPT_LIBRARY_DIR@;@WINDOWS_COPY_LIBDIRS@;@Boost_LIBRARYDIR@;@Boost_LIBRARY_DIRS@;@Python3_LIBRARY_DIRS@;@Python3_LIBRARY_DIRS@/../")
fixup_bundle ("@CMAKE_BINARY_DIR@/Build/@OPENFLIPPER_PRODUCT_STRING@.exe" "${_plugins}" "@OMP_PATH@;@GLUT_LIBRARY_DIR@;@Qwt5_Qt4_LIBRARY_DIR@;@GLEW_LIBRARY_DIR@;@QT_BINARY_DIR@;@FTGL_LIBRARY_DIRS@;@FREETYPE_LIBRARY_DIR@;@NITE2_LIBRARY_DIR@;@OPENNI2_LIBRARY_DIR@;@QWT6_LIBRARY_DIR@;@ASSIMP_LIBRARY_DIR@;@CGAL_BIN_DIR@;@CGAL_DIR@/bin;@CGAL_DIR@/auxiliary/gmp/lib;@GUROBI_BIN_DIR@;@IPOPT_LIBRARY_DIRS@;@WINDOWS_COPY_LIBDIRS@;@Boost_LIBRARYDIR@;@Boost_LIBRARY_DIRS@;@Python3_LIBRARY_DIRS@;@Python3_LIBRARY_DIRS@/../")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment