[DEV] develop got GOLD

This commit is contained in:
Edouard DUPIN 2021-10-05 21:02:19 +02:00
parent f2454bd4aa
commit 9bf5d63869
11 changed files with 136 additions and 118 deletions

View File

@ -19,10 +19,10 @@ def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
return "../authors.txt"
def get_version():
return "version.txt"
return "../version.txt"
def configure(target, my_module):
my_module.add_extra_flags()

View File

@ -148,10 +148,7 @@ install(TARGETS ${LIBRARY_NAME222}_dynamic EXPORT ${LIBRARY_NAME222}Targets
)
install(TARGETS ${LIBRARY_NAME222}_static
RUNTIME DESTINATION lib)
#install(TARGETS ${LIBRARY_NAME222} EXPORT ${LIBRARY_NAME222}Targets
# LIBRARY DESTINATION lib
@ -176,36 +173,58 @@ endforeach()
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}ConfigVersion.cmake"
VERSION ${LIBRARY_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT ${LIBRARY_NAME222}Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}Targets.cmake"
NAMESPACE Upstream::
)
#configure_file(cmake/${LIBRARY_NAME222}Config.cmake
# "${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}Config.cmake"
# COPYONLY
#write_basic_package_version_file(
# "${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}ConfigVersion.cmake"
# VERSION ${LIBRARY_VERSION}
# COMPATIBILITY AnyNewerVersion
#)
#
#export(EXPORT ${LIBRARY_NAME222}Targets
# FILE "${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}Targets.cmake"
# NAMESPACE Upstream::
#)
##configure_file(cmake/${LIBRARY_NAME222}Config.cmake
## "${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}Config.cmake"
## COPYONLY
##)
set(ConfigPackageLocation cmake/${LIBRARY_NAME222})
set(CONFIG_PACKAGE_LOCATION cmake/${LIBRARY_NAME222})
install(EXPORT ${LIBRARY_NAME222}Targets
FILE
${LIBRARY_NAME222}Targets.cmake
NAMESPACE
Upstream::
${LIBRARY_NAME222}::
DESTINATION
${ConfigPackageLocation}
${CONFIG_PACKAGE_LOCATION}
)
#install(
# FILES
# cmake/${LIBRARY_NAME222}Config.cmake
# "${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME222}/${LIBRARY_NAME222}ConfigVersion.cmake"
# DESTINATION
# ${ConfigPackageLocation}
# ${CONFIG_PACKAGE_LOCATION}
# COMPONENT
# Devel
#)
message("CMAKE_INSTALL_LIBDIR===${CMAKE_INSTALL_LIBDIR}")
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/${LIBRARY_NAME222}Config.cmake.in
"${PROJECT_BINARY_DIR}/${LIBRARY_NAME222}Config.cmake"
INSTALL_DESTINATION ${CONFIG_PACKAGE_LOCATION}
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/${LIBRARY_NAME222}ConfigVersion.cmake"
VERSION ${LIBRARY_VERSION}
COMPATIBILITY SameMajorVersion)
install(
FILES
"${PROJECT_BINARY_DIR}/${LIBRARY_NAME222}Config.cmake"
"${PROJECT_BINARY_DIR}/${LIBRARY_NAME222}ConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION}
COMPONENT Devel)

View File

@ -0,0 +1,6 @@
# CMakeCpp CMake configuration file
#include(CMakeFindDependencyMacro)
#find_dependency(Foo REQUIRED NO_MODULE)
include("${CMAKE_CURRENT_LIST_DIR}/etk-coreTargets.cmake")

View File

