Switch to CMake ...
This commit is contained in:
parent
77b0d85a51
commit
1ac5203e38
16 changed files with 143 additions and 10 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -1,2 +1,10 @@
|
|||
#Ignore folder
|
||||
Untracked
|
||||
CMakeFiles
|
||||
*.swp
|
||||
Makefile
|
||||
*.a
|
||||
cmake_install.cmake
|
||||
src/forgetIt
|
||||
CMakeCache.txt
|
||||
clearCMake.sh
|
||||
|
|
13
CMakeLists.txt
Normal file
13
CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
project(forgetIt)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
|
||||
set(VERSION_MAJOR 0)
|
||||
set(VERSION_MINOR 1)
|
||||
set(VERSION_REV 0)
|
||||
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}")
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
|
@ -8,5 +8,10 @@ Pour cela **forgetIt** utilise des algorithmes de cryptages ayant fait leurs pre
|
|||
L'analyse des fichiers une fois décryptés, s'organisera autour de la librairie *libxml++*.<br />
|
||||
La conception d'une interface graphique est prévue, et sera basé sur la bibliothèque *GTK+*.<br />
|
||||
|
||||
##Programmer Zone
|
||||
|
||||
> Please read **Readme.md** in src folder.
|
||||
|
||||
|
||||
##Suite en construction...
|
||||
|
||||
|
|
25
cmake/Modules/FindGTK3.cmake
Normal file
25
cmake/Modules/FindGTK3.cmake
Normal file
|
@ -0,0 +1,25 @@
|
|||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_GTK3 QUIET gtk+-3.0)
|
||||
|
||||
set(GTK3_DEFINITIONS ${PC_GTK3_CFLAGS_OTHER})
|
||||
|
||||
|
||||
find_path(GTK3_INCLUDE_DIR
|
||||
NAMES gtk/gtk.h
|
||||
PATHS ${PC_GTK3_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
##message(${PC_GTK3_INCLUDE_DIRS})
|
||||
|
||||
|
||||
find_library(GTK3_LIBRARY NAMES gtk-3
|
||||
HINTS ${PC_GTK3_LIBDIR} ${PC_GTK3_LIBRARY_DIRS} )
|
||||
|
||||
set(GTK3_LIBRARIES ${GTK3_LIBRARY} )
|
||||
set(GTK3_INCLUDE_DIRS ${GTK3_INCLUDE_DIR} ${PC_GTK3_INCLUDE_DIRS} )
|
||||
|
||||
find_package_handle_standard_args(GTK3 DEFAULT_MSG
|
||||
GTK3_LIBRARY GTK3_INCLUDE_DIR)
|
||||
|
||||
##mark_as_advanced(GTK3_INCLUDE_DIR GTK3_LIBRARY )
|
37
cmake/Modules/FindLibXML++.cmake
Normal file
37
cmake/Modules/FindLibXML++.cmake
Normal file
|
@ -0,0 +1,37 @@
|
|||
# find libxml++
|
||||
#
|
||||
# exports:
|
||||
#
|
||||
# LibXML++_FOUND
|
||||
# LibXML++_INCLUDE_DIRS
|
||||
# LibXML++_LIBRARIES
|
||||
#
|
||||
include(FindPkgConfig)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# Use pkg-config to get hints about paths
|
||||
pkg_check_modules(LibXML++_PKGCONF REQUIRED libxml++-2.6)
|
||||
# Include dir
|
||||
find_path(LibXML++_INCLUDE_DIR
|
||||
NAMES libxml++/libxml++.h
|
||||
PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Finally the library itself
|
||||
find_library(LibXML++_LIBRARY
|
||||
NAMES xml++ xml++-2.6
|
||||
PATHS ${LibXML++_PKGCONF_LIBRARY_DIRS}
|
||||
)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXML++ DEFAULT_MSG LibXML++_LIBRARY LibXML++_INCLUDE_DIR)
|
||||
if(LibXML++_PKGCONF_FOUND)
|
||||
set(LibXML++_LIBRARIES ${LibXML++_LIBRARY} ${LibXML++_PKGCONF_LIBRARIES})
|
||||
set(LibXML++_INCLUDE_DIRS ${LibXML++_INCLUDE_DIR} ${LibXML++_PKGCONF_INCLUDE_DIRS})
|
||||
set(LibXML++_FOUND yes)
|
||||
else()
|
||||
set(LibXML++_LIBRARIES)
|
||||
set(LibXML++_INCLUDE_DIRS)
|
||||
set(LibXML++_FOUND no)
|
||||
endif()
|
||||
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
#set(LibXML++_PROCESS_INCLUDES LibXML++_INCLUDE_DIR)
|
||||
#set(LibXML++_PROCESS_LIBS LibXML++_LIBRARY)
|
21
src/CMakeLists.txt
Normal file
21
src/CMakeLists.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
add_executable(
|
||||
forgetIt
|
||||
./main.cpp
|
||||
)
|
||||
|
||||
find_package(LibXML++ REQUIRED)
|
||||
find_package(GTK3 REQUIRED)
|
||||
|
||||
include_directories(${LibXML++_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS})
|
||||
target_link_libraries(forgetIt ${LibXML++_LIBRARIES} ${GTK3_LIBRARIES})
|
||||
|
||||
set_property(GLOBAL PROPERTY LibXML++_INCLUDE_DIRS "${LibXML++_INCLUDE_DIRS}")
|
||||
set_property(GLOBAL PROPERTY LibXML++_LIBRARIES "${LibXML++_LIBRARIES}")
|
||||
|
||||
|
||||
add_subdirectory(./CryptClass/)
|
||||
add_subdirectory(./IOFileClass/)
|
||||
add_subdirectory(./ParserClass/)
|
||||
|
||||
|
||||
|
1
src/CryptClass/CMakeLists.txt
Normal file
1
src/CryptClass/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
add_library(CryptClass ./AESCrypt.cpp ./HASHCrypt.cpp)
|
1
src/IOFileClass/CMakeLists.txt
Normal file
1
src/IOFileClass/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
add_library(IOFileClass ./FileManIOFile.cpp)
|
|
@ -35,7 +35,7 @@ void FileManIOFile::read(std::string key){
|
|||
this->data.clear();
|
||||
|
||||
//Open file
|
||||
file.open (this->filename, std::ios::in | std::ios::binary);
|
||||
file.open ((this->filename).c_str(), std::ios::in | std::ios::binary);
|
||||
|
||||
//Get MD5 of decrypted data
|
||||
byte fileMD5[16];
|
||||
|
@ -124,7 +124,7 @@ void FileManIOFile::writeRoutine(std::string data, std::string dataEncrypted){
|
|||
std::ofstream file;
|
||||
|
||||
//Open it
|
||||
file.open(this->filename, std::ios::out | std::ios::binary);
|
||||
file.open((this->filename).c_str(), std::ios::out | std::ios::binary);
|
||||
|
||||
//Write MD5 on 16 first bytes
|
||||
file.write((char *) digest,sizeof(digest));
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
|
||||
//----- class -----
|
||||
#include "HASHCrypt.hpp"
|
||||
#include "AESCrypt.hpp"
|
||||
#include "../CryptClass/HASHCrypt.hpp"
|
||||
#include "../CryptClass/AESCrypt.hpp"
|
||||
|
||||
|
||||
|
||||
|
|
14
src/ParserClass/CMakeLists.txt
Normal file
14
src/ParserClass/CMakeLists.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
add_library(ParserClass ./AbstractIDManager.cpp ./FileManParser.cpp)
|
||||
|
||||
|
||||
get_property(LibXML++_INCLUDE_DIRS GLOBAL PROPERTY LibXML++_INCLUDE_DIRS)
|
||||
|
||||
|
||||
|
||||
|
||||
target_link_libraries(ParserClass ${LibXML++_LIBRARIES})
|
||||
|
||||
|
||||
|
||||
|
||||
add_subdirectory(./FileManContainer/)
|
1
src/ParserClass/FileManContainer/CMakeLists.txt
Normal file
1
src/ParserClass/FileManContainer/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
add_library(FileManContainer ./Website.cpp)
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <string>
|
||||
#include "AbstractIDManager.hpp"
|
||||
#include "../AbstractIDManager.hpp"
|
||||
|
||||
/**
|
||||
* @class Website Website.hpp "/ParserClass/FileManContainer/Website.hpp"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <vector>
|
||||
|
||||
//----- class -----
|
||||
#include "Website.hpp"
|
||||
#include "./FileManContainer/Website.hpp"
|
||||
|
||||
//----- libxml++ -----
|
||||
#include <cstdlib>
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
Build System
|
||||
=====
|
||||
|
||||
##CMake (v3.0.2)
|
||||
|
||||
<br />
|
||||
|
||||
Library Versions
|
||||
=====
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
|
||||
//----- class -----
|
||||
#include "FileManIOFile.hpp"
|
||||
#include "FileManParser.hpp"
|
||||
#include "Website.hpp"
|
||||
#include "./IOFileClass/FileManIOFile.hpp"
|
||||
#include "./ParserClass/FileManParser.hpp"
|
||||
#include "./ParserClass/FileManContainer/Website.hpp"
|
||||
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
@ -53,7 +53,7 @@ int main(int argc, char *argv[]){
|
|||
|
||||
GtkWidget* bouton;
|
||||
|
||||
bouton=gtk_button_new_with_label("Hello Bro :");
|
||||
bouton=gtk_button_new_with_label("Hello !");
|
||||
gtk_container_add(GTK_CONTAINER(MainWindow), bouton);
|
||||
|
||||
g_signal_connect(G_OBJECT(bouton), "leave", G_CALLBACK(gtk_main_quit), NULL);
|
||||
|
|
Loading…
Add table
Reference in a new issue