Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed CMAKE_CXX_FLAGS to c++17, add target links to Abseil library and c_str() addition when logging #64

Merged
merged 26 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1041cdb
Update CMakeLists.txt
fordth Aug 23, 2023
62498d4
Update CMakeLists.txt
fordth Aug 23, 2023
4ce0fe7
Update gmsa_service.cpp, added c_str() when logging variable values
fordth Aug 23, 2023
9f3f566
Update krb.cpp Added c_str() for logging
fordth Aug 23, 2023
6eedbfe
Update build-using-csc.shchanged dotnet home path to /usr/lib/dotnet
fordth Aug 23, 2023
f9c0e36
Update daemon.cpp
fordth Aug 23, 2023
1050975
Update renewal.cpp Added c_str() for logging
fordth Aug 23, 2023
873b826
Create Dockerfile-ubuntu-20.04
fordth Sep 1, 2023
fcdda82
Create Dockerfile-ubuntu-22.04
fordth Sep 1, 2023
6341757
Update Dockerfile-ubuntu-20.04 Refactored
fordth Sep 3, 2023
7cea583
Update Dockerfile-ubuntu-22.04 Refactored
fordth Sep 3, 2023
3a44eca
Update Dockerfile-ubuntu-22.04
fordth Sep 3, 2023
a90d1bc
Add git ignore
fordth Sep 3, 2023
576e1fa
Conditional compilation for Ubuntu
smhmhmd Sep 4, 2023
3eae651
Merge pull request #1 from smhmhmd/mainline
fordth Sep 4, 2023
9bb232a
Pull in grpc and krb5 compilation into credentials-fetcher
smhmhmd Sep 7, 2023
022b38a
Merge pull request #2 from smhmhmd/mainline
fordth Sep 7, 2023
e951184
Set grpc,krb5 builds to install on default location
smhmhmd Sep 17, 2023
3397f82
Set grpc,krb5 builds to install on default location
smhmhmd Sep 17, 2023
c590d66
Merge branch 'mainline' of https://github.com/smhmhmd/credentials-fet…
smhmhmd Sep 18, 2023
c23ac85
Added -j4 to make instead of -j for parallelism
fordth Sep 19, 2023
f69184e
Merge pull request #4 from fordth/pr
fordth Sep 19, 2023
930d51e
Update Dockerfile-ubuntu-20.04 to clone aws branch
fordth Sep 19, 2023
d9cd971
Update Dockerfile-ubuntu-22.04 to clone aws branch
fordth Sep 19, 2023
de7344c
Updated Docker file to support compiling krb5 and grpc as seperate do…
fordth Sep 20, 2023
84bf3bf
Added required --build-arg TIME_ZONE
ford-th Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build/
**/obj/Debug/
/.vscode/
/auth/**/*.exe
90 changes: 50 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(GNUInstallDirs)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall -Werror -pthread")
set(CMAKE_CXX_FLAGS " -std=c++17 -g -Wall -Werror -pthread")

set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf REQUIRED)
Expand All @@ -14,8 +14,15 @@ set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
set(_REFLECTION gRPC::grpc++_reflection)
find_program(_PROTOBUF_PROTOC protoc)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
file(STRINGS /etc/os-release DISTRO REGEX "^NAME=")
string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" DISTRO "${DISTRO}")

cmake_host_system_information(RESULT PRETTY_NAME QUERY DISTRIB_PRETTY_NAME)
message(STATUS "${PRETTY_NAME}")

cmake_host_system_information(RESULT DISTRO QUERY DISTRIB_INFO)

foreach(VAR IN LISTS DISTRO)
message(STATUS "${VAR}=`${${VAR}}`")
endforeach()

set(CMAKE_VERBOSE_MAKEFILE ON)

Expand Down Expand Up @@ -53,40 +60,40 @@ endif()
configure_file(${CMAKE_SOURCE_DIR}/config/config.h.in
${CMAKE_BINARY_DIR}/config.h @ONLY)

