initial commit

This commit is contained in:
TanninOne
2015-12-21 12:50:17 +01:00
parent d6223f5f87
commit e2a6a7ef3b
129 changed files with 19463 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.0 FATAL_ERROR)
CMAKE_POLICY(SET CMP0056 NEW)
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ELSE()
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF()
PROJECT(usvfs)
ENABLE_TESTING()
INCLUDE(${CMAKE_SOURCE_DIR}/StandardSetup.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/SetupPackage.cmake)
#INCLUDE(cotire)
SET(CMAKE_PREFIX_PATH "${QTDIR}; ${WINSDK_LIB}")
SET(PROJ_VERSION 0.2)
SET(PROJ_AUTHOR Tannin)
SET(PROJ_ARCH x86 CACHE STRING "build architecture, has to be x86 or x64")
ADD_DEFINITIONS(-DUNICODE -D_UNICODE -DASMJIT_STATIC -DPROJ_VERSION="${PROJ_VERSION}")
#ADD_DEFINITIONS(-DBOOST_EXCEPTION_DISABLE -DBOOST_NO_EXCEPTIONS)
SET(default_project_path "${CMAKE_SOURCE_DIR}/..")
GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH)
SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects")
SET(lib_path "${project_path}/../install/libs")
LINK_DIRECTORIES("${lib_path}")
ADD_SUBDIRECTORY(shared)
ADD_SUBDIRECTORY(shared_test)
ADD_SUBDIRECTORY(thooklib)
ADD_SUBDIRECTORY(thooklib_test)
ADD_SUBDIRECTORY(tinjectlib)
ADD_SUBDIRECTORY(tinjectlib_test)
ADD_SUBDIRECTORY(testinject_dll)
ADD_SUBDIRECTORY(testinject_bin)
ADD_SUBDIRECTORY(usvfs)
ADD_SUBDIRECTORY(usvfs_test)
ADD_SUBDIRECTORY(usvfs_helper)
ADD_SUBDIRECTORY(usvfs_proxy)
ADD_SUBDIRECTORY(usvfs_loader)
+25
View File
@@ -0,0 +1,25 @@
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "usvfs")
SET(CPACK_PACKAGE_VENDOR "Tannin")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\usvfs_loader.exe")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} usvfs")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.tannin.eu")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.tannin.eu")
SET(CPACK_NSIS_CONTACT "sherb@gmx.net")
SET(CPACK_NSIS_MODIFY_PATH ON)
ELSE(WIN32 AND NOT UNIX)
SET(CPACK_STRIP_FILES "bin/MyExecutable")
SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "usvfs_loader.exe" "Loader")
+88
View File
@@ -0,0 +1,88 @@
# do not set warning level build-wide, we want the power to control warnings per-target
STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
IF(CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF()
MESSAGE(STATUS "build type ${CMAKE_BUILD_TYPE}")
SET(CMAKE_DEBUG_POSTFIX -d)
SET(CMAKE_VERBOSE_MAKEFILE CACHE BOOL ON)
IF(CMAKE_BUILD_TYPE MATCHES Debug)
SET(POSTFIX ${CMAKE_DEBUG_POSTFIX})
ADD_DEFINITIONS(-DDEBUG)
ELSE(CMAKE_BUILD_TYPE MATCHES Debug)
SET(POSTFIX ${CMAKE_RELEASE_POSTFIX})
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
if (MSVC)
ELSE()
ADD_DEFINITIONS(-D_WIN32_WINNT=0x600 -DWIN32 -D_WIN32 -D__cplusplus=201103L)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-unknown-pragmas -Wno-unused-variable")
ENDIF()
#FOREACH(flag_var CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL)
# IF(${flag_var} MATCHES "/MD")
# STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
# ENDIF(${flag_var} MATCHES "/MD")
#ENDFOREACH(flag_var)
# build systems that support multiple configurations in one build script (i.e. vs solutions) may use
# a subdirectory below each component to separate configurations. This path is available at build-time
# through ${CMAKE_CFG_INTDIR} but not at configuration time (which affects installations) so try
# to predict the path here
IF(${CMAKE_CFG_INTDIR} STREQUAL ".")
SET(MY_CFG_INTDIR ".")
ELSE()
SET(MY_CFG_INTDIR "${CMAKE_BUILD_TYPE}")
ENDIF()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules)
INCLUDE(TargetArch)
INCLUDE(Utils)
INCLUDE(ExternalProject)
# make external projects download to third_party subdirectory
SET(EXTERNAL_PROJECT_DIRECTORY ${CMAKE_BINARY_DIR}/third_party)
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${EXTERNAL_PROJECT_DIRECTORY})
# adding boost. requires some preparation
TARGET_ARCHITECTURE(TargetArchitecture)
# the boost script sets its output variables to parent scope so we have to run it in a
# scope for it to work
#FUNCTION(include_subscope)
# INCLUDE(AddBoost)
#ENDFUNCTION(include_subscope)
#INCLUDE_SUBSCOPE()
#INCLUDE(AddGTest)
#INCLUDE(AddAsmJit)
#INCLUDE(AddUdis86)
#INCLUDE(AddSpdlog)
#INCLUDE(AddCppFormat)
#INCLUDE(AddQt)
LIST(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}/qt5/lib/cmake)
SET(DEPENDENCIES_DIR CACHE PATH "")
# hint to find qt in dependencies path
FILE(GLOB_RECURSE BOOST_ROOT ${DEPENDENCIES_DIR}/boost*/project-config.jam)
GET_FILENAME_COMPONENT(BOOST_ROOT ${BOOST_ROOT} DIRECTORY)
#hint to find boost in dependencies path
FILE(GLOB_RECURSE BOOST_ROOT ${DEPENDENCIES_DIR}/boost*/project-config.jam)
GET_FILENAME_COMPONENT(BOOST_ROOT ${BOOST_ROOT} DIRECTORY)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Boost REQUIRED)
FIND_PACKAGE(Spdlog REQUIRED)
FIND_PACKAGE(CppFormat REQUIRED)
FIND_PACKAGE(GTest REQUIRED)
FIND_PACKAGE(AsmJit REQUIRED)
FIND_PACKAGE(Udis86 REQUIRED)
#SET(Subversion_SVN_EXECUTABLE CACHE FILEPATH "C:/Program Files/SlikSvn/bin/svn.exe")
#SET(QTDIR CACHE FILEPATH "C:/QtSDK5/Qt5.4.0/5.4/msvc2013_opengl")
+77
View File
@@ -0,0 +1,77 @@
@echo off
set VCPATH=C:\Program Files (x86)\Microsoft Visual Studio 12.0
set QTPATH32="C:\QtSDK5\Qt5.4.0\5.4\msvc2013_opengl"
set QTPATH64="C:\QtSDK5\Qt5.4.0\5.4\msvc2013_64_opengl"
set JOMPATH="C:\QtSDK5\Qt5.4.0\Tools\QtCreator\bin"
set BUILDTYPE=RelWithDebInfo
set BUILDPATH=C:\build\usvfs
set STAGINGPATH=stage
set REBUILD=0
set GENERATOR="NMake Makefiles"
set SOURCEDIR=%CD%
if "%1" == "x86" (
title build x86
call :build x86 %QTPATH32%
goto exit_on_success
) else if "%1" == "x64" (
title build x64
call :build x64 %QTPATH64%
goto exit_on_success
) else (
mkdir %BUILDPATH%\%STAGINGPATH%
start /WAIT buildall x86
start /WAIT buildall x64
)
GOTO :EOF
:build
set PLATFORM=%~1
set QTPATH=%~2
echo "building %PLATFORM%"
set BUILDPATHLOC=%BUILDPATH%\%BUILDTYPE%_%PLATFORM%
echo %BUILDPATHLOC%
call "%VCPATH%\VC\vcvarsall.bat" %PLATFORM%
call "%QTPATH%\bin\qtenv2"
if %REBUILD% == 1 (
rmdir /s /q %BUILDPATHLOC%
)
mkdir %BUILDPATHLOC%
cd %BUILDPATHLOC%
set BINPATH=%BUILDPATH%\%STAGINGPATH%
cmake -G%GENERATOR% -DCMAKE_BUILD_TYPE=%BUILDTYPE% -DCMAKE_INSTALL_PREFIX=%BINPATH% %SOURCEDIR%
%JOMPATH%\jom all install
set RESVAR=%errorlevel%
mkdir %BINPATH%
rem xcopy %BUILDPATHLOC%\usvfs_proxy\usvfs_proxy_*.exe %BINPATH%
rem xcopy %BUILDPATHLOC%\usvfs_proxy\usvfs_proxy_*.pdb %BINPATH%
rem xcopy %BUILDPATHLOC%\usvfs_loader\usvfs_loader_*.exe %BINPATH%
rem xcopy %BUILDPATHLOC%\usvfs_loader\usvfs_loader_*.pdb %BINPATH%
rem xcopy %BUILDPATHLOC%\usvfs\usvfs_*.dll %BINPATH%
rem xcopy %BUILDPATHLOC%\usvfs\usvfs_*.pdb %BINPATH%
xcopy /Y %QTPATH%\bin\Qt5Core.dll %BINPATH%\bin_%PLATFORM%
xcopy /Y %QTPATH%\bin\Qt5Gui.dll %BINPATH%\bin_%PLATFORM%
xcopy /Y %QTPATH%\bin\Qt5Widgets.dll %BINPATH%\bin_%PLATFORM%
xcopy /Y %QTPATH%\bin\icu*.dll %BINPATH%\bin_%PLATFORM%
GOTO :EOF
:exit_on_success
if %RESVAR%==0 (
exit
)
GOTO :EOF
+21
View File
@@ -0,0 +1,21 @@
if(NOT DEFINED qt_dir)
message(FATAL_ERROR "error: required variable qt_dir not defined...")
endif()
set(cmd configure.bat)
set(args "")
set(args ${args} -opensource -confirm-license -nomake tests -nomake examples)
set(result_value 0)
message(${cmd} ${args})
execute_process(COMMAND ${cmd} ${args}
WORKING_DIRECTORY ${qt_dir}
RESULT_VARIABLE result_value
)
if(NOT "${result_value}" STREQUAL "0")
message(FATAL_ERROR "error: problem configuring Qt: rv='${rv}'")
endif()
+16
View File
@@ -0,0 +1,16 @@
SET(ASMJIT_FOUND 0)
FILE(GLOB_RECURSE ASMJIT_SOURCE_DIR_INNER ${DEPENDENCIES_DIR}/asmjit*/asmjit.h)
GET_FILENAME_COMPONENT(ASMJIT_SOURCE_DIR_INNER ${ASMJIT_SOURCE_DIR_INNER} DIRECTORY)
GET_FILENAME_COMPONENT(ASMJIT_SOURCE_DIR ${ASMJIT_SOURCE_DIR_INNER} DIRECTORY CACHE)
GET_FILENAME_COMPONENT(ASMJIT_BINARY_DIR ${ASMJIT_SOURCE_DIR} DIRECTORY CACHE)
SET(ASMJIT_BINARY_DIR "${ASMJIT_BINARY_DIR}/build")
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(AsmJit DEFAULT_MSG ASMJIT_SOURCE_DIR)
mark_as_advanced(
ASMJIT_SOURCE_DIR
ASMJIT_BINARY_DIR
)
+13
View File
@@ -0,0 +1,13 @@
set(CPPFORMAT_FOUND 0)
file(GLOB_RECURSE CPPFORMAT_SOURCE_DIR_INNER ${DEPENDENCIES_DIR}/cppformat*/format.h)
GET_FILENAME_COMPONENT(CPPFORMAT_SOURCE_DIR ${CPPFORMAT_SOURCE_DIR_INNER} DIRECTORY CACHE)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPFORMAT DEFAULT_MSG CPPFORMAT_SOURCE_DIR)
mark_as_advanced(
CPPFORMAT_SOURCE_DIR
)
+16
View File
@@ -0,0 +1,16 @@
set(GTEST_FOUND 0)
file(GLOB_RECURSE GTEST_INCLUDE_DIRS ${DEPENDENCIES_DIR}/gtest*/gtest.h)
LIST(GET GTEST_INCLUDE_DIRS -1 GTEST_INCLUDE_DIR_INNER)
GET_FILENAME_COMPONENT(GTEST_INCLUDE_DIR_INNER ${GTEST_INCLUDE_DIR_INNER} DIRECTORY)
GET_FILENAME_COMPONENT(GTEST_INCLUDE_DIR ${GTEST_INCLUDE_DIR_INNER} DIRECTORY CACHE)
GET_FILENAME_COMPONENT(GTEST_LIBRARY_DIR ${GTEST_INCLUDE_DIR} DIRECTORY CACHE)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(googletest DEFAULT_MSG GTEST_INCLUDE_DIR)
mark_as_advanced(
GTEST_INCLUDE_DIR
)
+11
View File
@@ -0,0 +1,11 @@
set(SPDLOG_FOUND 0)
file(GLOB_RECURSE SPDLOG_INCLUDE_DIR_INNER ${DEPENDENCIES_DIR}/spdlog*/spdlog.h)
GET_FILENAME_COMPONENT(SPDLOG_INCLUDE_DIR ${SPDLOG_INCLUDE_DIR_INNER} DIRECTORY CACHE)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spdlog DEFAULT_MSG SPDLOG_INCLUDE_DIR)
mark_as_advanced(
SPDLOG_INCLUDE_DIR
)
+14
View File
@@ -0,0 +1,14 @@
set(UDIS86_FOUND 0)
file(GLOB_RECURSE UDIS86_SOURCE_DIR_INNER ${DEPENDENCIES_DIR}/udis86*/udis86.h)
GET_FILENAME_COMPONENT(UDIS86_SOURCE_DIR ${UDIS86_SOURCE_DIR_INNER} DIRECTORY CACHE)
SET(UDIS86_BINARY_DIR ${UDIS86_SOURCE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Udis86 DEFAULT_MSG UDIS86_SOURCE_DIR)
mark_as_advanced(
UDIS86_SOURCE_DIR
UDIS86_BINARY_DIR
)
+130
View File
@@ -0,0 +1,130 @@
function(qt_transform_sources output_var sources)
# include output directory for the *_ui.h files
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# If using Qt, runs rcc, uic, moc and lrelease and populates final_sources
# with the list of actual source files to compile - if not using
# Qt we'll simply get all files not ending with .qrc, .ui, .h or .ts
foreach(file ${sources})
# CMake has no scope... clear this out
set(outfile )
get_filename_component(file_name "${file}" NAME)
# For some very odd reason, CMake's Visual Studio 2010 generator added
# a particular file twice (once as a None and once as CustomBuild)
# when that file used an absolute path... so convert our sources
# to relative paths if possible...
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" file "${file}")
# IGNORE these...
if(NOT "${file_name}" STREQUAL ".DS_Store" AND NOT "${file_name}" STREQUAL "Thumbs.db")
list(APPEND final_sources "${file}")
endif()
if("${file}" MATCHES "(.*)\\.(rc|manifest|plist|desktop)$")
source_group("Resources" FILES "${file}")
elseif("${file}" MATCHES "(.*)\\.(icns|ico)$")
source_group("Resources\\Icons" FILES "${file}")
elseif("${file}" MATCHES "(.*)\\.(png|jpg|jpeg|gif|tif|tiff|svg)$")
source_group("Resources\\Images" FILES "${file}")
elseif("${file}" MATCHES "(.*)\\.(xml|txt|rtf|pdf|url)$" AND NOT "${file_name}" STREQUAL "CMakeLists.txt")
source_group("Resources\\Other" FILES "${file}")
elseif(QT4_FOUND AND "${file}" MATCHES "(.*)\\.qrc$")
qt4_add_resources(outfile "${file}")
source_group("Qt Resources" FILES "${file}")
elseif(QT4_FOUND AND "${file}" MATCHES "(.*)\\.ui$")
qt4_wrap_ui(outfile "${file}")
source_group("Qt Forms" FILES "${file}")
elseif(QT4_FOUND AND "${file}" MATCHES "(.*)\\.ts$")
qt4_add_translation(outfile "${file}")
source_group("Qt Translations" FILES "${file}")
elseif(QT4_FOUND AND "${file}" MATCHES "(.*)\\.h$")
file(READ "${file}" file_memory_cache)
if("${file_memory_cache}" MATCHES "Q_OBJECT")
qt4_wrap_cpp(outfile "${file}")
endif()
endif()
# If we generated anything this round...
if(outfile)
list(APPEND final_sources "${outfile}")
# Don't quote outfile because it's a list containing
# the same filename twice (odd, I know...)
source_group("Generated Files" FILES ${outfile})
if(QtUtils_VERBOSE)
get_filename_component(outfile_name "${outfile}" NAME)
message("Generated ${outfile_name}")
endif()
endif()
endforeach()
# Remove any duplicate items from our final source list
list(REMOVE_DUPLICATES final_sources)
# Here is a nice trick to get real alphabetical ordering... most IDEs will
# display the filenames of source files without any path. However, because
# our list may include both relative and absolute paths, sorting it will
# not produce the desired result since the sort key is the entire path
# and not just the name part. So what we'll do is create a clone of our
# source list, but prepend the name of each file to its path, then sort that
# list, giving us true alphabetical ordering. Then we'll simply remove the
# prefixes after sorting to get our original list back, but sorted appropriately.
# We use four backslashes surrounded by colons to separate items since that sequence
# is extremely unlikely to ever appear in any filename.
foreach(final_source ${final_sources})
get_filename_component(final_source_name "${final_source}" NAME)
list(APPEND final_sources_sorter "${final_source_name}:\\\\\\\\:${final_source}")
endforeach()
list(SORT final_sources_sorter)
set(final_sources ) # clear out the real variable
foreach(final_source_sorted ${final_sources_sorter})
string(REGEX REPLACE "(.*):\\\\\\\\\\\\\\\\:" "" final_source_sorted "${final_source_sorted}")
list(APPEND final_sources "${final_source_sorted}")
endforeach()
# Sets the final_sources var to the parent scope so we can
# pass it to add_executable or add_library
set(${output_var} "${final_sources}" PARENT_SCOPE)
endfunction()
# Appends all possible Qt SDK location paths to CMAKE_PREFIX_PATH
# Currently only does anything on Windows
macro(use_qt_sdk_locations)
set(QT_ALL_VERSIONS
4.8.2
4.8.1
4.8.0
4.7.4
4.7.3
4.7.2
4.7.1
4.7.0
4.6.3
4.6.2
4.6.1
4.6.0
4.5.3
4.5.2
4.5.1
4.5.0
)
if(MSVC10)
foreach(qt_v ${QT_ALL_VERSIONS})
list(APPEND CMAKE_PREFIX_PATH "C:\\QtSDK\\Desktop\\Qt\\${qt_v}\\msvc2010")
endforeach()
elseif(MSVC90)
foreach(qt_v ${QT_ALL_VERSIONS})
list(APPEND CMAKE_PREFIX_PATH "C:\\QtSDK\\Desktop\\Qt\\${qt_v}\\msvc2008")
endforeach()
elseif(MINGW)
foreach(qt_v ${QT_ALL_VERSIONS})
list(APPEND CMAKE_PREFIX_PATH "C:\\QtSDK\\Desktop\\Qt\\${qt_v}\\mingw")
endforeach()
endif()
endmacro()
+134
View File
@@ -0,0 +1,134 @@
# Based on the Qt 5 processor detection code, so should be very accurate
# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h
# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64)
# Regarding POWER/PowerPC, just as is noted in the Qt source,
# "There are many more known variants/revisions that we do not handle/detect."
set(archdetect_c_code "
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#if defined(__ARM_ARCH_7__) \\
|| defined(__ARM_ARCH_7A__) \\
|| defined(__ARM_ARCH_7R__) \\
|| defined(__ARM_ARCH_7M__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
#error cmake_ARCH armv7
#elif defined(__ARM_ARCH_6__) \\
|| defined(__ARM_ARCH_6J__) \\
|| defined(__ARM_ARCH_6T2__) \\
|| defined(__ARM_ARCH_6Z__) \\
|| defined(__ARM_ARCH_6K__) \\
|| defined(__ARM_ARCH_6ZK__) \\
|| defined(__ARM_ARCH_6M__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
#error cmake_ARCH armv6
#elif defined(__ARM_ARCH_5TEJ__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
#error cmake_ARCH armv5
#else
#error cmake_ARCH arm
#endif
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|| defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error cmake_ARCH ppc64
#else
#error cmake_ARCH ppc
#endif
#endif
#error cmake_ARCH unknown
")
# Set ppc_support to TRUE before including this file or ppc and ppc64
# will be treated as invalid architectures since they are no longer supported by Apple
function(target_architecture output_var)
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
# On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
# First let's normalize the order of the values
# Note that it's not possible to compile PowerPC applications if you are using
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
# disable it by default
# See this page for more information:
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
set(osx_arch_ppc TRUE)
elseif("${osx_arch}" STREQUAL "i386")
set(osx_arch_i386 TRUE)
elseif("${osx_arch}" STREQUAL "x86_64")
set(osx_arch_x86_64 TRUE)
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
set(osx_arch_ppc64 TRUE)
else()
message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
endif()
endforeach()
# Now add all the architectures in our normalized order
if(osx_arch_ppc)
list(APPEND ARCH ppc)
endif()
if(osx_arch_i386)
list(APPEND ARCH i386)
endif()
if(osx_arch_x86_64)
list(APPEND ARCH x86_64)
endif()
if(osx_arch_ppc64)
list(APPEND ARCH ppc64)
endif()
else()
file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")
enable_language(C)
# Detect the architecture in a rather creative way...
# This compiles a small C program which is a series of ifdefs that selects a
# particular #error preprocessor directive whose message string contains the
# target architecture. The program will always fail to compile (both because
# file is not a valid C program, and obviously because of the presence of the
# #error preprocessor directives... but by exploiting the preprocessor in this
# way, we can detect the correct target architecture even when cross-compiling,
# since the program itself never needs to be run (only the compiler/preprocessor)
try_run(
run_result_unused
compile_result_unused
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/arch.c"
COMPILE_OUTPUT_VARIABLE ARCH
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
# Parse the architecture name from the compiler output
string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
# Get rid of the value marker leaving just the architecture name
string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
# If we are compiling with an unknown architecture this variable should
# already be set to "unknown" but in the case that it's empty (i.e. due
# to a typo in the code), then set it to unknown
if (NOT ARCH)
set(ARCH unknown)
endif()
endif()
set(${output_var} "${ARCH}" PARENT_SCOPE)
endfunction()
File diff suppressed because it is too large Load Diff
+125
View File
@@ -0,0 +1,125 @@
#==================================================================================================#
# #
# Copyright 2012 MaidSafe.net limited #
# #
# This MaidSafe Software is licensed to you under (1) the MaidSafe.net Commercial License, #
# version 1.0 or later, or (2) The General Public License (GPL), version 3, depending on which #
# licence you accepted on initial access to the Software (the "Licences"). #
# #
# By contributing code to the MaidSafe Software, or to this project generally, you agree to be #
# bound by the terms of the MaidSafe Contributor Agreement, version 1.0, found in the root #
# directory of this project at LICENSE, COPYING and CONTRIBUTOR respectively and also available #
# at: http://www.maidsafe.net/licenses #
# #
# Unless required by applicable law or agreed to in writing, the MaidSafe Software distributed #
# under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF #
# ANY KIND, either express or implied. #
# #
# See the Licences for the specific language governing permissions and limitations relating to #
# use of the MaidSafe Software. #
# #
#==================================================================================================#
# #
# Module used to run Google Protocol Buffers compiler against .proto files in a given source #
# directory. #
# #
# The function searches the source directory for .proto files and adds a custom command to #
# generate the .pb.cc and pb.h files to an output directory in the build tree. Any CMake target #
# which includes these files will cause them to be generated if they don't currently exist. #
# #
# The output directory is passed to 'include_directories' to add it to the includes search path. #
# #
# The function's signature contains the following variables: #
# * BaseName - name of variable which forms prefix of output variables. #
# * ProtoRootDir - full path to a directory. This is passed as the first --proto_path arg #
# argument and so defines the "missing" part of the relative path used in #
# the generated pb.ccs' #include statements. #
# * ProtoRelativeDir - path relative to ${ProtoRootDir} which will be searched for .proto #
# files. May contain 0 .proto files. #
# #
# Any extra variables passed are assumed to be full paths to import directories, and are passed #
# as --proto_path arguments to protoc in the order in which they are passed. #
# #
# The function exports the following variables to the parent namespace: #
# * ${BaseName}ProtoSources - list of full path of all generated .pb.cc files. #
# * ${BaseName}ProtoHeaders - list of full path of all generated .pb.h files. #
# * ${BaseName}Protos - list of full path to all .proto files in the source directory #
# along with contents of '${BaseName}ProtoSources' and #
# '${BaseName}ProtoHeaders' #
# #
#==================================================================================================#
function(add_protoc_command BaseName ProtoRootDir ProtoRelativeDir)
set(${BaseName}ProtoSources "" PARENT_SCOPE)
set(${BaseName}ProtoHeaders "" PARENT_SCOPE)
set(${BaseName}Protos "" PARENT_SCOPE)
set(GeneratedProtoRootDir ${CMAKE_BINARY_DIR}/GeneratedProtoFiles)
include_directories(${GeneratedProtoRootDir})
# Get list of .proto files
file(GLOB ProtoFiles RELATIVE ${ProtoRootDir} ${ProtoRootDir}/${ProtoRelativeDir}/*.proto)
# Search for and remove old generated .pb.cc and .pb.h files in the output dir
file(GLOB ExistingPbFiles
RELATIVE ${GeneratedProtoRootDir}
${GeneratedProtoRootDir}/${ProtoRelativeDir}/*.pb.*)
list(LENGTH ExistingPbFiles ExistingPbFilesCount)
string(REGEX REPLACE "([^;]*)\\.proto" "\\1.pb.cc;\\1.pb.h" GeneratedFiles "${ProtoFiles}")
if(ExistingPbFilesCount)
if(GeneratedFiles)
list(REMOVE_ITEM ExistingPbFiles ${GeneratedFiles})
endif()
foreach(ExistingPbFile ${ExistingPbFiles})
file(REMOVE ${GeneratedProtoRootDir}/${ExistingPbFile})
message(STATUS "Removed ${ExistingPbFile}")
endforeach()
endif()
if(NOT ProtoFiles)
return()
endif()
# Set up protoc arguments
set(ProtocArgs "--proto_path=${ProtoRootDir}")
set(ProtoImportDirs ${ARGN})
foreach(ProtoImportDir ${ProtoImportDirs})
list(APPEND ProtocArgs "--proto_path=${ProtoImportDir}")
endforeach()
list(REMOVE_DUPLICATES ProtocArgs)
list(APPEND ProtocArgs "--cpp_out=${GeneratedProtoRootDir}")
if(MSVC)
list(APPEND ProtocArgs "--error_format=msvs")
else()
list(APPEND ProtocArgs "--error_format=gcc")
endif()
# Add custom command to generate CC and header files
unset(GeneratedProtoFiles)
unset(GeneratedProtoSources)
unset(GeneratedProtoHeaders)
file(MAKE_DIRECTORY ${GeneratedProtoRootDir})
foreach(ProtoFile ${ProtoFiles})
get_filename_component(ProtoFileNameWe ${ProtoFile} NAME_WE)
set(GeneratedSource ${GeneratedProtoRootDir}/${ProtoRelativeDir}/${ProtoFileNameWe}.pb.cc)
set(GeneratedHeader ${GeneratedProtoRootDir}/${ProtoRelativeDir}/${ProtoFileNameWe}.pb.h)
list(APPEND GeneratedProtoSources "${GeneratedSource}")
list(APPEND GeneratedProtoHeaders "${GeneratedHeader}")
list(APPEND Protos "${ProtoRootDir}/${ProtoFile}")
add_custom_command(OUTPUT ${GeneratedSource} ${GeneratedHeader}
COMMAND $<TARGET_FILE:protoc> ${ProtocArgs} ${ProtoRootDir}/${ProtoFile}
DEPENDS protoc ${ProtoRootDir}/${ProtoFile}
COMMENT "Generated files from ${ProtoFileNameWe}.proto"
VERBATIM)
endforeach()
set_source_files_properties(${GeneratedProtoSources} ${GeneratedProtoHeaders} PROPERTIES GENERATED TRUE)
if(MSVC)
set_source_files_properties(${GeneratedProtoSources} PROPERTIES COMPILE_FLAGS "/W0")
else()
set_source_files_properties(${GeneratedProtoSources} PROPERTIES COMPILE_FLAGS "-w")
endif()
set(${BaseName}ProtoSources ${GeneratedProtoSources} PARENT_SCOPE)
set(${BaseName}ProtoHeaders ${GeneratedProtoHeaders} PARENT_SCOPE)
set(${BaseName}Protos ${Protos} ${GeneratedProtoSources} ${GeneratedProtoHeaders} PARENT_SCOPE)
endfunction()
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
AsmJit - Complete x86/x64 JIT and Remote Assembler for C++
Copyright (c) 2008-2015, Petr Kobalicek <kobalicek.petr@gmail.com>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
+23
View File
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+9
View File
@@ -0,0 +1,9 @@
Copyright (c) 2012 - 2015, Victor Zverovich
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+28
View File
@@ -0,0 +1,28 @@
Copyright 2008, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+175
View File
@@ -0,0 +1,175 @@
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 3, which is displayed below.
This license makes reference to the version 3 of the GNU General
Public License, which you can find in the LICENSE.GPLv3 file.
-------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
licensedocument, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, “this License” refers to version 3 of the GNU Lesser
General Public License, and the “GNU GPL” refers to version 3 of the
GNU General Public License.
“The Library” refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An “Application” is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A “Combined Work” is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the “Linked
Version”.
The “Minimal Corresponding Source” for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort
to ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this
license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of
the Library contained in the Combined Work and reverse engineering for
debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this
license document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of
this License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with
the Library. A suitable mechanism is one that (a) uses at run
time a copy of the Library already present on the user's
computer system, and (b) will operate properly with a modified
version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would
otherwise be required to provide such information under section 6
of the GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option
4d0, the Installation Information must accompany the Minimal
Corresponding Source and Corresponding Application Code. If you
use option 4d1, you must provide the Installation Information in
the manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library
side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of
it is a work based on the Library, and explaining where to find
the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
as you received it specifies that a certain numbered version of the
GNU Lesser General Public License “or any later version” applies to
it, you have the option of following the terms and conditions either
of that published version or of any later version published by the
Free Software Foundation. If the Library as you received it does not
specify a version number of the GNU Lesser General Public License,
you may choose any version of the GNU Lesser General Public License
ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the Library.

Some files were not shown because too many files have changed in this diff Show More