Merge branch 'master' of github.com:google/or-tools
This commit is contained in:
@@ -61,6 +61,9 @@ message(STATUS "Build Java: ${BUILD_JAVA}")
|
||||
option(BUILD_DOTNET "Build .NET Library" OFF)
|
||||
message(STATUS "Build .Net: ${BUILD_DOTNET}")
|
||||
|
||||
option(BUILD_EXAMPLES "Build examples" ON)
|
||||
message(STATUS "Build examples: ${BUILD_EXAMPLES}")
|
||||
|
||||
#option(BUILD_DOC "Build doxygen" OFF)
|
||||
#message(STATUS "Build doxygen: ${BUILD_DOC}")
|
||||
|
||||
@@ -167,3 +170,9 @@ include(cpp)
|
||||
include(python)
|
||||
include(java)
|
||||
include(dotnet)
|
||||
|
||||
# Since samples mix all languages we must parse them once we have included all
|
||||
# <language>.cmake files
|
||||
foreach(SAMPLES IN ITEMS algorithms graph linear_solver constraint_solver sat)
|
||||
add_subdirectory(ortools/${SAMPLES}/samples)
|
||||
endforeach()
|
||||
|
||||
@@ -24,6 +24,18 @@ if(BUILD_absl)
|
||||
else()
|
||||
find_package(absl REQUIRED)
|
||||
endif()
|
||||
set(ABSL_DEPS
|
||||
absl::base
|
||||
absl::random_random
|
||||
absl::raw_hash_set
|
||||
absl::hash
|
||||
absl::memory
|
||||
absl::meta
|
||||
absl::str_format
|
||||
absl::strings
|
||||
absl::synchronization
|
||||
absl::any
|
||||
)
|
||||
|
||||
set(GFLAGS_USE_TARGET_NAMESPACE TRUE)
|
||||
if(BUILD_gflags)
|
||||
@@ -83,14 +95,17 @@ endif()
|
||||
# Check optional Dependencies
|
||||
if(USE_CPLEX)
|
||||
find_package(CPLEX REQUIRED)
|
||||
set(CPLEX_DEP CPLEX::CPLEX)
|
||||
endif()
|
||||
|
||||
if(USE_SCIP)
|
||||
find_package(SCIP REQUIRED)
|
||||
set(SCIP_DEP SCIP::SCIP)
|
||||
endif()
|
||||
|
||||
if(USE_XPRESS)
|
||||
find_package(XPRESS REQUIRED)
|
||||
set(XPRESS_DEP XPRESS::XPRESS)
|
||||
endif()
|
||||
|
||||
# If wrapper are built, we need to have the install rpath in BINARY_DIR to package
|
||||
@@ -206,33 +221,18 @@ endif()
|
||||
# Dependencies
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC
|
||||
ZLIB::ZLIB
|
||||
absl::base
|
||||
absl::random_random
|
||||
absl::raw_hash_set
|
||||
absl::hash
|
||||
absl::memory
|
||||
absl::meta
|
||||
absl::str_format
|
||||
absl::strings
|
||||
absl::synchronization
|
||||
absl::any
|
||||
${ABSL_DEPS}
|
||||
${GFLAGS_DEP}
|
||||
glog::glog
|
||||
protobuf::libprotobuf
|
||||
${COINOR_DEPS}
|
||||
${CPLEX_DEP}
|
||||
${SCIP_DEP}
|
||||
${XPRESS_DEP}
|
||||
Threads::Threads)
|
||||
if(WIN32)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC psapi.lib ws2_32.lib)
|
||||
endif()
|
||||
if(USE_CPLEX)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC CPLEX::CPLEX)
|
||||
endif()
|
||||
if(USE_SCIP)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC SCIP::SCIP)
|
||||
endif()
|
||||
if(USE_XPRESS)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC XPRESS::XPRESS)
|
||||
endif()
|
||||
|
||||
# ALIAS
|
||||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||
@@ -302,7 +302,7 @@ add_library(${PROJECT_NAME}::proto ALIAS ${PROJECT_NAME}_proto)
|
||||
target_sources(${PROJECT_NAME} PRIVATE $<TARGET_OBJECTS:${PROJECT_NAME}::proto>)
|
||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}::proto)
|
||||
|
||||
foreach(SUBPROJECT
|
||||
foreach(SUBPROJECT IN ITEMS
|
||||
algorithms base bop constraint_solver data glop graph linear_solver lp_data
|
||||
port sat util)
|
||||
add_subdirectory(ortools/${SUBPROJECT})
|
||||
|
||||
@@ -61,10 +61,33 @@ if(USE_COINOR)
|
||||
endif()
|
||||
list(APPEND CMAKE_SWIG_FLAGS ${FLAGS} "-I${PROJECT_SOURCE_DIR}")
|
||||
|
||||
foreach(SUBPROJECT constraint_solver linear_solver sat graph algorithms util)
|
||||
foreach(SUBPROJECT IN ITEMS algorithms graph linear_solver constraint_solver sat util)
|
||||
add_subdirectory(ortools/${SUBPROJECT}/csharp)
|
||||
list(APPEND dotnet_native_targets ${PROJECT_NAME}::dotnet_${SUBPROJECT})
|
||||
endforeach()
|
||||
|
||||
# Build or retrieve .snk file
|
||||
if(DEFINED ENV{DOTNET_SNK})
|
||||
add_custom_command(OUTPUT dotnet/or-tools.snk
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $ENV{DOTNET_SNK} .
|
||||
COMMENT "Copy or-tools.snk from ENV:DOTNET_SNK"
|
||||
WORKING_DIRECTORY dotnet
|
||||
VERBATIM
|
||||
)
|
||||
else()
|
||||
set(OR_TOOLS_DOTNET_SNK CreateSigningKey)
|
||||
add_custom_command(OUTPUT dotnet/or-tools.snk
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/ortools/dotnet/${OR_TOOLS_DOTNET_SNK} ${OR_TOOLS_DOTNET_SNK}
|
||||
COMMAND
|
||||
${DOTNET_CLI} run
|
||||
--project ${OR_TOOLS_DOTNET_SNK}/${OR_TOOLS_DOTNET_SNK}.csproj
|
||||
/or-tools.snk
|
||||
COMMENT "Generate or-tools.snk using CreateSigningKey project"
|
||||
WORKING_DIRECTORY dotnet
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(RUNTIME_IDENTIFIER osx-x64)
|
||||
elseif(UNIX)
|
||||
@@ -78,6 +101,7 @@ set(OR_TOOLS_DOTNET_NATIVE Google.OrTools.runtime.${RUNTIME_IDENTIFIER})
|
||||
|
||||
add_custom_target(dotnet_native
|
||||
DEPENDS
|
||||
dotnet/or-tools.snk
|
||||
ortools::ortools
|
||||
Dotnet${PROJECT_NAME}_proto
|
||||
${PROJECT_BINARY_DIR}/dotnet/${OR_TOOLS_DOTNET_NATIVE}/${OR_TOOLS_DOTNET_NATIVE}.csproj
|
||||
@@ -98,6 +122,7 @@ set(OR_TOOLS_DOTNET Google.OrTools)
|
||||
|
||||
add_custom_target(dotnet_package ALL
|
||||
DEPENDS
|
||||
dotnet/or-tools.snk
|
||||
dotnet_native
|
||||
${PROJECT_BINARY_DIR}/dotnet/${OR_TOOLS_DOTNET}/${OR_TOOLS_DOTNET}.csproj
|
||||
COMMAND ${DOTNET_CLI} build -c Release /p:Platform=x64 ${OR_TOOLS_DOTNET}/${OR_TOOLS_DOTNET}.csproj
|
||||
|
||||
@@ -78,7 +78,7 @@ if(USE_COINOR)
|
||||
endif()
|
||||
list(APPEND CMAKE_SWIG_FLAGS ${FLAGS} "-I${PROJECT_SOURCE_DIR}")
|
||||
|
||||
foreach(SUBPROJECT constraint_solver linear_solver sat graph algorithms data util)
|
||||
foreach(SUBPROJECT IN ITEMS algorithms graph linear_solver constraint_solver sat data util)
|
||||
add_subdirectory(ortools/${SUBPROJECT}/python)
|
||||
endforeach()
|
||||
|
||||
|
||||
0
ortools/algorithms/samples/CMakeLists.txt
Normal file
0
ortools/algorithms/samples/CMakeLists.txt
Normal file
@@ -1,7 +1,6 @@
|
||||
set_property(SOURCE routing.i PROPERTY CPLUSPLUS ON)
|
||||
set_property(SOURCE routing.i PROPERTY SWIG_MODULE_NAME operations_research_constraint_solver)
|
||||
set_property(SOURCE routing.i PROPERTY COMPILE_OPTIONS
|
||||
-nofastunpack
|
||||
-namespace ${OR_TOOLS_DOTNET}.ConstraintSolver
|
||||
-dllimport google-ortools-native
|
||||
)
|
||||
|
||||
0
ortools/constraint_solver/samples/CMakeLists.txt
Normal file
0
ortools/constraint_solver/samples/CMakeLists.txt
Normal file
0
ortools/graph/samples/CMakeLists.txt
Normal file
0
ortools/graph/samples/CMakeLists.txt
Normal file
0
ortools/linear_solver/samples/CMakeLists.txt
Normal file
0
ortools/linear_solver/samples/CMakeLists.txt
Normal file
0
ortools/sat/samples/CMakeLists.txt
Normal file
0
ortools/sat/samples/CMakeLists.txt
Normal file
Reference in New Issue
Block a user