Skip to content

Commit

Permalink
Fix CMake build in test subdirectories
Browse files Browse the repository at this point in the history
Due to the regexes, ortools_pdlp fails to build if any of its parent
directories starts with `test` or `gtest`:

    CMake Error at test/ortools-src/ortools/pdlp/CMakeLists.txt:27 (add_library):
      No SOURCES given to target: ortools_pdlp
  • Loading branch information
lnikkila authored and Mizux committed Jul 5, 2023
1 parent 56a0211 commit ab9b9a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ortools/pdlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ if(NOT USE_PDLP)
endif()

file(GLOB _SRCS "*.h" "*.cc")
list(FILTER _SRCS EXCLUDE REGEX ".*/.*_test.cc")
list(FILTER _SRCS EXCLUDE REGEX ".*/gtest.*")
list(FILTER _SRCS EXCLUDE REGEX ".*/test.*")
list(FILTER _SRCS EXCLUDE REGEX "/[^/]*_test\\.cc$")
list(FILTER _SRCS EXCLUDE REGEX "/gtest[^/]*$")
list(FILTER _SRCS EXCLUDE REGEX "/test[^/]*$")

set(NAME ${PROJECT_NAME}_pdlp)

Expand Down

0 comments on commit ab9b9a0

Please sign in to comment.