-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
36 changed files
with
634 additions
and
213 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
25 changes: 25 additions & 0 deletions
25
ortools/math_opt/constraints/second_order_cone/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Oops, something went wrong.
d8634ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix #3909