Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
CoMISo
Commits
491b8d43
Commit
491b8d43
authored
Feb 05, 2021
by
Jan Möbius
Browse files
Merge branch 'master' into Use_gurobi_finder_from_library
parents
a7922302
beab6a3e
Changes
23
Hide whitespace changes
Inline
Side-by-side
Base
@
26e07388
Compare
a7362058
...
26e07388
Subproject commit
a73620585086c6720e6f6cf163f9637e3b0f089d
Subproject commit
26e07388ac2d5c9706ce6304ed6ee73b71d05b20
CI/Windows.bat
View file @
491b8d43
...
...
@@ -86,7 +86,7 @@ ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
ECHO
"============================================================="
ECHO
"============================================================="
"C:\Program Files\CMake\bin\cmake.exe"
-DGTEST
_PREFIX
=
"
%LIBPATH%
\
%ARCHITECTURE%
\
%GTESTVERSION%
"
-G
"
%GENERATOR%
"
-DCMAKE
_BUILD_TYPE
=
Release
-DOPENFLIPPER
_BUILD_UNIT_TESTS
=
TRUE
-DCMAKE
_WINDOWS_LIBS_DIR
=
%CMAKE_WINDOWS_LIBS_DIR%
%CMAKE_CONFIGURATION%
..
"C:\Program Files\CMake\bin\cmake.exe"
-DGTEST
_PREFIX
=
"
%LIBPATH%
\
%ARCHITECTURE%
\
%GTESTVERSION%
"
-G
"
%GENERATOR%
"
-DCMAKE
_BUILD_TYPE
=
Release
-DOPENFLIPPER
_BUILD_UNIT_TESTS
=
TRUE
-DCMAKE
_WINDOWS_LIBS_DIR
=
%CMAKE_WINDOWS_LIBS_DIR%
-DEigen
3
_DIR
=
"e:\libs\general\Eigen3.3.9\share\eigen3\cmake"
%CMAKE_CONFIGURATION%
..
IF
%errorlevel%
NEQ
0
exit
/b
%errorlevel%
...
...
CMakeLists.txt
View file @
491b8d43
...
...
@@ -83,8 +83,6 @@ if ( QT5_FOUND )
target_link_libraries
(
CoMISo PUBLIC
${
QT_LIBRARIES
}
)
endif
()
vci_get_version
()
include
(
VCIOutput
)
set
(
COMISO_INCLUDE_DIRECTORIES
""
)
...
...
@@ -297,13 +295,17 @@ else ()
set
(
COMISO_HSL_CONFIG_FILE_SETTINGS
"#define COMISO_HSL_AVAILABLE 0"
)
endif
()
find_package
(
EIGEN3
)
if
(
EIGEN3_FOUND
)
# Maybe CoMISo was added using add_subdirectory and Eigen is already available?
if
(
NOT TARGET Eigen3::Eigen
)
find_package
(
Eigen3
)
endif
()
if
(
TARGET Eigen3::Eigen
)
message
(
STATUS
"Found Eigen3"
)
set
(
COMISO_EIGEN3_CONFIG_FILE_SETTINGS
"#define COMISO_EIGEN3_AVAILABLE 1"
)
list
(
APPEND COMISO_INCLUDE_DIRECTORIES
${
EIGEN3_INCLUDE_DIR
}
)
target_include_directories
(
CoMISo PUBLIC
${
EIGEN3_INCLUDE_DIR
}
)
list
(
APPEND COMISO_LINK_LIBRARIES Eigen3::Eigen
)
else
()
message
(
FATAL_ERROR
"E
IGEN
3 not found!"
)
message
(
FATAL_ERROR
"E
igen
3 not found!"
)
set
(
COMISO_EIGEN3_CONFIG_FILE_SETTINGS
"#define COMISO_EIGEN3_AVAILABLE 0"
)
endif
()
...
...
@@ -468,6 +470,16 @@ endif(NEED_LAPACK AND NOT SUITESPARSE_FOUND)
set
(
CMAKE_FIND_LIBRARY_PREFIXES
"
${
TMP_CMAKE_FIND_LIBRARY_PREFIXES
}
"
)
find_package
(
LPSolve
)
if
(
TARGET lpsolve::lpsolve
)
set
(
COMISO_LPSOLVE_CONFIG_FILE_SETTINGS
"#define COMISO_LPSOLVE_AVAILABLE 1"
)
target_link_libraries
(
CoMISo PUBLIC lpsolve::lpsolve
)
target_link_directories
(
CoMISo PUBLIC
${
LPSOLVE_LIBRARY_DIR
}
)
else
()
message
(
STATUS
"lpsolve not found!"
)
set
(
COMISO_LPSOLVE_CONFIG_FILE_SETTINGS
"#define COMISO_LPSOLVE_AVAILABLE 0"
)
endif
()
#target_include_directories(CoMISo PRIVATE "${COMISO_INCLUDE_DIRECTORIES}")
#get_target_property(INC_DIRS CoMISo INCLUDE_DIRECTORIES)
...
...
@@ -484,7 +496,7 @@ if (WIN32)
add_definitions
(
-D_SCL_SECURE_NO_DEPRECATE
)
# ignore "... needs to have dll-interface to be used by clients"
#add_definitions(/wd4251)
target_compile_
defini
tions
(
CoMISo PRIVATE /wd4251
)
target_compile_
op
tions
(
CoMISo PRIVATE /wd4251
)
endif
()
# enable debug stuff
...
...
@@ -525,8 +537,8 @@ target_link_libraries (CoMISo PUBLIC
if
(
NOT TARGET osqp
)
find_package
(
osqp
)
endif
()
if
(
TARGET osqp
)
target_link_libraries
(
CoMISo PRIVATE osqp
)
if
(
TARGET osqp
static
)
target_link_libraries
(
CoMISo PRIVATE osqp
static
)
set
(
COMISO_OSQP_CONFIG_FILE_SETTINGS
"#define COMISO_OSQP_AVAILABLE 1"
)
else
()
set
(
COMISO_OSQP_CONFIG_FILE_SETTINGS
"#define COMISO_OSQP_AVAILABLE 0"
)
...
...
Config/config.hh.in
View file @
491b8d43
...
...
@@ -27,3 +27,4 @@
@COMISO_COINUTILS_CONFIG_FILE_SETTINGS@
@COMISO_MOSEK_CONFIG_FILE_SETTINGS@
@COMISO_OSQP_CONFIG_FILE_SETTINGS@
@COMISO_LPSOLVE_CONFIG_FILE_SETTINGS@
Examples/small_linear_problem/main.cc
View file @
491b8d43
...
...
@@ -33,7 +33,7 @@
#include
<CoMISo/NSolver/CPLEXSolver.hh>
#include
<CoMISo/NSolver/GUROBISolver.hh>
#include
<CoMISo/NSolver/CBCSolver.hh>
#include
<CoMISo/NSolver/LPSolveSolver.hh>
// minimize linear problem E = 8*x + 2*y + 3*z subject to x+y+z >= 2 and z-y >= 1 and x, y, z binary
...
...
@@ -84,34 +84,48 @@ int main(void)
std
::
cout
<<
"---------- 3) Get CPLEX and optimize... "
<<
std
::
endl
;
COMISO
::
CPLEXSolver
csol
;
csol
.
solve
(
&
lp
,
constraints
,
dc
);
#endif
std
::
cout
<<
"---------- 4) Print solution..."
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
std
::
cerr
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
std
::
cout
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
#endif
// check if GUROBI solver available in current configuration
#if( COMISO_GUROBI_AVAILABLE)
std
::
cout
<<
"---------- 5) Get GUROBI and optimize... "
<<
std
::
endl
;
COMISO
::
GUROBISolver
gsol
;
gsol
.
solve
(
&
lp
,
constraints
,
dc
);
std
::
cout
<<
"---------- 6) Print solution..."
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
std
::
cout
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
#endif
std
::
cout
<<
"---------- 6) Print solution..."
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
std
::
cerr
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
// check if CBC solver available in current configuration
// check if CBC solver available in current configuration
#if( COMISO_CBC_AVAILABLE)
std
::
cout
<<
"---------- 6) Get CBC and optimize... "
<<
std
::
endl
;
COMISO
::
CBCSolver
cbc_sol
;
cbc_sol
.
solve
(
&
lp
,
constraints
,
dc
);
#endif
std
::
cout
<<
"---------- 7) Get CBC and optimize... "
<<
std
::
endl
;
COMISO
::
CBCSolver
cbc_sol
;
cbc_sol
.
solve
(
&
lp
,
constraints
,
dc
);
std
::
cout
<<
"---------- 8) Print solution..."
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
std
::
cerr
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
std
::
cout
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
std
::
cout
<<
"Objective is "
<<
lp
.
eval_f
(
lp
.
x
().
data
())
<<
std
::
endl
;
#endif
// check if CBC solver available in current configuration
#if( COMISO_LPSOLVE_AVAILABLE)
std
::
cout
<<
"---------- 9) Get lpsolve and optimize... "
<<
std
::
endl
;
COMISO
::
LPSolveSolver
lpsolve_solver
;
lpsolve_solver
.
solve
(
&
lp
,
constraints
,
dc
);
std
::
cout
<<
"---------- 10) Print solution..."
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
std
::
cout
<<
"x_"
<<
i
<<
" = "
<<
lp
.
x
()[
i
]
<<
std
::
endl
;
#endif
return
0
;
...
...
NSolver/LPSolveSolver.cc
0 → 100644
View file @
491b8d43
//=============================================================================
//
// CLASS LPSolverSolver - IMPLEMENTATION
//
//=============================================================================
//== INCLUDES =================================================================
//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#include
<CoMISo/Config/config.hh>
#if COMISO_LPSOLVE_AVAILABLE
//=============================================================================
#include
"LPSolveSolver.hh"
#include
<CoMISo/Utils/CoMISoError.hh>
#include
<Base/Debug/DebTime.hh>
#include
<Base/Code/Quality.hh>
#include
<lp_lib.h>
#include
<stdexcept>
//== NAMESPACES ===============================================================
namespace
COMISO
{
//== IMPLEMENTATION ==========================================================
namespace
{
int
getLPSolverRowType
(
NConstraintInterface
*
c
)
{
switch
(
c
->
constraint_type
())
{
case
NConstraintInterface
::
NC_EQUAL
:
return
EQ
;
case
NConstraintInterface
::
NC_LESS_EQUAL
:
return
LE
;
case
NConstraintInterface
::
NC_GREATER_EQUAL
:
return
GE
;
}
}
std
::
vector
<
double
>
get_linear_energy_coefficients
(
NProblemInterface
*
_problem
)
{
std
::
vector
<
double
>
zero
(
_problem
->
n_unknowns
(),
0
);
std
::
vector
<
double
>
q
;
q
.
resize
(
_problem
->
n_unknowns
());
_problem
->
eval_gradient
(
zero
.
data
(),
q
.
data
());
return
q
;
}
bool
solve_impl
(
NProblemInterface
*
_problem
,
const
std
::
vector
<
NConstraintInterface
*>&
_constraints
,
const
std
::
vector
<
PairIndexVtype
>&
_discrete_constraints
,
bool
_unbounded_variables
,
const
double
_time_limit
)
{
lprec
*
lp
=
nullptr
;
int
Ncol
=
_problem
->
n_unknowns
();
int
ret
=
0
;
/* We will build the model row by row */
lp
=
make_lp
(
0
,
Ncol
);
if
(
lp
==
nullptr
)
ret
=
1
;
/* couldn't construct a new model... */
set_timeout
(
lp
,
_time_limit
);
std
::
vector
<
int
>
col_idxs
;
col_idxs
.
reserve
(
Ncol
);
std
::
vector
<
REAL
>
row_coefficients
;
row_coefficients
.
reserve
(
Ncol
);
auto
reset_vectors
=
[
&
col_idxs
,
&
row_coefficients
]()
{
col_idxs
.
clear
();
row_coefficients
.
clear
();
// LPSolve ignores first entry
col_idxs
.
push_back
(
0
);
row_coefficients
.
push_back
(
0
);
};
if
(
_unbounded_variables
)
for
(
size_t
i
=
1
;
i
<
Ncol
+
1
;
++
i
)
set_unbounded
(
lp
,
i
);
// setup objective function
if
(
ret
==
0
)
{
auto
coeffs
=
get_linear_energy_coefficients
(
_problem
);
reset_vectors
();
for
(
size_t
i
=
0
;
i
<
coeffs
.
size
();
++
i
)
{
col_idxs
.
push_back
(
i
+
1
);
row_coefficients
.
push_back
(
coeffs
[
i
]);
}
/* set the objective in lpsolve */
if
(
!
set_obj_fnex
(
lp
,
row_coefficients
.
size
(),
row_coefficients
.
data
(),
col_idxs
.
data
()))
ret
=
4
;
}
// add constraints
{
set_add_rowmode
(
lp
,
TRUE
);
/* makes building the model faster if it is done rows by row */
std
::
vector
<
REAL
>
all_row_coefficients
(
Ncol
);
// including zeros
NConstraintInterface
::
SVectorNC
gc
;
for
(
auto
c
:
_constraints
)
{
reset_vectors
();
if
(
!
c
->
is_linear
())
{
DEB_error
(
"LPSolve: non-linear constraints are not supported and thus ignored."
);
continue
;
}
c
->
eval_gradient
(
all_row_coefficients
.
data
(),
gc
);
for
(
NConstraintInterface
::
SVectorNC
::
InnerIterator
v_it
(
gc
);
v_it
;
++
v_it
)
{
col_idxs
.
push_back
(
v_it
.
index
()
+
1
);
row_coefficients
.
push_back
(
v_it
.
value
());
}
const
auto
b
=
c
->
eval_constraint
(
all_row_coefficients
.
data
());
if
(
!
add_constraintex
(
lp
,
row_coefficients
.
size
(),
row_coefficients
.
data
(),
col_idxs
.
data
(),
getLPSolverRowType
(
c
),
-
b
))
ret
=
3
;
}
set_add_rowmode
(
lp
,
FALSE
);
/* rowmode should be turned off again when done building the model */
}
// setup variable types
if
(
ret
==
0
)
{
for
(
auto
c
:
_discrete_constraints
)
{
switch
(
c
.
second
)
{
case
Real
:
// real is default
break
;
case
Integer
:
set_int
(
lp
,
c
.
first
+
1
,
true
);
break
;
case
Binary
:
set_binary
(
lp
,
c
.
first
+
1
,
true
);
break
;
}
}
}
if
(
ret
==
0
)
{
/* set the object direction to maximize */
set_minim
(
lp
);
/* just out of curioucity, now show the model in lp format on screen */
/* this only works if this is a console application. If not, use write_lp and a filename */
//write_LP(lp, stdout);
/* write_lp(lp, "model.lp"); */
/* I only want to see important messages on screen while solving */
set_verbose
(
lp
,
SEVERE
);
/* Now let lpsolve calculate a solution */
ret
=
solve
(
lp
);
if
(
ret
==
OPTIMAL
)
ret
=
0
;
else
ret
=
5
;
}
if
(
ret
==
0
)
{
/* variable values */
get_variables
(
lp
,
row_coefficients
.
data
());
_problem
->
store_result
(
row_coefficients
.
data
());
/* we are done now */
}
if
(
lp
!=
nullptr
)
{
/* clean up such that all used memory by lpsolve is freed */
delete_lp
(
lp
);
}
return
ret
==
0
;
}
}
//namespace
bool
LPSolveSolver
::
solve
(
NProblemInterface
*
_problem
,
const
std
::
vector
<
NConstraintInterface
*>&
_constraints
,
const
std
::
vector
<
PairIndexVtype
>&
_discrete_constraints
,
const
double
_time_limit
)
{
DEB_enter_func
;
bool
valid_solution
=
false
;
try
{
valid_solution
=
solve_impl
(
_problem
,
_constraints
,
_discrete_constraints
,
unbounded_variables_
,
_time_limit
);
}
catch
(...)
{
DEB_warning
(
1
,
"Caught an error"
);
//COMISO_THROW(UNSPECIFIED_CBC_EXCEPTION);
}
return
valid_solution
;
}
//=============================================================================
}
// namespace COMISO
//=============================================================================
#endif // COMISO_CBC_AVAILABLE
//=============================================================================
NSolver/LPSolveSolver.hh
0 → 100644
View file @
491b8d43
// (C) Copyright 2015 by Autodesk, Inc.
//=============================================================================
//
// CLASSLPSolverSolver
//
//=============================================================================
#ifndef COMISO_LPSOLVESOLVER_HH
#define COMISO_LPSOLVESOLVER_HH
//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#include
<CoMISo/Config/config.hh>
#if COMISO_LPSOLVE_AVAILABLE
//== INCLUDES =================================================================
#include
<CoMISo/Config/CoMISoDefines.hh>
#include
<vector>
#include
<string>
#include
<CoMISo/NSolver/NProblemInterface.hh>
#include
<CoMISo/NSolver/NConstraintInterface.hh>
#include
<CoMISo/NSolver/VariableType.hh>
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace
COMISO
{
//== CLASS DEFINITION =========================================================
/**
Solver interface for LPSolve.
*/
class
COMISODLLEXPORT
LPSolveSolver
{
public:
// By default variables have a lower bound of 0.
// By choosing unbounded variables LPSolve will double the number of variables
// which leads to a more expensive solve.
LPSolveSolver
(
bool
_unbounded_variables
=
false
)
:
unbounded_variables_
(
_unbounded_variables
)
{}
// ********** SOLVE **************** //
//! \throws Outcome
bool
solve
(
NProblemInterface
*
_problem
,
// problem instance
const
std
::
vector
<
NConstraintInterface
*>&
_constraints
,
// linear constraints
const
std
::
vector
<
PairIndexVtype
>&
_discrete_constraints
,
// discrete constraints
const
double
_time_limit
=
60
);
// time limit in seconds
//! \throws Outcome
bool
solve
(
NProblemInterface
*
_problem
,
// problem instance
const
std
::
vector
<
NConstraintInterface
*>&
_constraints
,
// linear constraints
const
double
_time_limit
=
60
)
// time limit in seconds
{
std
::
vector
<
PairIndexVtype
>
dc
;
return
solve
(
_problem
,
_constraints
,
dc
,
_time_limit
);
}
private:
bool
unbounded_variables_
;
};
//=============================================================================
}
// namespace COMISO
//=============================================================================
#endif // COMISO_CBC_AVAILABLE
//=============================================================================
#endif // COMISO_CBCSolver_HH
//=============================================================================
NSolver/OSQPSolver.cc
View file @
491b8d43
...
...
@@ -149,7 +149,7 @@ public:
settings
.
eps_abs
=
1e-5
;
// absolute convergence tolerance
settings
.
eps_rel
=
1e-5
;
// relative convergence tolerance
settings
.
eps_prim_inf
=
1e-6
;
// primal infeasibility tolerance
settings
.
eps_dual_inf
=
1
.
;
// dual infeasibility tolerance
settings
.
eps_dual_inf
=
1
e-6
;
// dual infeasibility tolerance
// settings.linsys_solver = MKL_PARDISO_SOLVER;
data
.
n
=
0
;
...
...
Solver/Eigen_ToolsT.cc
View file @
491b8d43
...
...
@@ -703,8 +703,8 @@ void f(const gmm::col_matrix<GMM_VectorT>& _G, EIGEN_MatrixT& _E)
{
ColT
col
=
mat_const_col
(
_G
,
i
);
CIter
it
=
gmm
::
vect_const_begin
(
col
);
CIter
ite
=
gmm
::
vect_const_end
(
col
);
auto
it
=
gmm
::
vect_const_begin
(
col
);
auto
ite
=
gmm
::
vect_const_end
(
col
);
for
(
;
it
!=
ite
;
++
it
)
triplets
.
push_back
(
Triplet
(
it
.
index
(),
i
,
*
it
));
...
...
VERSION
deleted
100644 → 0
View file @
a7922302
VERSION=1.1
MAJOR=1
MINOR=1
PATCH=0
ID=COMISO
cmake-library
@
d9087328
Compare
a4938523
...
d9087328
Subproject commit
a49385233272aa9a98c626c6adc5ba213ab2c811
Subproject commit
d90873288efd3ce0aad9e30df6c5dc2ad7b06ce6
cmake/FindCBC.cmake
View file @
491b8d43
...
...
@@ -5,31 +5,6 @@
# CBC_LIBRARIES - The libraries needed to use CBC
# 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
()
if
(
NOT CBC_FOUND
)
find_path
(
CBC_INCLUDE_DIR
...
...
cmake/FindCGL.cmake
View file @
491b8d43
...
...
@@ -5,30 +5,6 @@
# CGL_LIBRARIES - The libraries needed to use CGL
# 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
()
if
(
NOT CGL_FOUND
)
find_path
(
CGL_INCLUDE_DIR
...
...
cmake/FindCLP.cmake
View file @
491b8d43
...
...
@@ -5,31 +5,6 @@
# CLP_LIBRARIES - The libraries needed to use CLP
# 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
()
if
(
NOT CLP_FOUND
)
find_path
(
CLP_INCLUDE_DIR
...
...
cmake/FindCOINUTILS.cmake
View file @
491b8d43
...
...
@@ -5,30 +5,6 @@
# COINUTILS_LIBRARIES - The libraries needed to use COINUTILS
# 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
()
if
(
NOT COINUTILS_FOUND
)