routing/parsers to cmake

This commit is contained in:
Laurent Perron
2025-03-21 05:44:01 -07:00
parent f0c50e6597
commit 0d40043e4c
2 changed files with 40 additions and 0 deletions

View File

@@ -562,6 +562,10 @@ 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)
add_subdirectory(ortools/routing/parsers)
target_sources(${PROJECT_NAME} PRIVATE $<TARGET_OBJECTS:${PROJECT_NAME}_routing_parsers>)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_routing_parsers)
# Dependencies
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES

View File

@@ -0,0 +1,36 @@
# Copyright 2010-2025 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.
file(GLOB _SRCS "*.h" "*.cc")
list(FILTER _SRCS EXCLUDE REGEX ".*/.*_test.cc")
set(NAME ${PROJECT_NAME}_routing_parsers)
# 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::memory
absl::strings
absl::status
absl::str_format
protobuf::libprotobuf
${RE2_DEPS}
${PROJECT_NAMESPACE}::ortools_proto)
#add_library(${PROJECT_NAMESPACE}::routing_parsers ALIAS ${NAME})