forked from TanninOne/usvfs
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
129 changed files
with
19,463 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "[email protected]") | ||
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |
Oops, something went wrong.