Added config.h.in file
cmake generates a config file. It currently just shows the version. rhosts now prints the version at startstable
parent
f12ec08a46
commit
3ce1982af6
|
|
@ -2,5 +2,7 @@ cmake_minimum_required(VERSION 3.10)
|
||||||
project(rhosts VERSION 0.0.0 LANGUAGES C)
|
project(rhosts VERSION 0.0.0 LANGUAGES C)
|
||||||
message(" C: '${CMAKE_C_COMPILER}'")
|
message(" C: '${CMAKE_C_COMPILER}'")
|
||||||
include_directories(${PROJECT_SOURCE_DIR})
|
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_link_libraries(rhosts curl)
|
||||||
|
target_include_directories(rhosts PUBLIC "${PROJECT_BINARY_DIR}")
|
||||||
|
configure_file(src/rhostsConfig.h.in config.h)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ int main(int argc, char *argv[]){
|
||||||
struct entry *entries;
|
struct entry *entries;
|
||||||
int rc =0;
|
int rc =0;
|
||||||
|
|
||||||
|
printf("version: %s\n",rhosts_VERSION);
|
||||||
|
|
||||||
rc = parse_config(&entries);
|
rc = parse_config(&entries);
|
||||||
if (rc != 0){
|
if (rc != 0){
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@
|
||||||
#ifndef RHOSTS_HEADER
|
#ifndef RHOSTS_HEADER
|
||||||
#define RHOSTS_HEADER
|
#define RHOSTS_HEADER
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
// the configured options and settings for Tutorial
|
||||||
|
#define rhosts_VERSION "@rhosts_VERSION@"
|
||||||
Loading…
Reference in New Issue