if(DISTRO MATCHES "^(Amazon Linux)$")
file(WRITE scripts/systemd/credentials-fetcher.service
"[Unit]\n"
"Description=credentials-fetcher systemd service unit file.\n\n"
"[Service]\n"
"ExecStartPre=mkdir -p ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chgrp ec2-user /var/credentials-fetcher ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chmod 755 /var/credentials-fetcher ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStart=/usr/sbin/credentials-fetcherd\n"
"ExecStartPost=chgrp ec2-user /var/credentials-fetcher/socket/credentials_fetcher.sock\n"
"ExecStartPost=chmod 660 /var/credentials-fetcher/socket/credentials_fetcher.sock\n"
"Environment=\"CREDENTIALS_FETCHERD_STARTED_BY_SYSTEMD=1\"\n"
"Type=notify\n"
"NotifyAccess=main\n"
"WatchdogSec=5s\n"
"Restart=on-failure\n\n"
"[Install]\n"
"WantedBy=multi-user.target\n"
if((${DISTRO_ID} MATCHES "Amazon Linux") OR (${DISTRO_ID} MATCHES "ubuntu"))
file(WRITE scripts/systemd/credentials-fetcher.service
"[Unit]\n"
"Description=credentials-fetcher systemd service unit file.\n\n"
"[Service]\n"
"ExecStartPre=mkdir -p ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chgrp ec2-user /var/credentials-fetcher ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chmod 755 /var/credentials-fetcher ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStart=/usr/sbin/credentials-fetcherd\n"
"ExecStartPost=chgrp ec2-user /var/credentials-fetcher/socket/credentials_fetcher.sock\n"
"ExecStartPost=chmod 660 /var/credentials-fetcher/socket/credentials_fetcher.sock\n"
"Environment=\"CREDENTIALS_FETCHERD_STARTED_BY_SYSTEMD=1\"\n"
"Type=notify\n"
"NotifyAccess=main\n"
"WatchdogSec=5s\n"
"Restart=on-failure\n\n"
"[Install]\n"
"WantedBy=multi-user.target\n"
)
else()
file(WRITE scripts/systemd/credentials-fetcher.service
"[Unit]\n"
"Description=credentials-fetcher systemd service unit file.\n\n"
"[Service]\n"
"ExecStartPre=mkdir -p ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStart=/usr/sbin/credentials-fetcherd\n"
"Environment=\"CREDENTIALS_FETCHERD_STARTED_BY_SYSTEMD=1\"\n"
"Type=notify\n"
"NotifyAccess=main\n"
"WatchdogSec=5s\n"
"Restart=on-failure\n\n"
"[Install]\n"
"WantedBy=multi-user.target\n"
)
file(WRITE scripts/systemd/credentials-fetcher.service
"[Unit]\n"
"Description=credentials-fetcher systemd service unit file.\n\n"
"[Service]\n"
"ExecStartPre=mkdir -p ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStart=/usr/sbin/credentials-fetcherd\n"
"Environment=\"CREDENTIALS_FETCHERD_STARTED_BY_SYSTEMD=1\"\n"
"Type=notify\n"
"NotifyAccess=main\n"
"WatchdogSec=5s\n"
"Restart=on-failure\n\n"
"[Install]\n"
"WantedBy=multi-user.target\n"
)
endif()

set(sources ${daemon} ${config} ${renewal})
Expand All @@ -104,7 +111,7 @@ if (CMAKE_C_LINK_PIE_SUPPORTED)
endif ()

find_path(GLIB_INCLUDE_DIR glib.h "/usr/include" "/usr/include/glib-2.0")
find_path(GLIB_CONFIG_DIR glibconfig.h "/usr/include" "/usr/lib64/glib-2.0/include")
find_path(GLIB_CONFIG_DIR glibconfig.h "/usr/include" "/usr/lib64/glib-2.0/include" "/usr/lib/x86_64-linux-gnu/glib-2.0/include/")

target_include_directories(credentials-fetcherd
PUBLIC
Expand All @@ -126,15 +133,18 @@ add_custom_command(

target_include_directories(credentials-fetcherd PUBLIC common)

if(${DISTRO_ID} MATCHES "ubuntu")
message(STATUS "Linux distro detected as ubuntu")
target_link_libraries(credentials-fetcherd
PUBLIC systemd boost_program_options krb5 glib-2.0 cf_gmsa_service_private
boost_filesystem boost_system crypto protobuf kadm5srv_mit kdb5 gssrpc gssapi_krb5 gssrpc k5crypto com_err krb5support resolv utf8_validity)
else()
target_link_libraries(credentials-fetcherd
PUBLIC systemd boost_program_options krb5 glib-2.0 cf_gmsa_service_private
boost_filesystem boost_system crypto
kadm5srv_mit kdb5 gssrpc gssapi_krb5 gssrpc k5crypto
com_err krb5support resolv)

target_link_libraries(credentials-fetcherd
fordth marked this conversation as resolved.
Show resolved Hide resolved
PUBLIC
${_REFLECTION} ${_GRPC_GRPCPP} ${_PROTOBUF_LIBPROTOBUF})
endif()

install(FILES ${CMAKE_BINARY_DIR}/credentials-fetcherd
DESTINATION "/usr/sbin/"
Expand Down
20 changes: 18 additions & 2 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ add_library(cf_gmsa_service_private OBJECT
${CMAKE_CURRENT_SOURCE_DIR}/../metadata/tests/metadata_test.cpp)

find_path(GLIB_INCLUDE_DIR glib.h "/usr/include" "/usr/include/glib-2.0")
find_path(GLIB_CONFIG_DIR glibconfig.h "/usr/include" "/usr/lib64/glib-2.0/include")
find_path(GLIB_CONFIG_DIR glibconfig.h "/usr/include" "/usr/lib64/glib-2.0/include" "/usr/lib/x86_64-linux-gnu/glib-2.0/include")

target_include_directories(cf_gmsa_service_private
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../common
Expand All @@ -50,7 +50,22 @@ target_include_directories(cf_gmsa_service_private
${GLIB_CONFIG_DIR}
${CMAKE_BINARY_DIR})

target_link_libraries(cf_gmsa_service_private
cmake_host_system_information(RESULT PRETTY_NAME QUERY DISTRIB_PRETTY_NAME)
cmake_host_system_information(RESULT DISTRO QUERY DISTRIB_INFO)

if(${DISTRO_ID} MATCHES "ubuntu")
message(STATUS "Linux distro detected as ubuntu")
target_link_libraries(cf_gmsa_service_private
-L/usr/local/lib
grpc++_reflection grpc++ protobuf grpc re2 upb_json_lib upb_textformat_lib upb_collections_lib upb utf8_range_lib z absl_statusor cares gpr absl_status absl_strerror absl_flags absl_flags_internal absl_flags_reflection absl_raw_hash_set absl_hash absl_city absl_bad_variant_access absl_low_level_hash absl_hashtablez_sampler absl_flags_config absl_flags_program_name absl_flags_private_handle_accessor absl_flags_commandlineflag absl_flags_commandlineflag_internal absl_flags_marshalling absl_random_distributions absl_random_seed_sequences absl_random_internal_pool_urbg absl_random_internal_randen absl_random_internal_randen_hwaes absl_random_internal_randen_hwaes_impl absl_random_internal_randen_slow absl_random_internal_platform absl_random_internal_seed_material absl_random_seed_gen_exception absl_cord absl_bad_optional_access absl_cordz_info absl_cord_internal absl_cordz_functions absl_exponential_biased absl_cordz_handle absl_crc_cord_state absl_crc32c absl_crc_internal absl_crc_cpu_detect absl_str_format_internal absl_synchronization absl_stacktrace absl_symbolize absl_debugging_internal absl_demangle_internal absl_graphcycles_internal absl_kernel_timeout_internal absl_malloc_internal absl_time absl_strings absl_int128 absl_string_view absl_throw_delegate absl_strings_internal absl_base absl_spinlock_wait -lrt absl_raw_logging_internal absl_log_severity absl_civil_time absl_time_zone ssl crypto address_sorting
systemd
glib-2.0
boost_filesystem
krb5 kadm5srv_mit kdb5 gssapi_krb5 gssrpc
kdb5 gssrpc k5crypto com_err krb5support resolv utf8_validity
absl_log_internal_check_op absl_leak_check absl_die_if_null absl_log_internal_conditions absl_log_internal_message absl_examine_stack absl_log_internal_format absl_log_internal_proto absl_log_internal_nullguard absl_log_internal_log_sink_set absl_log_sink absl_log_entry absl_flags absl_flags_internal absl_flags_marshalling absl_flags_reflection absl_flags_private_handle_accessor absl_flags_commandlineflag absl_flags_commandlineflag_internal absl_flags_config absl_flags_program_name absl_log_initialize absl_log_globals absl_log_internal_globals absl_raw_hash_set absl_hash absl_city absl_low_level_hash absl_hashtablez_sampler absl_statusor absl_status absl_cord absl_cordz_info absl_cord_internal absl_cordz_functions absl_exponential_biased absl_cordz_handle absl_crc_cord_state absl_crc32c absl_crc_internal absl_crc_cpu_detect absl_bad_optional_access absl_str_format_internal absl_strerror absl_synchronization absl_graphcycles_internal absl_kernel_timeout_internal absl_stacktrace absl_symbolize absl_debugging_internal absl_demangle_internal absl_malloc_internal absl_time absl_civil_time absl_time_zone absl_bad_variant_access utf8_validity utf8_range absl_strings absl_string_view absl_strings_internal absl_base rt absl_spinlock_wait absl_int128 absl_throw_delegate absl_raw_logging_internal absl_log_severity)
else()
target_link_libraries(cf_gmsa_service_private
${_PROTOBUF_LIBPROTOBUF}
${_REFLECTION}
${_GRPC_GRPCPP}
Expand All @@ -59,6 +74,7 @@ target_link_libraries(cf_gmsa_service_private
boost_filesystem
krb5 kadm5srv_mit kdb5 gssrpc gssapi_krb5 gssrpc k5crypto
com_err krb5support resolv)
endif()

enable_testing()
add_subdirectory(tests)
10 changes: 5 additions & 5 deletions api/src/gmsa_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class CredentialsFetcherImpl final
cf_logger.logger( LOG_INFO,
"Directory already exists: "
"%s",
krb_file_path );
+ krb_file_path.c_str() );
break;
}
boost::filesystem::create_directories( krb_file_path );
Expand Down Expand Up @@ -230,7 +230,7 @@ class CredentialsFetcherImpl final
else
{
cf_logger.logger( LOG_INFO, "gMSA ticket is at %s",
gmsa_ticket_result.second );
gmsa_ticket_result.second.c_str() );
std::cout << "gMSA ticket is at " << gmsa_ticket_result.second
<< std::endl;
}
Expand Down Expand Up @@ -466,7 +466,7 @@ class CredentialsFetcherImpl final
if ( username.empty() || password.empty() )
{
cf_logger.logger( LOG_ERR, "Invalid credentials for "
"domainless user ");
"domainless user ", username.c_str());
err_msg = "ERROR: Invalid credentials for mainless user";
break;
}
Expand All @@ -487,7 +487,7 @@ class CredentialsFetcherImpl final
cf_logger.logger( LOG_INFO,
"Directory already exists: "
"%s",
krb_file_path );
krb_file_path.c_str() );
break;
}
boost::filesystem::create_directories( krb_file_path );
Expand Down Expand Up @@ -516,7 +516,7 @@ class CredentialsFetcherImpl final
else
{
cf_logger.logger( LOG_INFO, "gMSA ticket is at %s",
gmsa_ticket_result.second );
gmsa_ticket_result.second.c_str() );
std::cout << "gMSA ticket is at " << gmsa_ticket_result.second
<< std::endl;
}
Expand Down
5 changes: 1 addition & 4 deletions api/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ file(

add_executable(gmsa_test_client "gmsa_test_client.cpp")
target_link_libraries(gmsa_test_client
cf_gmsa_service_private
${_PROTOBUF_LIBPROTOBUF}
${_REFLECTION}
${_GRPC_GRPCPP})
cf_gmsa_service_private)

