cmake: Split math_opt into sub library

XCode do not support object library with several file with the same name
since it use a flat directory, Xcode "fix" using a UID but CMake can't catch it.

math_opt also use a parameters.proto which conflict with the
glop/parameters.proto -> need to split the proto to .cc generation in
two libraries
This commit is contained in:
Mizux Seiha
2023-09-20 16:15:45 +02:00
committed by Corentin Le Molgat
parent a42814c06b
commit d8634ab0f2
36 changed files with 636 additions and 215 deletions

View File

@@ -15,24 +15,22 @@ if(NOT BUILD_CXX)
return()
endif()
# Main Target
add_library(${PROJECT_NAME} "")
# Xcode fails to build if library doesn't contains at least one source file.
if(XCODE)
file(GENERATE
OUTPUT ${PROJECT_BINARY_DIR}/${PROJECT_NAME}/version.cpp
CONTENT "namespace {char* version = \"${PROJECT_VERSION}\";}")
target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}/version.cpp)
endif()
#############
## FLAGS ##
#############
set(OR_TOOLS_COMPILE_DEFINITIONS)
set(OR_TOOLS_COMPILE_OPTIONS)
set(OR_TOOLS_LINK_OPTIONS)
if(BUILD_SHARED_LIBS)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "OR_TOOLS_AS_DYNAMIC_LIB")
endif()
# Mandatory built-in components
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS
"USE_BOP" # enable BOP support
"USE_GLOP" # enable GLOP support
)
# Optional Components
# Optional built-in components
if(BUILD_LP_PARSER)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_LP_PARSER")
endif()
@@ -40,7 +38,6 @@ if(BUILD_MATH_OPT)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_MATH_OPT")
set(MATH_OPT_DIR math_opt)
endif()
# Optional solvers
if(USE_COINOR)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS
@@ -81,6 +78,8 @@ endif()
if(WIN32)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "__WIN32__")
endif()
# Compiler options
if(MSVC)
list(APPEND OR_TOOLS_COMPILE_OPTIONS
"/bigobj" # Allow big object
@@ -120,76 +119,103 @@ else()
list(APPEND OR_TOOLS_COMPILE_OPTIONS "-fwrapv")
endif()
# Includes
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
# Link option
if(MSVC)
list(APPEND OR_TOOLS_LINK_OPTIONS
"/WHOLEARCHIVE:${PROJECT_NAME}"
)
endif()
##################
## PROTO FILE ##
##################
# Get Protobuf include dir
set(PROTO_DIRS)
get_target_property(protobuf_dirs protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir IN LISTS protobuf_dirs)
if (NOT "${dir}" MATCHES "INSTALL_INTERFACE|-NOTFOUND")
#message(STATUS "Adding proto path: ${dir}")
list(APPEND PROTO_DIRS "--proto_path=${dir}")
endif()
endforeach()
# Generate C++ OBJECT library from proto files,
# e.g
# generate_proto_library(
# NAME
# ortools_proto
# FILES
# ortools/foo/foo.proto
# ortools/bar/bar.proto
# NO_ALIAS
# )
function(generate_proto_library)
set(options NO_ALIAS)
set(oneValueArgs NAME)
set(multiValueArgs FILES LINK_LIBRARIES)
cmake_parse_arguments(PROTO
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
# Compile options
if(MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20)
else()
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 17)
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
target_compile_features(${PROJECT_NAME} PUBLIC
$<IF:$<CXX_COMPILER_ID:MSVC>,cxx_std_20,cxx_std_17>)
target_compile_definitions(${PROJECT_NAME} PUBLIC ${OR_TOOLS_COMPILE_DEFINITIONS})
target_compile_options(${PROJECT_NAME} PUBLIC ${OR_TOOLS_COMPILE_OPTIONS})
if(MSVC)
target_link_options(${PROJECT_NAME} INTERFACE "/WHOLEARCHIVE:${PROJECT_NAME}")
endif()
if(NOT PROTOC_PRG)
message(FATAL_ERROR "protoc binary not found.")
endif()
# Properties
if(NOT APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
else()
# Clang don't support version x.y.z with z > 255
set_target_properties(${PROJECT_NAME} PROPERTIES
INSTALL_RPATH "@loader_path"
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
)
set_target_properties(${PROJECT_NAME} PROPERTIES INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION)
# Generate proto C++ files.
set(PROTO_HDRS)
set(PROTO_SRCS)
foreach(PROTO_FILE IN LISTS PROTO_FILES)
#message(STATUS "protoc proto(cc): ${PROTO_FILE}")
get_filename_component(PROTO_DIR ${PROTO_FILE} DIRECTORY)
get_filename_component(PROTO_NAME_WE ${PROTO_FILE} NAME_WE)
set(PROTO_HDR ${PROJECT_BINARY_DIR}/${PROTO_DIR}/${PROTO_NAME_WE}.pb.h)
set(PROTO_SRC ${PROJECT_BINARY_DIR}/${PROTO_DIR}/${PROTO_NAME_WE}.pb.cc)
#message(STATUS "protoc hdr: ${PROTO_HDR}")
#message(STATUS "protoc src: ${PROTO_SRC}")
add_custom_command(
OUTPUT ${PROTO_SRC} ${PROTO_HDR}
COMMAND ${PROTOC_PRG}
"--proto_path=${PROJECT_SOURCE_DIR}"
${PROTO_DIRS}
"--cpp_out=${PROJECT_BINARY_DIR}"
${PROTO_FILE}
DEPENDS ${PROTO_FILE} ${PROTOC_PRG}
COMMENT "Generate C++ protocol buffer for ${PROTO_FILE}"
VERBATIM)
list(APPEND PROTO_HDRS ${PROTO_HDR})
list(APPEND PROTO_SRCS ${PROTO_SRC})
endforeach()
# Dependencies
target_link_libraries(${PROJECT_NAME} PUBLIC
${CMAKE_DL_LIBS}
ZLIB::ZLIB
${ABSL_DEPS}
protobuf::libprotobuf
${RE2_DEPS}
${COINOR_DEPS}
$<$<BOOL:${USE_CPLEX}>:CPLEX::CPLEX>
$<$<BOOL:${USE_GLPK}>:GLPK::GLPK>
$<$<BOOL:${USE_HIGHS}>:HIGHS::HIGHS>
${PDLP_DEPS}
$<$<BOOL:${USE_SCIP}>:libscip>
$<$<BOOL:${USE_XPRESS}>:XPRESS::XPRESS>
Threads::Threads)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PUBLIC psapi.lib ws2_32.lib)
endif()
# ALIAS
add_library(${PROJECT_NAMESPACE}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
# Create library
add_library(${PROTO_NAME}_proto OBJECT ${PROTO_SRCS} ${PROTO_HDRS})
target_compile_features(${PROTO_NAME}_proto PUBLIC $<IF:$<CXX_COMPILER_ID:MSVC>,cxx_std_20,cxx_std_17>)
if(MSVC)
set_target_properties(${PROTO_NAME}_proto PROPERTIES CXX_STANDARD 20)
else()
set_target_properties(${PROTO_NAME}_proto PROPERTIES CXX_STANDARD 17)
endif()
set_target_properties(${PROTO_NAME}_proto PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON)
target_include_directories(${PROTO_NAME}_proto PRIVATE
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
#$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_definitions(${PROTO_NAME}_proto PUBLIC ${OR_TOOLS_COMPILE_DEFINITIONS})
target_compile_options(${PROTO_NAME}_proto PUBLIC ${OR_TOOLS_COMPILE_OPTIONS})
target_link_libraries(${PROTO_NAME}_proto PUBLIC protobuf::libprotobuf ${PROTO_LINK_LIBRARIES})
add_library(${PROJECT_NAMESPACE}::${PROTO_NAME}_proto ALIAS ${PROTO_NAME}_proto)
#message(FATAL_ERROR "Proto target alias: ${PROJECT_NAMESPACE}::${PROTO_NAME}_proto")
endfunction()
# Generate Protobuf cpp sources
set(PROTO_HDRS)
set(PROTO_SRCS)
file(GLOB_RECURSE proto_files RELATIVE ${PROJECT_SOURCE_DIR}
set(OR_TOOLS_PROTO_FILES)
file(GLOB_RECURSE OR_TOOLS_PROTO_FILES RELATIVE ${PROJECT_SOURCE_DIR}
"ortools/bop/*.proto"
"ortools/constraint_solver/*.proto"
"ortools/glop/*.proto"
@@ -201,79 +227,86 @@ file(GLOB_RECURSE proto_files RELATIVE ${PROJECT_SOURCE_DIR}
"ortools/scheduling/*.proto"
"ortools/util/*.proto"
)
if(USE_PDLP OR BUILD_MATH_OPT)
file(GLOB_RECURSE PDLP_PROTO_FILES RELATIVE ${PROJECT_SOURCE_DIR} "ortools/pdlp/*.proto")
list(APPEND OR_TOOLS_PROTO_FILES ${PDLP_PROTO_FILES})
endif()
if(USE_SCIP OR BUILD_MATH_OPT)
file(GLOB_RECURSE GSCIP_PROTO_FILES RELATIVE ${PROJECT_SOURCE_DIR} "ortools/gscip/*.proto")
list(APPEND OR_TOOLS_PROTO_FILES ${GSCIP_PROTO_FILES})
endif()
generate_proto_library(
NAME ${PROJECT_NAME}
FILES ${OR_TOOLS_PROTO_FILES})
if(BUILD_MATH_OPT)
file(GLOB_RECURSE math_opt_proto_files RELATIVE ${PROJECT_SOURCE_DIR}
file(GLOB_RECURSE MATH_OPT_PROTO_FILES RELATIVE ${PROJECT_SOURCE_DIR}
"ortools/math_opt/*.proto"
"ortools/math_opt/solvers/*.proto"
)
list(APPEND proto_files ${math_opt_proto_files})
endif()
if(USE_PDLP OR BUILD_MATH_OPT)
file(GLOB_RECURSE pdlp_proto_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/pdlp/*.proto")
list(APPEND proto_files ${pdlp_proto_files})
endif()
if(USE_SCIP OR BUILD_MATH_OPT)
file(GLOB_RECURSE gscip_proto_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/gscip/*.proto")
list(APPEND proto_files ${gscip_proto_files})
generate_proto_library(
NAME math_opt
FILES ${MATH_OPT_PROTO_FILES}
LINK_LIBRARIES ${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
endif()
## Get Protobuf include dir
get_target_property(protobuf_dirs protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir IN LISTS protobuf_dirs)
if (NOT "${dir}" MATCHES "INSTALL_INTERFACE|-NOTFOUND")
message(STATUS "Adding proto path: ${dir}")
list(APPEND PROTO_DIRS "--proto_path=${dir}")
endif()
endforeach()
foreach(PROTO_FILE IN LISTS proto_files)
#message(STATUS "protoc proto(cc): ${PROTO_FILE}")
get_filename_component(PROTO_DIR ${PROTO_FILE} DIRECTORY)
get_filename_component(PROTO_NAME ${PROTO_FILE} NAME_WE)
set(PROTO_HDR ${PROJECT_BINARY_DIR}/${PROTO_DIR}/${PROTO_NAME}.pb.h)
set(PROTO_SRC ${PROJECT_BINARY_DIR}/${PROTO_DIR}/${PROTO_NAME}.pb.cc)
#message(STATUS "protoc hdr: ${PROTO_HDR}")
#message(STATUS "protoc src: ${PROTO_SRC}")
add_custom_command(
OUTPUT ${PROTO_SRC} ${PROTO_HDR}
COMMAND ${PROTOC_PRG}
"--proto_path=${PROJECT_SOURCE_DIR}"
${PROTO_DIRS}
"--cpp_out=${PROJECT_BINARY_DIR}"
${PROTO_FILE}
DEPENDS ${PROTO_FILE} ${PROTOC_PRG}
COMMENT "Generate C++ protocol buffer for ${PROTO_FILE}"
VERBATIM)
list(APPEND PROTO_HDRS ${PROTO_HDR})
list(APPEND PROTO_SRCS ${PROTO_SRC})
endforeach()
###############
## ORTOOLS ##
###############
# Main Target
add_library(${PROJECT_NAME} "")
# Compile options
if(MSVC)
set(CMAKE_CXX_STANDARD 20)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 17)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)
target_compile_features(${PROJECT_NAME} PUBLIC
$<IF:$<CXX_COMPILER_ID:MSVC>,cxx_std_20,cxx_std_17>)
target_compile_definitions(${PROJECT_NAME} PUBLIC ${OR_TOOLS_COMPILE_DEFINITIONS})
target_compile_options(${PROJECT_NAME} PUBLIC ${OR_TOOLS_COMPILE_OPTIONS})
target_link_options(${PROJECT_NAME} INTERFACE ${OR_TOOLS_LINK_OPTIONS})
# Properties
if(NOT APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION})
else()
# Clang don't support version x.y.z with z > 255
set_target_properties(${PROJECT_NAME} PROPERTIES
INSTALL_RPATH "@loader_path"
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}
COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION
)
#add_library(${PROJECT_NAME}_proto STATIC ${PROTO_SRCS} ${PROTO_HDRS})
add_library(${PROJECT_NAME}_proto OBJECT ${PROTO_SRCS} ${PROTO_HDRS})
set_target_properties(${PROJECT_NAME}_proto PROPERTIES
POSITION_INDEPENDENT_CODE ON)
target_include_directories(${PROJECT_NAME}_proto PRIVATE
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_definitions(${PROJECT_NAME}_proto PUBLIC ${OR_TOOLS_COMPILE_DEFINITIONS})
target_compile_options(${PROJECT_NAME}_proto PUBLIC ${OR_TOOLS_COMPILE_OPTIONS})
#target_link_libraries(${PROJECT_NAME}_proto PRIVATE protobuf::libprotobuf)
add_dependencies(${PROJECT_NAME}_proto protobuf::libprotobuf)
add_library(${PROJECT_NAMESPACE}::proto ALIAS ${PROJECT_NAME}_proto)
# Add ${PROJECT_NAMESPACE}::proto to libortools
# Includes
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)
# Xcode fails to build if library doesn't contains at least one source file.
if(XCODE)
file(GENERATE
OUTPUT ${PROJECT_BINARY_DIR}/${PROJECT_NAME}/version.cpp
CONTENT "namespace {char* version = \"${PROJECT_VERSION}\";}")
target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}/version.cpp)
endif()
# Add ${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto to libortools
#target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAMESPACE}::proto)
target_sources(${PROJECT_NAME} PRIVATE $<TARGET_OBJECTS:${PROJECT_NAMESPACE}::proto>)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAMESPACE}::proto)
target_sources(${PROJECT_NAME} PRIVATE
$<TARGET_OBJECTS:${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto>)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
foreach(SUBPROJECT IN ITEMS
algorithms
@@ -281,7 +314,6 @@ foreach(SUBPROJECT IN ITEMS
bop
constraint_solver
${GLPK_DIR}
${MATH_OPT_DIR}
${PDLP_DIR}
${GSCIP_DIR}
glop
@@ -301,6 +333,16 @@ foreach(SUBPROJECT IN ITEMS
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_${SUBPROJECT})
endforeach()
if(BUILD_MATH_OPT)
#target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAMESPACE}::math_opt_proto)
target_sources(${PROJECT_NAME} PRIVATE
$<TARGET_OBJECTS:${PROJECT_NAMESPACE}::math_opt_proto>)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAMESPACE}::math_opt_proto)
add_subdirectory(ortools/${MATH_OPT_DIR})
target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_math_opt)
endif()
add_subdirectory(ortools/linear_solver/wrappers)
target_sources(${PROJECT_NAME} PRIVATE $<TARGET_OBJECTS:${PROJECT_NAME}_linear_solver_wrappers>)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_linear_solver_wrappers)
@@ -309,6 +351,27 @@ add_subdirectory(ortools/linear_solver/proto_solver)
target_sources(${PROJECT_NAME} PRIVATE $<TARGET_OBJECTS:${PROJECT_NAME}_linear_solver_proto_solver>)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_linear_solver_proto_solver)
# Dependencies
target_link_libraries(${PROJECT_NAME} PUBLIC
${CMAKE_DL_LIBS}
ZLIB::ZLIB
${ABSL_DEPS}
protobuf::libprotobuf
${RE2_DEPS}
${COINOR_DEPS}
$<$<BOOL:${USE_CPLEX}>:CPLEX::CPLEX>
$<$<BOOL:${USE_GLPK}>:GLPK::GLPK>
$<$<BOOL:${USE_HIGHS}>:HIGHS::HIGHS>
${PDLP_DEPS}
$<$<BOOL:${USE_SCIP}>:libscip>
$<$<BOOL:${USE_XPRESS}>:XPRESS::XPRESS>
Threads::Threads)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PUBLIC psapi.lib ws2_32.lib)
endif()
# ALIAS
add_library(${PROJECT_NAMESPACE}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
###############
## Doc rules ##
###############

View File

@@ -29,5 +29,5 @@ target_link_libraries(${NAME} PRIVATE
absl::memory
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::algorithms ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::algorithms ALIAS ${NAME})

View File

@@ -37,5 +37,5 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::base ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::base ALIAS ${NAME})

View File

@@ -28,5 +28,5 @@ target_link_libraries(${NAME} PRIVATE
absl::synchronization
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::bop ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::bop ALIAS ${NAME})

View File

@@ -30,5 +30,5 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::constraint_solver ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::constraint_solver ALIAS ${NAME})

View File

@@ -28,5 +28,5 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::glop ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::glop ALIAS ${NAME})

View File

@@ -32,4 +32,4 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
$<$<BOOL:${USE_GLPK}>:GLPK::GLPK>)
#add_library(${PROJECT_NAME}::glpk ALIAS ${NAME})
#add_library(${PROJECT_NAMESPACE}::glpk ALIAS ${NAME})

View File

@@ -43,6 +43,6 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto
$<$<BOOL:${USE_COINOR}>:Coin::Cbc>)
#add_library(${PROJECT_NAME}::graph ALIAS ${NAME})
#add_library(${PROJECT_NAMESPACE}::graph ALIAS ${NAME})

View File

@@ -34,5 +34,5 @@ target_link_libraries(${NAME} PRIVATE
absl::str_format
protobuf::libprotobuf
$<$<BOOL:${USE_SCIP}>:libscip>
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::gscip ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::gscip ALIAS ${NAME})

View File

@@ -30,6 +30,6 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto
$<$<BOOL:${USE_COINOR}>:Coin::Cbc>)
#add_library(${PROJECT_NAME}::gurobi ALIAS ${NAME})
#add_library(${PROJECT_NAMESPACE}::gurobi ALIAS ${NAME})

View File

@@ -28,5 +28,5 @@ target_link_libraries(${NAME} PRIVATE
absl::flags
absl::strings
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::init ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::init ALIAS ${NAME})

View File

@@ -45,8 +45,8 @@ target_link_libraries(${NAME} PRIVATE
$<$<BOOL:${USE_PDLP}>:Eigen3::Eigen>
$<$<BOOL:${USE_SCIP}>:libscip>
$<$<BOOL:${USE_XPRESS}>:XPRESS::XPRESS>
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::linear_solver ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::linear_solver ALIAS ${NAME})
# solve
add_executable(solve)

View File

@@ -45,8 +45,7 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::status
absl::str_format
protobuf::libprotobuf
$<$<BOOL:${USE_PDLP}>:Eigen3::Eigen>
$<$<BOOL:${USE_SCIP}>:libscip>
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::linear_solver ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::linear_solver_proto_solver ALIAS ${NAME})

View File

@@ -25,7 +25,6 @@ target_include_directories(${NAME} PRIVATE
${PROJECT_BINARY_DIR})
target_link_libraries(${NAME} PRIVATE
absl::status
protobuf::libprotobuf
$<$<BOOL:${USE_SCIP}>:libscip>
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::_linear_solver_wrappers ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::linear_solver_wrappers ALIAS ${NAME})

View File

@@ -29,5 +29,5 @@ target_link_libraries(${NAME} PRIVATE
absl::str_format
protobuf::libprotobuf
${RE2_DEPS}
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::lp_data ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::lp_data ALIAS ${NAME})

View File

@@ -15,39 +15,27 @@ if(NOT BUILD_MATH_OPT)
return()
endif()
file(GLOB_RECURSE _SRCS "*.h" "*.cc")
list(FILTER _SRCS EXCLUDE REGEX "/[^/]*_test\\.cc$")
list(FILTER _SRCS EXCLUDE REGEX "/c_api/.*example")
list(FILTER _SRCS EXCLUDE REGEX "/tools/")
list(FILTER _SRCS EXCLUDE REGEX "/samples/")
if(NOT USE_GLPK)
list(FILTER _SRCS EXCLUDE REGEX "/glpk/")
list(FILTER _SRCS EXCLUDE REGEX "/glpk_.*.h$")
list(FILTER _SRCS EXCLUDE REGEX "/glpk_.*.cc$")
endif()
if(NOT USE_SCIP)
list(FILTER _SRCS EXCLUDE REGEX "/gscip/")
list(FILTER _SRCS EXCLUDE REGEX "/gscip_.*.h$")
list(FILTER _SRCS EXCLUDE REGEX "/gscip_.*.cc$")
endif()
add_subdirectory(core)
add_subdirectory(constraints)
add_subdirectory(cpp)
add_subdirectory(io)
add_subdirectory(labs)
add_subdirectory(solvers)
add_subdirectory(storage)
add_subdirectory(validators)
set(NAME ${PROJECT_NAME}_math_opt)
# Will be merge in libortools.so
#add_library(${NAME} STATIC ${_SRCS})
add_library(${NAME} OBJECT ${_SRCS})
set_target_properties(${NAME} PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
protobuf::libprotobuf
$<$<BOOL:${USE_GLPK}>:GLPK::GLPK>
$<$<BOOL:${USE_SCIP}>:libscip>
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::math_opt ALIAS ${NAME})
add_library(${NAME} OBJECT)
target_sources(${NAME} PUBLIC
$<TARGET_OBJECTS:${NAME}_core>
$<TARGET_OBJECTS:${NAME}_cpp>
$<TARGET_OBJECTS:${NAME}_io>
$<TARGET_OBJECTS:${NAME}_labs>
$<TARGET_OBJECTS:${NAME}_solvers>
$<TARGET_OBJECTS:${NAME}_storage>
$<TARGET_OBJECTS:${NAME}_validators>
)
target_link_libraries(${NAME} INTERFACE
${NAME}_constraints
)
install(TARGETS ${PROJECT_NAME}_math_opt EXPORT ${PROJECT_NAME}Targets)

View File

@@ -0,0 +1,29 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
add_subdirectory(indicator)
add_subdirectory(quadratic)
add_subdirectory(second_order_cone)
add_subdirectory(sos)
add_subdirectory(util)
set(NAME ${PROJECT_NAME}_math_opt_constraints)
add_library(${NAME} OBJECT)
target_sources(${NAME} PUBLIC
$<TARGET_OBJECTS:${NAME}_indicator>
$<TARGET_OBJECTS:${NAME}_quadratic>
$<TARGET_OBJECTS:${NAME}_second_order_cone>
$<TARGET_OBJECTS:${NAME}_sos>
$<TARGET_OBJECTS:${NAME}_util>
)
install(TARGETS ${PROJECT_NAME}_math_opt_constraints EXPORT ${PROJECT_NAME}Targets)

View File

@@ -0,0 +1,26 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_constraints_indicator)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)
#install(TARGETS ${PROJECT_NAME}_math_opt_constraints_indicator EXPORT ${PROJECT_NAME}Targets)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_constraints_quadratic)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_constraints_second_order_cone)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_constraints_sos)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_constraints_util)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,28 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
add_subdirectory(c_api)
file(GLOB _SRCS "*.h" "*.cc")
list(FILTER _SRCS EXCLUDE REGEX "/[^/]*_test\\.cc$")
set(NAME ${PROJECT_NAME}_math_opt_core)
add_library(${NAME} OBJECT ${_SRCS})
target_sources(${NAME} PRIVATE $<TARGET_OBJECTS:${NAME}_c_api>)
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,24 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_core_c_api)
add_library(${NAME} OBJECT)
target_sources(${NAME} PRIVATE solver.h solver.cc)
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_cpp)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_io)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_labs)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,42 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_solvers)
add_library(${NAME} OBJECT)
file(GLOB_RECURSE _SRCS "*.h" "*.cc")
if(NOT USE_GLPK)
list(FILTER _SRCS EXCLUDE REGEX "/glpk/")
list(FILTER _SRCS EXCLUDE REGEX "/glpk_.*.h$")
list(FILTER _SRCS EXCLUDE REGEX "/glpk_.*.cc$")
endif()
if(NOT USE_GUROBI)
list(FILTER _SRCS EXCLUDE REGEX "/gurobi/")
list(FILTER _SRCS EXCLUDE REGEX "/gurobi_.*.h$")
list(FILTER _SRCS EXCLUDE REGEX "/gurobi_.*.cc$")
endif()
if(NOT USE_SCIP)
list(FILTER _SRCS EXCLUDE REGEX "/gscip/")
list(FILTER _SRCS EXCLUDE REGEX "/gscip_.*.h$")
list(FILTER _SRCS EXCLUDE REGEX "/gscip_.*.cc$")
endif()
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
$<$<BOOL:${USE_GLPK}>:GLPK::GLPK>
$<$<BOOL:${USE_SCIP}>:libscip>
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_storage)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -0,0 +1,25 @@
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(NAME ${PROJECT_NAME}_math_opt_validators)
add_library(${NAME} OBJECT)
file(GLOB _SRCS "*.h" "*.cc")
target_sources(${NAME} PRIVATE ${_SRCS})
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
target_link_libraries(${NAME} PRIVATE
absl::strings
${PROJECT_NAMESPACE}::math_opt_proto)

View File

@@ -26,6 +26,5 @@ target_include_directories(${NAME} PRIVATE
target_link_libraries(${NAME} PRIVATE
absl::flags
absl::strings
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::packing ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::packing ALIAS ${NAME})

View File

@@ -35,7 +35,6 @@ target_link_libraries(${NAME} PRIVATE
absl::memory
absl::strings
absl::str_format
protobuf::libprotobuf
Eigen3::Eigen
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::pdlp ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::pdlp ALIAS ${NAME})

View File

@@ -26,5 +26,5 @@ target_include_directories(${NAME} PRIVATE
target_link_libraries(${NAME} PRIVATE
absl::strings
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::port ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::port ALIAS ${NAME})

View File

@@ -36,8 +36,8 @@ target_link_libraries(${NAME} PRIVATE
absl::str_format
protobuf::libprotobuf
$<$<BOOL:${USE_COINOR}>:Coin::Cbc>
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::sat ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::sat ALIAS ${NAME})
# Sat Runner
add_executable(sat_runner)

View File

@@ -26,5 +26,5 @@ target_include_directories(${NAME} PRIVATE
target_link_libraries(${NAME} PRIVATE
absl::strings
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::scheduling ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::scheduling ALIAS ${NAME})

View File

@@ -32,5 +32,5 @@ target_link_libraries(${NAME} PRIVATE
absl::strings
absl::str_format
protobuf::libprotobuf
${PROJECT_NAME}::proto)
#add_library(${PROJECT_NAME}::util ALIAS ${NAME})
${PROJECT_NAMESPACE}::${PROJECT_NAME}_proto)
#add_library(${PROJECT_NAMESPACE}::util ALIAS ${NAME})