Skip to content

Commit

Permalink
Ignore CppMicroServices tests
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Claudino <[email protected]>
  • Loading branch information
danclaudino committed Jun 14, 2024
1 parent d669437 commit 4094ee5
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tpls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,37 @@ endif()
add_compile_flags_if_supported(-Wno-deprecated-copy)
add_subdirectory(cppmicroservices)

set(TEST_FILE "${CMAKE_SOURCE_DIR}/tpls/cppmicroservices/tools/jsonschemavalidator/CMakeLists.txt")
set(INSERT_LINE 18) # The line number to insert the string at (1-based index)
set(INSERT_STRING "if(US_BUILD_TESTING)")

if(EXISTS ${TEST_FILE})
message(STATUS "File exists: ${TEST_FILE}")

# Read all lines from the file into a list
file(READ ${TEST_FILE} FILE_CONTENTS)
string(FIND "${FILE_CONTENTS}" "${INSERT_STRING}" POSITION)

if(POSITION EQUAL -1)
string(REPLACE "\n" ";" FILE_LINES ${FILE_CONTENTS})

# Insert the new string at the specified line
list(INSERT FILE_LINES ${INSERT_LINE} "${INSERT_STRING}")

# Join the lines back into a single string with newlines
string(REPLACE ";" "\n" NEW_FILE_CONTENTS "${FILE_LINES}")

# Write the modified contents back to the file
file(WRITE ${TEST_FILE} "${NEW_FILE_CONTENTS}")
file(APPEND ${TEST_FILE} "endif()\n")
endif()
#message(STATUS "Finished modifying the file: ${MY_FILE}")
else()
message(STATUS "File does not exist: ${MY_FILE}")
endif()

# Fix for bug #161
install(FILES "${CMAKE_BINARY_DIR}/tpls/cppmicroservices/CMakeFiles/Export/share/cppmicroservices4/cmake/CppMicroServicesTargets-release.cmake" DESTINATION share/cppmicroservices4/cmake OPTIONAL)
#install(FILES "${CMAKE_BINARY_DIR}/tpls/cppmicroservices/CMakeFiles/Export/share/cppmicroservices4/cmake/CppMicroServicesTargets-release.cmake" DESTINATION share/cppmicroservices4/cmake OPTIONAL)

if (XACC_DEPS_EXTERNAL)
find_package(cpr)
Expand Down

0 comments on commit 4094ee5

Please sign in to comment.