cmake_policy(SET CMP0083 NEW)
include(CheckPIESupported)
Expand Down
1 change: 0 additions & 1 deletion auth/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.10)

project(auth)
add_subdirectory (kerberos)

FILE(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS kerberos/src/*.cpp kerberos/src/*.c kinit_client/*.c)
Expand Down
10 changes: 6 additions & 4 deletions auth/kerberos/src/krb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ std::pair<int, std::string> get_gmsa_krb_ticket( std::string domain_name,
if ( domain_ips.first != 0 )
{
cf_logger.logger( LOG_ERR, "ERROR: Cannot resolve domain IPs of %s", __func__, __LINE__,
domain_name );
domain_name.c_str() );
return std::make_pair( -1, std::string( "" ) );
}

Expand Down Expand Up @@ -666,7 +666,7 @@ std::pair<int, std::string> get_gmsa_krb_ticket( std::string domain_name,
std::string( " -s sub \"(objectClass=msDs-GroupManagedServiceAccount)\" "
" msDS-ManagedPassword" );

cf_logger.logger( LOG_INFO, "%s", cmd );
cf_logger.logger( LOG_INFO, "%s", cmd.c_str() );
std::cout << cmd << std::endl;
std::pair<int, std::string> ldap_search_result = exec_shell_cmd( cmd );
if ( ldap_search_result.first != 0 )
Expand Down Expand Up @@ -846,11 +846,13 @@ std::list<std::string> renew_kerberos_tickets_domainless(std::string krb_files_d
cf_logger.logger( LOG_WARNING,
"WARNING: Cannot get gMSA krb ticket "
"because of expired user/machine ticket, "
"will be retried automatically" );
"will be retried automatically, service_account_name = %s",
krb_ticket->service_account_name.c_str() );
}
else
{
cf_logger.logger( LOG_ERR, "ERROR: Cannot get gMSA krb ticket" );
cf_logger.logger( LOG_ERR, "ERROR: Cannot get gMSA krb ticket using account %s",
krb_ticket->service_account_name.c_str() );
}
// if tickets are created in domainless mode
std::string domainless_user = krb_ticket->domainless_user;
Expand Down
19 changes: 17 additions & 2 deletions auth/kerberos/src/utf16_decode/build-using-csc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,29 @@ sdkver=$(LC_ALL=C dotnet --version)
fwkver=$(LC_ALL=C dotnet --list-runtimes | \
LC_ALL=C sed --posix -n '/^Microsoft.NETCore.App \([^ ]*\) .*$/{s//\1/p;q;}')

# dotnet-sdk-5.0 installed via .deb package
dotnethome=/usr/lib64/dotnet
dotnethome=/usr/lib/dotnet
if [ -d /usr/lib64/dotnet ]; then
dotnethome=/usr/lib64/dotnet
fi
echo "dotnethome=$dotnethome"

dotnetlib=$dotnethome/shared/Microsoft.NETCore.App/$fwkver
if [ -d /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/$fwkver/ref/net6.0/ ]; then
dotnetlib=/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/$fwkver/ref/net6.0/
fi
echo "dotnetlib=$dotnetlib"

dotnet_cscdll=$dotnethome/sdk/$sdkver/Roslyn/bincore/csc.dll
if [ -f /usr/share/dotnet/sdk/$sdkver/Roslyn/bincore/csc.dll ]; then
dotnet_cscdll=/usr/share/dotnet/sdk/$sdkver/Roslyn/bincore/csc.dll
fi
echo "dotnet_cscdll=$dotnet_cscdll"

dotnet_csclib='-r:netstandard.dll -r:Microsoft.CSharp.dll -r:System.dll'
for x in "$dotnetlib"/System.*.dll; do
dotnet_csclib="$dotnet_csclib -r:${x##*/}"
done
echo "dotnet_csclib=$dotnet_csclib"
# add if needed
#dotnet_csclib="$dotnet_csclib -r:Microsoft.Win32.Primitives.dll"