@ -84,11 +84,10 @@ etk::Number::Number(uint64_t _value) :
}
etk::Number::Number(float _value) :
m_negative(false),
m_unit(0),
m_unit(_value),
m_lessZero(0),
m_numberLessZero(0),
m_exponent(0) {
m_unit(_value);
_value -= int64_t(_value);
_value *= 10.0;
for (size_t iii=0; iii<64; ++iii) {
@ -104,11 +103,10 @@ etk::Number::Number(float _value) :
}
etk::Number::Number(double _value) :
m_negative(false),
m_unit(0),
m_unit(_value),
m_lessZero(0),
m_numberLessZero(0),
m_exponent(0) {
m_unit(_value);
_value -= int64_t(_value);
_value *= 10.0;
for (size_t iii=0; iii<64; ++iii) {
@ -124,11 +122,10 @@ etk::Number::Number(double _value) :
}
etk::Number::Number(long double _value) :
m_negative(false),
m_unit(0),
m_unit(_value),
m_lessZero(0),
m_numberLessZero(0),
m_exponent(0) {
m_unit(_value);
_value -= int64_t(_value);
_value *= 10.0;
for (size_t iii=0; iii<64; ++iii) {
@ -222,7 +219,7 @@ bool etk::Number::parse(const etk::UString& _value) {
section = type::numberLessZero;
continue;
}
TK_ERROR("Can not parse the Number '" << _value << "':" << iii << " '.' can not parse");
//TK_ERROR("Can not parse the Number '" << _value << "':" << iii << " '.' can not parse");
return false;
}
if (_value[iii] == 'e') {
@ -231,7 +228,7 @@ bool etk::Number::parse(const etk::UString& _value) {
section = type::numberExponent;
continue;
}
TK_ERROR("Can not parse the Number '" << _value << "':" << iii << " 'e' ==> can not parse ...");
//TK_ERROR("Can not parse the Number '" << _value << "':" << iii << " 'e' ==> can not parse ...");
return false;
}
if (isDigit(_value[iii], section) == true) {
@ -263,9 +260,9 @@ bool etk::Number::parse(const etk::UString& _value) {
long double etk::Number::getDouble() {
long double out = 0;
out = m_lessZero;
out *= pow(10,-m_numberLessZero);
out *= pow(10.0,-m_numberLessZero);
out += m_unit;
out *= pow(10,m_exponent);
out *= pow(10.0,m_exponent);
if (m_negative == true) {
out *= -1.0;
}

View File

@ -19,50 +19,50 @@ def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
return "../authors.txt"
def get_version():
return "version.txt"
return "../version.txt"
def configure(target, my_module):
my_module.add_extra_flags()
# add the file to compile:
my_module.add_src_file([
'etk-core/String.cpp',
'etk-core/UString.cpp',
'etk-core/utf8.cpp',
'etk-core/stdTools.cpp',
'etk-core/Stream.cpp',
'etk-core/Function.cpp',
'etk-core/Allocator.cpp',
'etk-core/typeInfo.cpp',
'etk-core/Exception.cpp',
'etk-core/system.cpp',
'etk-core/Numbers.cpp',
'etk/String.cpp',
'etk/UString.cpp',
'etk/utf8.cpp',
'etk/stdTools.cpp',
'etk/Stream.cpp',
'etk/Function.cpp',
'etk/Allocator.cpp',
'etk/typeInfo.cpp',
'etk/Exception.cpp',
'etk/system.cpp',
'etk/Number.cpp',
])
my_module.add_header_file([
'etk-core/algorithm.hpp',
'etk-core/Allocator.hpp',
'etk-core/types.hpp',
'etk-core/stdTools.hpp',
'etk-core/String.hpp',
'etk-core/UString.hpp',
'etk-core/utf8.hpp',
'etk-core/Array.hpp',
'etk-core/Vector.hpp',
'etk-core/Stream.hpp',
'etk-core/Pair.hpp',
'etk-core/Map.hpp',
'etk-core/Set.hpp',
'etk-core/move.hpp',
'etk-core/typeTrait.hpp',
'etk-core/Function.hpp',
'etk-core/NullPtr.hpp',
'etk-core/typeInfo.hpp',
'etk-core/Exception.hpp',
'etk-core/system.hpp',
'etk-core/Numbers.hpp',
'etk/algorithm.hpp',
'etk/Allocator.hpp',
'etk/types.hpp',
'etk/stdTools.hpp',
'etk/String.hpp',
'etk/UString.hpp',
'etk/utf8.hpp',
'etk/Array.hpp',
'etk/Vector.hpp',
'etk/Stream.hpp',
'etk/Pair.hpp',
'etk/Map.hpp',
'etk/Set.hpp',
'etk/move.hpp',
'etk/typeTrait.hpp',
'etk/Function.hpp',
'etk/NullPtr.hpp',
'etk/typeInfo.hpp',
'etk/Exception.hpp',
'etk/system.hpp',
'etk/Number.hpp',
], 'etk')
# build in C++ mode

View File

@ -4,7 +4,7 @@ import lutin.tools as tools
def get_type():
return "BINARY"
return "BINARY_SHARED"
def get_sub_type():
return "TEST"
@ -22,7 +22,7 @@ def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
return "../authors.txt"
def configure(target, my_module):
my_module.add_src_file([

View File

@ -3,7 +3,6 @@
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
#ifdef ETK_BUILD_MINIZIP
#include <etk/archive/Archive.hpp>
#include <etk/archive/Zip.hpp>
@ -220,5 +219,3 @@ etk::Vector<etk::Path> etk::Archive::listRecursive(const etk::Path& _path) {
return out;
}
#endif

View File

@ -5,8 +5,6 @@
*/
#pragma once
#ifdef ETK_BUILD_MINIZIP
#include <etk/types.hpp>
#include <etk/Map.hpp>
#include <ethread/Mutex.hpp>
@ -215,4 +213,3 @@ namespace etk {
etk::Vector<etk::Path> listRecursive(const etk::Path& _path);
};
}
#endif

View File

@ -4,8 +4,6 @@
* @license MPL v2.0 (see license file)
*/
#ifdef ETK_BUILD_MINIZIP
#include <etk/archive/Zip.hpp>
#include <etk/types.hpp>
#include <etk/debug.hpp>
@ -16,6 +14,7 @@ ETK_DECLARE_TYPE(etk::archive::Zip);
etk::archive::Zip::Zip(const etk::Path& _fileName, uint64_t _offset) :
etk::Archive(_fileName),
m_ctx(null) {
#if 0
/* Open the zip file */
m_ctx = unzOpenOffset(m_fileName.getNative().c_str(), _offset);
if(!m_ctx) {
@ -51,11 +50,13 @@ etk::archive::Zip::Zip(const etk::Path& _fileName, uint64_t _offset) :
}
}
}
#endif
}
// TODO: Support the correct URI... ==> do a structure in unzip to manage the read and write of data with a callback...
etk::archive::Zip::Zip(const etk::Uri& _uri) :
etk::Archive(_uri.getPath()),
m_ctx(null) {
#if 0
if (_uri.getScheme() != "") {
TK_ERROR("Can not read and uri that is not with a scheme != of RAW, we have " << _uri);
return;
@ -95,16 +96,20 @@ etk::archive::Zip::Zip(const etk::Uri& _uri) :
}
}
}
#endif
}
etk::archive::Zip::~Zip() {
#if 0
if (m_ctx!= null) {
unzClose(m_ctx);
m_ctx = null;
};
#endif
}
void etk::archive::Zip::loadFile(const etk::Map<etk::Path, ememory::SharedPtr<ArchiveContent>>::Iterator& it) {
#if 0
TK_VERBOSE("Real load file : '" << it->first << "'");
unzGoToFirstFile(m_ctx);
@ -155,5 +160,5 @@ void etk::archive::Zip::loadFile(const etk::Map<etk::Path, ememory::SharedPtr<Ar
}
}
}
#endif
}
#endif

View File

@ -7,44 +7,41 @@
#include <etk/archive/Archive.hpp>
#include <etk/uri/Uri.hpp>
#ifdef ETK_BUILD_MINIZIP
extern "C" {
#include <minizip/unzip.h>
}
namespace etk {
extern "C" {
#include <minizip/unzip.h>
}
namespace etk {
/**
* @brief Zip file acces are set in a archive namespace
*/
namespace archive {
/**
* @brief Zip file acces are set in a archive namespace
* @brief Zip acces interface (wrapper)
*/
namespace archive {
/**
* @brief Zip acces interface (wrapper)
*/
class Zip : public etk::Archive {
private:
unzFile m_ctx; //!< mini zip context
unz_global_info m_info; //!< global information of the Zip
public:
/**
* @brief constructor of a zip file access
* @param[in] _fileName File to parse (.zip / .apk)
* @param[in] _offset Offset in the file where to start the parsing of the "zip"
*/
Zip(const etk::Path& _fileName, uint64_t _offset = 0LL);
/**
* @brief constructor of a zip file access
* @param[in] _uri URI of the file to parse (.zip / .apk)
*/
Zip(const etk::Uri& _uri);
/**
* @brief basic destructor
*/
virtual ~Zip();
protected:
void loadFile(const etk::Map<etk::Path, ememory::SharedPtr<ArchiveContent>>::Iterator& _it) override;
};
}
class Zip : public etk::Archive {
private:
unzFile m_ctx; //!< mini zip context
unz_global_info m_info; //!< global information of the Zip
public:
/**
* @brief constructor of a zip file access
* @param[in] _fileName File to parse (.zip / .apk)
* @param[in] _offset Offset in the file where to start the parsing of the "zip"
*/
Zip(const etk::Path& _fileName, uint64_t _offset = 0LL);
/**
* @brief constructor of a zip file access
* @param[in] _uri URI of the file to parse (.zip / .apk)
*/
Zip(const etk::Uri& _uri);
/**
* @brief basic destructor
*/
virtual ~Zip();
protected:
void loadFile(const etk::Map<etk::Path, ememory::SharedPtr<ArchiveContent>>::Iterator& _it) override;
};
}
#endif
}

View File

@ -19,10 +19,10 @@ def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
return "../authors.txt"
def get_version():
return "version.txt"
return "../version.txt"
def configure(target, my_module):
my_module.add_extra_flags()
@ -119,7 +119,7 @@ def configure(target, my_module):
my_module.add_depend(['cxx'])
# add some optionnal libraries
my_module.add_optionnal_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"], export=True)
my_module.add_optionnal_depend('minizip', export=True)
my_module.add_optionnal_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True)
if "Android" in target.get_type():