diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b45ac9..bd00a68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,5 +2,7 @@ cmake_minimum_required(VERSION 3.10) project(rhosts VERSION 0.0.0 LANGUAGES C) message(" C: '${CMAKE_C_COMPILER}'") include_directories(${PROJECT_SOURCE_DIR}) -add_executable(rhosts src/rhosts.c src/rhosts.h src/download.h src/download.c) +add_executable(rhosts src/rhosts.c src/download.c) target_link_libraries(rhosts curl) +target_include_directories(rhosts PUBLIC "${PROJECT_BINARY_DIR}") +configure_file(src/rhostsConfig.h.in config.h) diff --git a/src/rhosts.c b/src/rhosts.c index 2a28c68..8df8493 100644 --- a/src/rhosts.c +++ b/src/rhosts.c @@ -27,6 +27,7 @@ int main(int argc, char *argv[]){ struct entry *entries; int rc =0; + printf("version: %s\n",rhosts_VERSION); rc = parse_config(&entries); if (rc != 0){ diff --git a/src/rhosts.h b/src/rhosts.h index 2863bac..cae96a8 100644 --- a/src/rhosts.h +++ b/src/rhosts.h @@ -21,6 +21,8 @@ #ifndef RHOSTS_HEADER #define RHOSTS_HEADER +#include "config.h" + #include #include #include diff --git a/src/rhostsConfig.h.in b/src/rhostsConfig.h.in new file mode 100644 index 0000000..acae99a --- /dev/null +++ b/src/rhostsConfig.h.in @@ -0,0 +1,2 @@ +// the configured options and settings for Tutorial +#define rhosts_VERSION "@rhosts_VERSION@"