Expand Down
2 changes: 0 additions & 2 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.10)

project(common)

cmake_minimum_required(VERSION 2.8)
2 changes: 0 additions & 2 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.10)

project(config)

FILE(GLOB SRC_FILES src/*.cpp)

set(config "${SRC_FILES}" PARENT_SCOPE)
Expand Down
2 changes: 0 additions & 2 deletions daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.10)

project(daemon)

FILE(GLOB SRC_FILES src/*.cpp)

set(daemon "${SRC_FILES}" PARENT_SCOPE)
Expand Down
1 change: 0 additions & 1 deletion daemon/src/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ std::pair<int, void*> create_pthread( void* ( *func )(void*), const char* pthrea
pthread_attr_t attr;
int status;
const int num_threads = 1;
std::pair<int, void*> result;

if ( func == nullptr || pthread_arg == nullptr )
{
Expand Down
21 changes: 21 additions & 0 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.10)

project(build_binaries)

add_custom_target(build_krb5)
add_custom_command(TARGET build_krb5
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND rm -rf ${CMAKE_BINARY_DIR}/krb5
COMMAND git clone https://github.com/krb5/krb5.git -b krb5-1.21.2-final
COMMAND cd krb5/src && autoreconf && ./configure && make -j && sudo make install
COMMENT "Compiling krb5-1.21.2-final"
VERBATIM)

add_custom_target(build_grpc)
add_custom_command(TARGET build_grpc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND rm -rf ${CMAKE_BINARY_DIR}/grpc
COMMAND git clone --recurse-submodules -b v1.58.0 https://github.com/grpc/grpc
COMMAND cd grpc && mkdir -p build && cd build && cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_CXX_STANDARD=17 ../ && make -j && sudo make install
COMMENT "Compiling grpc-v1.58"
VERBATIM)
Loading