aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: af2280619840fa65bc9c7ea408c23896ca370875 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.0)
project(multihome C)
include(CheckSymbolExists)
include(CheckCSourceCompiles)

set(CMAKE_C_STANDARD 99)

include_directories("${CMAKE_CURRENT_BINARY_DIR}")

check_symbol_exists(basename "libgen.h" HAVE_BASENAME)
check_symbol_exists(dirname "libgen.h" HAVE_DIRNAME)
check_symbol_exists(getpwuid "pwd.h" HAVE_GETPWUID)
check_symbol_exists(geteuid "unistd.h" HAVE_GETEUID)

check_c_source_compiles(
    "
    #include <argp.h>
    int main(int argc, char *argv[]) {
        struct argp_option option[1];
    }
    "
    HAVE_ARGP
)

find_program(RSYNC_BIN
        NAMES rsync
        REQUIRED)

configure_file("config.h.in" "config.h" @ONLY)

add_executable(multihome
        multihome.c)

install(TARGETS multihome
        RUNTIME DESTINATION bin)