ADD: moved to CMAKE

This commit is contained in:
Dominik Meyer 2019-08-01 18:13:05 +02:00
parent 64703c4c6b
commit 7809e6416b
No known key found for this signature in database
GPG Key ID: B4C312B600606B64
10 changed files with 52 additions and 30 deletions

2
.gitignore vendored
View File

@ -23,4 +23,4 @@ missing
Makefile.in
**/*~
config.h
config.h.in
build

32
CMakeLists.txt Normal file
View File

@ -0,0 +1,32 @@
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
project (moolticute-pass VERSION 0.1.0 LANGUAGES C)
include(GNUInstallDirs)
include(CTest)
enable_testing()
option(DOXYGEN "Also build the doxygen documentation" OFF)
find_package(Git)
find_package(Moolticute REQUIRED)
configure_file(${PROJECT_SOURCE_DIR}/src/config.h.in ${PROJECT_SOURCE_DIR}/src/config.h @ONLY)
add_executable(moolticute-pass
yaap/src/argparse.h
yaap/src/argparse.c
src/commands.h
src/get.c
src/info.c
src/ls.c
#src/x11_clipboard.c
#src/x11_clipboard.h
src/main.c
)
target_link_libraries(moolticute-pass moolticute)
target_include_directories(moolticute-pass
PRIVATE
src
)

View File

@ -1,15 +0,0 @@
SUBDIRS = libmoolticute-c
bin_PROGRAMS=mpass
mpass_SOURCES = src/get.c
mpass_SOURCES += yaap/src/argparse.c
mpass_SOURCES += src/main.c
mpass_SOURCES += src/ls.c
mpass_SOURCES += src/info.c
if HAVE_X11
mpass_SOURCES+=src/x11_clipboard.c
endif
mpass_LDADD = libmoolticute-c/libmoolticute.a

View File

@ -1,7 +0,0 @@
#! /bin/sh
(cd libmoolticute-c;./bootstrap.sh) \
&& aclocal \
&& libtoolize \
&& autoheader \
&& automake --gnu --add-missing \
&& autoconf

12
src/config.h.in Normal file
View File

@ -0,0 +1,12 @@
#ifndef __CONFIG_HPP__
#define __CONFIG_HPP__
#define PROJECT_NAME @PROJECT_NAME@
#define VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define VERSION_MINOR @PROJECT_VERSION_MINOR@
#define VERSION_PATCH @PROJECT_VERSION_PATCH@
#define PROJECT_VERSION "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@"
#endif

View File

@ -23,10 +23,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Dominik Meyer <dmeyer@federationhq.de>
* @copyright 2018 by Dominik Meyer
*/
#include "../libmoolticute-c/src/moolticute.h"
#include <moolticute.h>
#include "../yaap/src/argparse.h"
#include "x11_clipboard.h"
#include "../config.h"
#include <x11_clipboard.h>
#include <config.h>
/**
* @brief get the password of a services and login

View File

@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Dominik Meyer <dmeyer@federationhq.de>
* @copyright 2018 by Dominik Meyer
*/
#include "../libmoolticute-c/src/moolticute.h"
#include <moolticute.h>
/**
* @brief show infos about the mooltipass device

View File

@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Dominik Meyer <dmeyer@federationhq.de>
* @copyright 2018 by Dominik Meyer
*/
#include "../libmoolticute-c/src/moolticute.h"
#include <moolticute.h>
#include "../yaap/src/argparse.h"
/**

View File

@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include "commands.h"
#include <commands.h>
#include "../yaap/src/argparse.h"
/**

View File

@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Dominik Meyer <dmeyer@federationhq.de>
* @copyright 2018 by Dominik Meyer
*/
#include "x11_clipboard.h"
#include <x11_clipboard.h>
#include <X11/Xutil.h>
#include <stdlib.h>
#include <stdio.h>