Add partial examples building scripts
Add pre and post CMake building scripts
This commit is contained in:
1
examples/CMakeLists.txt
Normal file
1
examples/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(list_pod)
|
||||
8
examples/list_pod/CMakeLists.txt
Normal file
8
examples/list_pod/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
add_executable(list_pod main.c)
|
||||
|
||||
target_link_libraries(list_pod PRIVATE ${pkgName})
|
||||
target_include_directories(list_pod PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/config
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/api
|
||||
)
|
||||
@@ -1,9 +1,7 @@
|
||||
#include <kube_config.h>
|
||||
#include <apiClient.h>
|
||||
#include <CoreV1API.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
void list_pod(apiClient_t * apiClient)
|
||||
{
|
||||
@@ -35,7 +33,7 @@ void list_pod(apiClient_t * apiClient)
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main()
|
||||
{
|
||||
char *basePath = NULL;
|
||||
sslConfig_t *sslConfig = NULL;
|
||||
|
||||
9
kubernetes/PostTarget.cmake
Normal file
9
kubernetes/PostTarget.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
target_link_libraries(${pkgName} yaml websockets)
|
||||
set_target_properties(${pkgName} PROPERTIES LINKER_LANGUAGE C)
|
||||
|
||||
option(BUILD_EXAMPLES "Build examples" OFF)
|
||||
|
||||
if(BUILD_EXAMPLES)
|
||||
message("Include examples")
|
||||
add_subdirectory(../examples examples)
|
||||
endif()
|
||||
31
kubernetes/PreTarget.cmake
Normal file
31
kubernetes/PreTarget.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
list(APPEND SRCS
|
||||
config/kube_config_model.c
|
||||
config/kube_config_yaml.c
|
||||
config/kube_config_util.c
|
||||
config/kube_config.c
|
||||
config/incluster_config.c
|
||||
config/exec_provider.c
|
||||
config/authn_plugin/authn_plugin_util.c
|
||||
config/authn_plugin/authn_plugin.c
|
||||
watch/watch_util.c
|
||||
websocket/wsclient.c
|
||||
websocket/kube_exec.c
|
||||
src/generic.c)
|
||||
|
||||
list(APPEND HDRS
|
||||
config/kube_config_common.h
|
||||
config/kube_config_model.h
|
||||
config/kube_config_yaml.h
|
||||
config/kube_config_util.h
|
||||
config/kube_config.h
|
||||
config/incluster_config.h
|
||||
config/exec_provider.h
|
||||
config/authn_plugin/authn_plugin_util.h
|
||||
config/authn_plugin/authn_plugin.h
|
||||
watch/watch_util.h
|
||||
websocket/wsclient.h
|
||||
websocket/kube_exec.h
|
||||
include/generic.h)
|
||||
|
||||
find_package(libwebsockets REQUIRED)
|
||||
find_package(yaml CONFIG REQUIRED)
|
||||
Reference in New Issue
Block a user