gcontini
2019-11-03 0383805b72953ebaa00806a3a39f722e29beb5af
issue #42 (first part)

splitting the license generator project from the open license manager
library
7个文件已修改
6个文件已添加
4 文件已重命名
21个文件已删除
1801 ■■■■ 已修改文件
.gitignore 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitmodules 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt.bak 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
build/.gitkeep 补丁 | 查看 | 原始文档 | blame | 历史
cmake/Findolm.cmake 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cmake/target_arch.cmake 补丁 | 查看 | 原始文档 | blame | 历史
cmake/toolchain-ubuntu-mingw64.cmake 补丁 | 查看 | 原始文档 | blame | 历史
cmake/utilities.cmake 补丁 | 查看 | 原始文档 | blame | 历史
example/CMakeLists.txt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
example/example.cpp 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
extern/license-generator @ 5c4ebe 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
product/.gitkeep 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/CMakeLists.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/library/base/CMakeLists.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/build_properties.h.in 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/CMakeLists.txt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/CMakeLists.txt 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/CryptoHelper.cpp 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/CryptoHelper.h 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/README.TXT 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/linux/CryptoHelperLinux.cpp 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/linux/CryptoHelperLinux.h 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/win/CryptoHelperWindows.cpp 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/base_lib/win/CryptoHelperWindows.h 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/bootstrap/CMakeLists.txt 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/bootstrap/bootstrap.cpp 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/license-generator/.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/license-generator/CMakeLists.txt 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/license-generator/license-generator-main.cpp 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/license-generator/license-generator.cpp 249 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/license-generator/license-generator.h 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tools/pc-identifier/CMakeLists.txt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/CMakeLists.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/functional/CMakeLists.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/license-generator/CMakeLists.txt 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/license-generator/license-generator_test.cpp 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -18,7 +18,8 @@
/Testing
# Cmake generated files
build
build/*
!build/.gitkeep
#eclipse files
.cproject
@@ -26,3 +27,7 @@
.project
*.out
/Default/
product/*
!product/.gitkeep
.gitmodules
New file
@@ -0,0 +1,4 @@
[submodule "extern/license-generator"]
    path = extern/license-generator
    url = https://github.com/open-license-manager/olm-license-generator.git
    branch = feature/issue_licenses_42
CMakeLists.txt
@@ -1,120 +1,46 @@
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
#version variables, major and minor must be 1 character only
SET(LICENSECC_MAJOR_VERSION 1)
SET(LICENSECC_MINOR_VERSION 1)
SET(LICENSECC_PATCH_VERSION 0 CACHE STRING "License++ patch version string")
SET(LICENSECC_PATCH_VERSION 0 CACHE STRING "Licensecc patch version string")
SET(LICENSECC_INT_VERSION "${LICENSECC_MAJOR_VERSION}${LICENSECC_MINOR_VERSION}${LICENSECC_PATCH_VERSION}")
SET(LICENSECC_VERSION "${LICENSECC_MAJOR_VERSION}.${LICENSECC_MINOR_VERSION}.${LICENSECC_PATCH_VERSION}")
SET(LICENSECC_SHORT_LICENSE "BSD Software License")
SET(CMAKE_DISABLE_SOURCE_CHANGES ON)
SET(CMAKE_DISABLE_SOURCE_CHANGES OFF) #keys are generated in the source tree by default
SET(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
SET(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "CMake verbose")
project (license++ C CXX )
IF(NOT LCC_PRODUCT_NAME)
    message(WARNING "You should define a variable LCC_PRODUCT_NAME containing the name of the software you want to add a license to."
        "A mock product named DEFAULT has been added for you.")
    set(LCC_PRODUCT_NAME "DEFAULT")
ENDIF(NOT LCC_PRODUCT_NAME)
#base folder where product names are stored (/projects)
IF(NOT LCC_PRODUCTS_BASE_DIR)
    set(LCC_PRODUCTS_BASE_DIR "${CMAKE_SOURCE_DIR}/product")
ENDIF(NOT LCC_PRODUCTS_BASE_DIR)
project (licensecc C CXX )
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules/")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(utilities)
if(CMAKE_BUILD_TYPE)
    string(TOLOWER ${CMAKE_BUILD_TYPE} _CMAKE_BUILD_TYPE)
    EVAL_CONDITION(RELEASE_BUILD ${_CMAKE_BUILD_TYPE} STREQUAL "release")
else(CMAKE_BUILD_TYPE)
    SET(RELEASE_BUILD 0)
endif(CMAKE_BUILD_TYPE)
#find olm executable or build it.
find_package(olm REQUIRED)
if(MSVC)
    SET(PLATFORM_LIBS "")
    include(target_arch)
    target_architecture( TARGET_ARCHITECTURE )
    message(STATUS "architecture detected: ${TARGET_ARCHITECTURE}")
#load the current project from files or find it from environment variables or create a default one
set(LCC_PROJECT_PUBLIC_KEY "${LCC_PRODUCTS_BASE_DIR}/${LCC_PRODUCT_NAME}/include/${PROJECT_NAME}/${LCC_PRODUCT_NAME}/public_key.h" )
set(LCC_PROJECT_PRIVATE_KEY "${LCC_PRODUCTS_BASE_DIR}/${LCC_PRODUCT_NAME}/private_key.rsa" )
    
    #Boost > 3.15 handle the /MD flag more nicely than this
    if(${STATIC_RUNTIME})
        string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
        string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
        string(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
        string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
        SET(Boost_USE_STATIC_RUNTIME ON)
    endif(${STATIC_RUNTIME})
    #SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib ) #${CMAKE_FIND_LIBRARY_SUFFIXES}
    add_definitions("/D _CRT_SECURE_NO_WARNINGS")
else(MSVC)
    #GCC or Mingw
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fmessage-length=0 -std=c++11 -Wuninitialized -fPIC") #-Wall
    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -fmessage-length=0 -Wall -Wuninitialized -fPIC")
    SET(CMAKE_EXE_LINKER_FLAGS  "-pthread -static-libstdc++")
    SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,--strip-all -static-libstdc++") #-static
    #you need to "force" the change in cmake_install_prefix after the project keyword
    IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
        SET(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install path prefix" FORCE)
    ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    if(MINGW)
        list(APPEND EXTERNAL_LIBS "-lcrypt32 -lws2_32 -liphlpapi")
        SET(CMAKE_EXE_LINKER_FLAGS "-static")
    endif(MINGW)
    if(USE_DBUS_IDENTIFIER)
        FIND_PACKAGE(Dbus REQUIRED)
        add_definitions(-DUSE_DBUS)
        include_directories(${DBUS_INCLUDE_DIR})
        include_directories(${DBUS_ARCH_INCLUDE_DIR})
        list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES})
    endif(USE_DBUS_IDENTIFIER)
endif(MSVC)
if(UNIX) #this is true for all the linux systems but not for cross compiling
    #find a static version of openssl crypto library
    SET ( OPENSSL_USE_STATIC_LIBS ON )
    find_package(OpenSSL REQUIRED COMPONENTS Crypto)
    include_directories(${OPENSSL_INCLUDE_DIR})
    list(APPEND EXTERNAL_LIBS ${OPENSSL_CRYPTO_LIBRARY})
    MESSAGE(STATUS "Found openssl version ${OPENSSL_VERSION} ")
    #Zlib required when openssl version < 1.0.1f
    SET ( ZLIB_USE_STATIC_LIBS ON )
    find_package(ZLIB REQUIRED)
    list(APPEND EXTERNAL_LIBS ${ZLIB_LIBRARIES})
    MESSAGE(STATUS "Found zlib version ${ZLIB_VERSION} ")
    if(NOT MINGW)
         list(APPEND EXTERNAL_LIBS "-ldl")
    endif(NOT MINGW)
    find_program( MEMORYCHECK_COMMAND valgrind )
    set( MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full" )
endif(UNIX)
SET_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG>)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET(HAVE_64BIT_SIZE_T 1)
else(CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET(HAVE_64BIT_SIZE_T 0)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
#bug in cmake win32 - can't find boost compiled with mingw
if(WIN32 AND "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x")
    message(WARNING "WIN32 compiler does not specify CMAKE_CXX_COMPILER_ARCHITECTURE_ID -- filling in manually")
    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x64")
    else()
        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x86")
    endif()
    message(STATUS "Compiler architecture: ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
endif()
SET( Boost_USE_STATIC_LIBS ON )
find_package(Boost REQUIRED COMPONENTS date_time unit_test_framework program_options system filesystem)
#set below in case of dynamic linking in debug.
#set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:BOOST_TEST_DYN_LINK>)
add_definitions(-DBOOST_ALL_NO_LIB) #Disable Boost Microsoft magic, all dependencies are handled by cmake
add_definitions(-DBOOST_LIB_DIAGNOSTIC) #Check it is really disabled
configure_file (
    "src/build_properties.h.in"
    "${CMAKE_BINARY_DIR}/build_properties.h"
add_custom_command(
  OUTPUT "${LCC_PROJECT_PUBLIC_KEY}" "${LCC_PROJECT_PRIVATE_KEY}"
  COMMAND license_generator::olm project initialize -s "${PROJECT_SOURCE_DIR}" -n "${LCC_PRODUCT_NAME}" -p "${LCC_PRODUCTS_BASE_DIR}"
  COMMENT "generating ${LCC_PROJECT_PUBLIC_KEY}"
  USES_TERMINAL
)
add_custom_target(product_initialize DEPENDS "${LCC_PROJECT_PUBLIC_KEY}" "${LCC_PROJECT_PRIVATE_KEY}")
message( STATUS "C compiler        : " ${CMAKE_C_COMPILER})
message( STATUS "C compiler flags  : " ${CMAKE_C_FLAGS})
@@ -126,18 +52,38 @@
  message( STATUS "Build type        : " ${CMAKE_BUILD_TYPE})
endif(CMAKE_BUILD_TYPE)
message( STATUS "Install prefix    : " ${CMAKE_INSTALL_PREFIX})
message( STATUS "olm executable    : " ${OLM_VERSION})
#include build directory to find build_properties.h
include_directories(${CMAKE_BINARY_DIR})
#boost is required only for tests
#bug in cmake win32 - can't find boost compiled with mingw
if(WIN32 AND "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x")
    message(WARNING "WIN32 compiler does not specify CMAKE_CXX_COMPILER_ARCHITECTURE_ID -- filling in manually")
    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x64")
    else()
        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x86")
    endif()
        message(STATUS "Compiler architecture: ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
endif()
add_subdirectory(src)
SET( Boost_USE_STATIC_LIBS ON )
find_package(Boost REQUIRED COMPONENTS date_time unit_test_framework program_options system filesystem)
#set below in case of dynamic linking in debug.
#set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:BOOST_TEST_DYN_LINK>)
#if boost is found enable tests
IF(Boost_FOUND)
INCLUDE(CTest)
ENABLE_TESTING()
IF(BUILD_TESTING)
  SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
  MARK_AS_ADVANCED(BUILDNAME)
        add_definitions(-DBOOST_ALL_NO_LIB) #Disable Boost Microsoft magic, all dependencies are handled by cmake
        add_definitions(-DBOOST_LIB_DIAGNOSTIC) #Check it is really disabled
#        add_subdirectory(test)
ENDIF(BUILD_TESTING)
add_subdirectory(test)
ELSE(Boost_FOUND)
    message(WARNING "Boost not found, disabling tests")
ENDIF(Boost_FOUND)
CMakeLists.txt.bak
New file
@@ -0,0 +1,137 @@
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
#version variables, major and minor must be 1 character only
SET(LICENSECC_MAJOR_VERSION 1)
SET(LICENSECC_MINOR_VERSION 1)
SET(LICENSECC_PATCH_VERSION 0 CACHE STRING "Licensecc patch version string")
SET(LICENSECC_INT_VERSION "${LICENSECC_MAJOR_VERSION}${LICENSECC_MINOR_VERSION}${LICENSECC_PATCH_VERSION}")
SET(LICENSECC_VERSION "${LICENSECC_MAJOR_VERSION}.${LICENSECC_MINOR_VERSION}.${LICENSECC_PATCH_VERSION}")
SET(LICENSECC_SHORT_LICENSE "BSD Software License")
SET(CMAKE_DISABLE_SOURCE_CHANGES ON)
SET(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
project (licensecc C CXX )
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(utilities) #import module utilities.cmake
if(CMAKE_BUILD_TYPE)
    string(TOLOWER ${CMAKE_BUILD_TYPE} _CMAKE_BUILD_TYPE)
    EVAL_CONDITION(RELEASE_BUILD ${_CMAKE_BUILD_TYPE} STREQUAL "release")
else(CMAKE_BUILD_TYPE)
    SET(RELEASE_BUILD 0)
endif(CMAKE_BUILD_TYPE)
if(MSVC)
    SET(PLATFORM_LIBS "")
    include(target_arch)
    target_architecture( TARGET_ARCHITECTURE )
    message(STATUS "architecture detected: ${TARGET_ARCHITECTURE}")
    #Boost > 3.15 handle the /MD flag more nicely than this
    if(${STATIC_RUNTIME})
        string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
        string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
        string(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
        string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
        SET(Boost_USE_STATIC_RUNTIME ON)
    endif(${STATIC_RUNTIME})
    #SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib ) #${CMAKE_FIND_LIBRARY_SUFFIXES}
    add_definitions("/D _CRT_SECURE_NO_WARNINGS")
else(MSVC)
    #GCC or Mingw
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fmessage-length=0 -std=c++11 -Wuninitialized -fPIC") #-Wall
    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -fmessage-length=0 -Wall -Wuninitialized -fPIC")
    SET(CMAKE_EXE_LINKER_FLAGS  "-pthread -static-libstdc++")
    SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,--strip-all -static-libstdc++") #-static
    if(MINGW)
        list(APPEND EXTERNAL_LIBS "-lcrypt32 -lws2_32 -liphlpapi")
        SET(CMAKE_EXE_LINKER_FLAGS "-static")
    endif(MINGW)
    if(USE_DBUS_IDENTIFIER)
        FIND_PACKAGE(Dbus REQUIRED)
        add_definitions(-DUSE_DBUS)
        include_directories(${DBUS_INCLUDE_DIR})
        include_directories(${DBUS_ARCH_INCLUDE_DIR})
        list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES})
    endif(USE_DBUS_IDENTIFIER)
endif(MSVC)
if(UNIX) #this is true for all the linux systems but not for cross compiling
    #find a static version of openssl crypto library
    SET ( OPENSSL_USE_STATIC_LIBS ON )
    find_package(OpenSSL REQUIRED COMPONENTS Crypto)
    include_directories(${OPENSSL_INCLUDE_DIR})
    list(APPEND EXTERNAL_LIBS ${OPENSSL_CRYPTO_LIBRARY})
    MESSAGE(STATUS "Found openssl version ${OPENSSL_VERSION} ")
    #Zlib required when openssl version < 1.0.1f
    SET ( ZLIB_USE_STATIC_LIBS ON )
    find_package(ZLIB REQUIRED)
    list(APPEND EXTERNAL_LIBS ${ZLIB_LIBRARIES})
    MESSAGE(STATUS "Found zlib version ${ZLIB_VERSION} ")
    if(NOT MINGW)
         list(APPEND EXTERNAL_LIBS "-ldl")
    endif(NOT MINGW)
    find_program( MEMORYCHECK_COMMAND valgrind )
    set( MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full" )
endif(UNIX)
SET_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG>)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET(HAVE_64BIT_SIZE_T 1)
else(CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET(HAVE_64BIT_SIZE_T 0)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
#bug in cmake win32 - can't find boost compiled with mingw
if(WIN32 AND "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x")
    message(WARNING "WIN32 compiler does not specify CMAKE_CXX_COMPILER_ARCHITECTURE_ID -- filling in manually")
    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x64")
    else()
        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x86")
    endif()
    message(STATUS "Compiler architecture: ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
endif()
SET( Boost_USE_STATIC_LIBS ON )
find_package(Boost REQUIRED COMPONENTS date_time unit_test_framework program_options system filesystem)
#set below in case of dynamic linking in debug.
#set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:BOOST_TEST_DYN_LINK>)
add_definitions(-DBOOST_ALL_NO_LIB) #Disable Boost Microsoft magic, all dependencies are handled by cmake
add_definitions(-DBOOST_LIB_DIAGNOSTIC) #Check it is really disabled
configure_file (
    "src/build_properties.h.in"
    "${CMAKE_BINARY_DIR}/build_properties.h"
)
message( STATUS "C compiler        : " ${CMAKE_C_COMPILER})
message( STATUS "C compiler flags  : " ${CMAKE_C_FLAGS})
message( STATUS "CXX compiler      : " ${CMAKE_CXX_COMPILER})
message( STATUS "CXX compiler flags: " ${CMAKE_CXX_FLAGS})
message( STATUS "CXX compiler flags debug : " ${CMAKE_CXX_FLAGS_DEBUG})
message( STATUS "CXX compiler flags release: " ${CMAKE_CXX_FLAGS_RELEASE})
if(CMAKE_BUILD_TYPE)
  message( STATUS "Build type        : " ${CMAKE_BUILD_TYPE})
endif(CMAKE_BUILD_TYPE)
message( STATUS "Install prefix    : " ${CMAKE_INSTALL_PREFIX})
#include build directory to find build_properties.h
include_directories(${CMAKE_BINARY_DIR})
add_subdirectory(src)
INCLUDE(CTest)
ENABLE_TESTING()
IF(BUILD_TESTING)
  SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
  MARK_AS_ADVANCED(BUILDNAME)
ENDIF(BUILD_TESTING)
#add_subdirectory(test)
README.md
@@ -1,6 +1,12 @@
# Open License Manager
[![Build Status](https://travis-ci.org/open-license-manager/open-license-manager.svg?branch=develop)](https://travis-ci.org/open-license-manager/open-license-manager)
[![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/)
[![Standard](https://img.shields.io/badge/c%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Build Status](https://travis-ci.org/open-license-manager/open-license-manager.svg?branch=develop)](https://travis-ci.org/open-license-manager/open-license-manager)
[![Coverage Status](https://codecov.io/gh/jinja2cpp/Jinja2Cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/jinja2cpp/Jinja2Cpp)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/62d6e1bb22d648bd85b6f3bc344a545a)](https://www.codacy.com/manual/gcontini/open-license-manager?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=open-license-manager/open-license-manager&amp;utm_campaign=Badge_Grade)
[![Github Issues](![GitHub issues](https://img.shields.io/github/issues/open-license-manager/open-license-manager))](http://github.com/open-license-manager/open-license-manager/issues)
A copy protection, licensing software written in C++ for Windows and Linux (with a simple C api for use in C projects).
@@ -16,17 +22,13 @@
## Project Structure
The software is made by 2 main sub-components:
 * a C library with no (or minimal) external dependencies (the part you have to integrate in your software).
 * a license generator written in C++ (allows you to generate a license).
 * a C++ library with a nice C api, `licensecc` with minimal (or no) external dependencies (the part you have to integrate in your software).
 * a license generator open-license-manager `olm` that allows you to generate a license.
 
these modules are planned....
 * a license [backoffice](../../issues/7) in php (in order to handle multiple licenses).
 * a license debugger to be sent to the final customer when there are licensing problems. 
 * a [log descriptor](../../issues/8) in order to decrypt logs generated by the license system.
You can notice 2 more sub-projects:
 * bootstrap: allows to generate private keys and modify the library on the fly after the downloading.
 * testing  : runs the tests (and publish the results on cdash)
# How to build
build/.gitkeep
cmake/Findolm.cmake
New file
@@ -0,0 +1,82 @@
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
Findolm
-------
Find or build the olm executable.
Imported Targets
^^^^^^^^^^^^^^^^
This module provides the following imported targets, if found:
``license_generator::olm``
  The olm executable
If olm is not found this module will try to download it as a submodule
Git must be installed.
Input variables
^^^^^^^^^^^^^^^^
``OLM_LOCATION`` Hint for locating the olm executable
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``OLM_FOUND``
  True if the system has the Foo library.
``olm_VERSION``
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``OLM_EXECUTABLE``
  Path to the olm executable.
#]=======================================================================]
set(olm_names olm olm.exe)
set (failure_messge "Error finding olm executable.")
find_package(PkgConfig)
if(OLM_LOCATION)
    # First search the PATH and specific locations.
    find_program(OLM_EXECUTABLE
      NAMES ${olm_names} HINTS ${OLM_LOCATION} DOC "olm command line client")
    FIND_PACKAGE_HANDLE_STANDARD_ARGS(olm FOUND_VAR OLM_FOUND
                                       REQUIRED_VARS OLM_EXECUTABLE
                                       FAIL_MESSAGE "Error finding olm executable. variable OLM_LOCATION non set correctly.")
    add_executable(license_generator::olm IMPORTED GLOBAL)
    set_property(TARGET license_generator::olm PROPERTY IMPORTED_LOCATION ${OLM_EXECUTABLE})
ELSE(OLM_LOCATION)
    find_package(olm REQUIRED NO_CMAKE_PATH) #try to find it without looping on this module
    IF(NOT olm_FOUND)
        find_package(Git QUIET)
        if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
        # Update submodules as needed
            option(GIT_SUBMODULE "Check submodules during build" ON)
            if(GIT_SUBMODULE)
                message(STATUS "Submodule update")
#                execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
#                                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
#                                RESULT_VARIABLE GIT_SUBMOD_RESULT)
                if(NOT GIT_SUBMOD_RESULT EQUAL "0")
                    set(failure_messge  "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
                endif()
            endif()
        endif()
        if(NOT EXISTS "${PROJECT_SOURCE_DIR}/extern/license-generator/CMakeLists.txt")
            set(failure_messge  "All the options to find olm executable failed. And i can't compile one from source GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
        endif()
        add_subdirectory("${PROJECT_SOURCE_DIR}/extern/license-generator")
    ENDIF(NOT olm_FOUND)
ENDIF(OLM_LOCATION)
cmake/target_arch.cmake
cmake/toolchain-ubuntu-mingw64.cmake
cmake/utilities.cmake
example/CMakeLists.txt
File was deleted
example/example.cpp
File was deleted
extern/license-generator
New file
@@ -0,0 +1 @@
Subproject commit 5c4ebec01b66bc3ad508e711a373ed46cb0a95c3
product/.gitkeep
New file
@@ -0,0 +1 @@
t
src/CMakeLists.txt
@@ -1,4 +1,4 @@
add_subdirectory("library")
add_subdirectory("tools")
    
src/library/base/CMakeLists.txt
@@ -6,6 +6,6 @@
    base64.c
)
add_dependencies( base public_key )
add_dependencies( base product_initialize )
install(TARGETS base ARCHIVE DESTINATION lib)
src/templates/build_properties.h.in
src/tools/CMakeLists.txt
File was deleted
src/tools/base_lib/CMakeLists.txt
File was deleted
src/tools/base_lib/CryptoHelper.cpp
File was deleted
src/tools/base_lib/CryptoHelper.h
File was deleted
src/tools/base_lib/README.TXT
File was deleted
src/tools/base_lib/linux/CryptoHelperLinux.cpp
File was deleted
src/tools/base_lib/linux/CryptoHelperLinux.h
File was deleted
src/tools/base_lib/win/CryptoHelperWindows.cpp
File was deleted
src/tools/base_lib/win/CryptoHelperWindows.h
File was deleted
src/tools/bootstrap/CMakeLists.txt
File was deleted
src/tools/bootstrap/bootstrap.cpp
File was deleted
src/tools/license-generator/.gitignore
File was deleted
src/tools/license-generator/CMakeLists.txt
File was deleted
src/tools/license-generator/license-generator-main.cpp
File was deleted
src/tools/license-generator/license-generator.cpp
File was deleted
src/tools/license-generator/license-generator.h
File was deleted
src/tools/pc-identifier/CMakeLists.txt
File was deleted
test/CMakeLists.txt
@@ -4,5 +4,4 @@
link_directories ( ${Boost_LIBRARY_DIR} )
add_subdirectory(library)
add_subdirectory(license-generator)
add_subdirectory(functional)
test/functional/CMakeLists.txt
@@ -43,7 +43,7 @@
 ${Boost_LIBRARIES}
)
#set CROSSCOMPILING_EMULATOR
IF( ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") AND CMAKE_CROSSCOMPILING)
#binfmt_misc doesn't work in my system :(
    ADD_TEST(NAME test_standard_license COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_standard_license WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
test/license-generator/CMakeLists.txt
File was deleted
test/license-generator/license-generator_test.cpp
File was deleted