I'm trying to build the specialized Youtube API, which is included in the standard distribution of the google-api-cpp-client library. The documentation states:
If you download the C++ libraries and unzip them into the
service_apis
directory at the root of the source installation for this SDK then the default build scripts will automatically build them.
However, the build scripts do not. Building the samples which are included in the distribution reveals this quite clearly.
Linking CXX executable ../../bin/calendar_sample
ld: library not found for -lgoogle_calendar_api
The tail of the root CMakeLists.txt
reads as follows:
add_subdirectory(src)
if (googleapis_build_samples)
set(googleapis_build_service_apis true) # force on
endif()
if (googleapis_build_service_apis)
add_subdirectory(service_apis)
endif()
# Build samples after the service apis
# but keep them under src
if (googleapis_build_samples)
add_subdirectory(src/samples)
endif()
Which eventually leads to this CMakeLists.txt (in the root of the service_apis directory):
file(GLOB all_valid_subdirs RELATIVE
${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
foreach(dir ${all_valid_subdirs})
message(STATUS "path = ${dir}")
if(${dir} MATCHES "^([^/]*)//CMakeLists.txt")
string(REGEX REPLACE
"^([^/]*)//CMakeLists.txt" "\\1" dir_trimmed ${dir})
add_subdirectory(${dir_trimmed})
endif()
endforeach(dir)
I've put a message
output inside the if statement. It seems the add_subdirectory
call is never reached. The foreach
does iterate through all the subdirectories though.
Why does the regex comparison fail?