File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212# limitations under the License.
1313
1414file (GLOB _SRCS "*.h" "*.cc" )
15+ list (FILTER _SRCS EXCLUDE REGEX ".*/.*_test.cc" )
1516set (NAME ${PROJECT_NAME} _glop)
1617
1718# Will be merge in libortools.so
@@ -30,3 +31,22 @@ target_link_libraries(${NAME} PRIVATE
3031 protobuf::libprotobuf
3132 ${PROJECT_NAMESPACE} ::ortools_proto )
3233#add_library(${PROJECT_NAMESPACE}::glop ALIAS ${NAME})
34+
35+ if (BUILD_TESTING)
36+ # Test
37+ file (GLOB _TEST_SRCS "*_test.cc" )
38+ foreach (_FULL_FILE_NAME IN LISTS _TEST_SRCS)
39+ get_filename_component (_NAME ${_FULL_FILE_NAME} NAME_WE )
40+ get_filename_component (_FILE_NAME ${_FULL_FILE_NAME} NAME )
41+ ortools_cxx_test (
42+ NAME
43+ glop_${_NAME}
44+ SOURCES
45+ ${_FILE_NAME}
46+ LINK_LIBRARIES
47+ GTest::gtest
48+ GTest::gtest_main
49+ GTest::gmock
50+ )
51+ endforeach ()
52+ endif ()
You can’t perform that action at this time.
0 commit comments