فهرست منبع

Restructure cmake, move CmakeLists.txt to root.

Michael Ragazzon 6 سال پیش
والد
کامیت
1dd04e6118

+ 3 - 3
.appveyor.yml

@@ -14,15 +14,15 @@ install:
 - cmd: >-
     cd Dependencies
 
-    appveyor DownloadFile https://github.com/ubawurinna/freetype-windows-binaries/releases/download/v2.10.0/freetype-%FREETYPE_VER%.zip
+    appveyor DownloadFile https://github.com/ubawurinna/freetype-windows-binaries/releases/download/v%FREETYPE_VER%/freetype-%FREETYPE_VER%.zip
 
     unzip -o freetype-%FREETYPE_VER%.zip
 
     mv win64 lib
 
-    cd ../Build
+    cd ..
 
-    cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% -DBUILD_SAMPLES=%BUILD_SAMPLES% -DSKIP_DIRECTX_SAMPLES=ON .
+    cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% -DBUILD_SAMPLES=%BUILD_SAMPLES% .
 build:
   parallel: true
   verbosity: minimal

+ 7 - 8
.gitignore

@@ -1,17 +1,16 @@
+# Primary cmake build target
+/Build/
+
 # Ignore MacOSX directory info
 .DS_Store
+
 # VS user project files
+.vs/
 *.suo
 *.user
 *.opensdf
-bin/*
-bin64/*
 *.dir/
 Win32/
+x64/
 
-/lib/
-RmlCore.dir/
-RmlControls.dir/
-RmlDebugger.dir/
-
-Win32/
+/Distribution/

+ 1 - 3
.travis.yml

@@ -51,12 +51,10 @@ before_install:
   - if [[ -n "${MATRIX_EVAL}" ]]; then eval "${MATRIX_EVAL}" ; fi
 
 install:
-  - cd "$TRAVIS_BUILD_DIR/Build"
+  - cd "$TRAVIS_BUILD_DIR"
   - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then cmake -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON .; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -G Xcode .; fi
-  - cd "$TRAVIS_BUILD_DIR"
 
 script:
-  - cd Build
   - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then make -j4; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -project rmlui.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD; fi

+ 0 - 165
Build/.gitignore

@@ -1,165 +0,0 @@
-/build/
-CMakeCache.txt
-cmake_install.cmake
-CMakeFiles
-CMakeScripts
-RmlUi.xcodeproj
-Debug
-Debug-iphoneos
-Debug-iphonesimulator
-Release
-Release-iphoneos
-Release-iphonesimulator
-DerivedData
-RmlUi.build/Debug/RmlCore.build
-RmlUi.build
-
-Makefile
-_rmlcontrols.so
-_rmlcore.so
-customlog
-datagrid
-datagrid_tree
-drag
-invaders
-luainvaders
-sdl2
-sfml2
-scores.txt
-options.dat
-log.txt
-RmlCore.so
-RmlCore.so.*
-RmlCore.a
-RmlControls.so
-RmlControls.so.*
-RmlControls.a
-RmlDebugger.so
-RmlDebugger.so.*
-RmlDebugger.a
-RmlCoreLua.so
-RmlCoreLua.so.*
-RmlCoreLua.a
-RmlControlsLua.so
-RmlControlsLua.so.*
-RmlControlsLua.a
-libshell.a
-loaddocument
-template
-treeview
-tutorial_drag
-
-#VisualStudio Project artifacts
-RmlUi.sln
-RmlUi.sdf
-ALL_BUILD.vcproj
-ALL_BUILD.vcxproj
-ALL_BUILD.vcxproj.filters
-INSTALL.vcproj
-INSTALL.vcxproj
-INSTALL.vcxproj.filters
-ZERO_CHECK.vcproj
-ZERO_CHECK.vcxproj
-ZERO_CHECK.vcxproj.filters
-RmlCore.vcproj
-RmlCore.vcxproj
-RmlCore.vcxproj.filters
-RmlControls.vcproj
-RmlControls.vcxproj
-RmlControls.vcxproj.filters
-RmlDebugger.vcproj
-RmlDebugger.vcxproj
-RmlDebugger.vcxproj.filters
-_rmlcore.vcproj
-_rmlcore.vcxproj
-_rmlcore.vcxproj.filters
-_rmlcontrols.vcproj
-_rmlcontrols.vcxproj
-_rmlcontrols.vcxproj.filters
-RmlCoreLua.vcproj
-RmlCoreLua.vcxproj
-RmlCoreLua.vcxproj.filters
-RmlControlsLua.vcproj
-RmlControlsLua.vcxproj
-RmlControlsLua.vcxproj.filters
-customlog.vcproj
-customlog.vcxproj
-customlog.vcxproj.filters
-datagrid.vcproj
-datagrid.vcxproj
-datagrid.vcxproj.filters
-datagrid_tree.vcproj
-datagrid_tree.vcxproj
-datagrid_tree.vcxproj.filters
-drag.vcproj
-drag.vcxproj
-drag.vcxproj.filters
-invaders.vcproj
-invaders.vcxproj
-invaders.vcxproj.filters
-luainvaders.vcproj
-luainvaders.vcxproj
-luainvaders.vcxproj.filters
-loaddocument.vcproj
-loaddocument.vcxproj
-loaddocument.vcxproj.filters
-shell.vcproj
-shell.vcxproj
-shell.vcxproj.filters
-template.vcproj
-template.vcxproj
-template.vcxproj.filters
-treeview.vcproj
-treeview.vcxproj
-treeview.vcxproj.filters
-tutorial_drag.vcproj
-tutorial_drag.vcxproj
-tutorial_drag.vcxproj.filters
-sfml2.vcproj
-sfml2.vcxproj
-sfml2.vcxproj.filters
-sdl2.vcproj
-sdl2.vcxproj
-sdl2.vcxproj.filters
-
-#Win32 artifacts
-RmlCore.dll
-RmlCore.lib
-RmlControls.dll
-RmlControls.lib
-RmlDebugger.dll
-RmlDebugger.lib
-RmlCoreLua.dll
-RmlControlsLua.dll
-
-#Ming32 artifacts
-RmlCore.dll.a
-RmlControls.dll.a
-RmlDebugger.dll.a
-RmlCoreLua.dll.a
-RmlControlsLua.dll.a
-
-#OSX Artifacts
-RmlCore.dylib
-RmlCore.*.dylib
-RmlCoreLua.dylib
-RmlCoreLua.*.dylib
-RmlControls.dylib
-RmlControls.*.dylib
-RmlControlsLua.dylib
-RmlControlsLua.*.dylib
-RmlDebugger.dylib
-RmlDebugger.*.dylib
-_rmlcore.dylib
-_rmlcore.*.dylib
-_rmlcontrols.dylib
-_rmlcontrols.*.dylib
-customlog.app
-datagrid.app
-datagrid_tree.app
-drag.app
-invaders.app
-loaddocument.app
-template.app
-treeview.app
-tutorial_drag.app

+ 0 - 142
Build/cmake/v2fixes/FindFreetype-v2fix.cmake

@@ -1,142 +0,0 @@
-#.rst:
-# FindFreetype
-# ------------
-#
-# Locate FreeType library
-#
-# This module defines
-#
-# ::
-#
-#   FREETYPE_LIBRARIES, the library to link against
-#   FREETYPE_FOUND, if false, do not try to link to FREETYPE
-#   FREETYPE_INCLUDE_DIRS, where to find headers.
-#   FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
-#   This is the concatenation of the paths:
-#   FREETYPE_INCLUDE_DIR_ft2build
-#   FREETYPE_INCLUDE_DIR_freetype2
-#
-#
-#
-# $FREETYPE_DIR is an environment variable that would correspond to the
-# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Created by Eric Wing.
-# Modifications by Alexander Neundorf.
-# This file has been renamed to "FindFreetype.cmake" instead of the correct
-# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
-
-# Ugh, FreeType seems to use some #include trickery which
-# makes this harder than it should be. It looks like they
-# put ft2build.h in a common/easier-to-find location which
-# then contains a #include to a more specific header in a
-# more specific location (#include <freetype/config/ftheader.h>).
-# Then from there, they need to set a bunch of #define's
-# so you can do something like:
-# #include FT_FREETYPE_H
-# Unfortunately, using CMake's mechanisms like include_directories()
-# wants explicit full paths and this trickery doesn't work too well.
-# I'm going to attempt to cut out the middleman and hope
-# everything still works.
-find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
-  HINTS
-    ENV FREETYPE_DIR
-  PATHS
-    /usr/X11R6
-    /usr/local/X11R6
-    /usr/local/X11
-    /usr/freeware
-    ENV GTKMM_BASEPATH
-    [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
-  PATH_SUFFIXES include/freetype2 include
-)
-
-find_path(FREETYPE_INCLUDE_DIR_freetype2
-  NAMES
-    freetype/config/ftheader.h
-    config/ftheader.h
-  HINTS
-    ENV FREETYPE_DIR
-  PATHS
-    /usr/X11R6
-    /usr/local/X11R6
-    /usr/local/X11
-    /usr/freeware
-    ENV GTKMM_BASEPATH
-    [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
-  PATH_SUFFIXES include/freetype2 include
-)
-
-find_library(FREETYPE_LIBRARY
-  NAMES freetype libfreetype freetype219
-  HINTS
-    ENV FREETYPE_DIR
-  PATH_SUFFIXES lib
-  PATHS
-    /usr/X11R6
-    /usr/local/X11R6
-    /usr/local/X11
-    /usr/freeware
-    ENV GTKMM_BASEPATH
-    [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
-)
-
-# set the user variables
-if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
-  set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
-  list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
-endif()
-set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
-
-if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
-  set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
-elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
-  set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
-endif()
-
-if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
-    file(STRINGS "${FREETYPE_H}" freetype_version_str
-         REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
-
-    unset(FREETYPE_VERSION_STRING)
-    foreach(VPART MAJOR MINOR PATCH)
-        foreach(VLINE ${freetype_version_str})
-            if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
-                string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
-                       FREETYPE_VERSION_PART "${VLINE}")
-                if(FREETYPE_VERSION_STRING)
-                    set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
-                else()
-                    set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
-                endif()
-                unset(FREETYPE_VERSION_PART)
-            endif()
-        endforeach()
-    endforeach()
-endif()
-
-
-# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
-# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
-                                  REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
-                                  VERSION_VAR FREETYPE_VERSION_STRING)
-
-mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)

+ 0 - 190
Build/cmake/v2fixes/FindLua-v2fix.cmake

@@ -1,190 +0,0 @@
-#.rst:
-# FindLua
-# -------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-#   LUA_FOUND          - if false, do not try to link to Lua
-#   LUA_LIBRARIES      - both lua and lualib
-#   LUA_INCLUDE_DIR    - where to find lua.h
-#   LUA_VERSION_STRING - the version of Lua found
-#   LUA_VERSION_MAJOR  - the major version of Lua
-#   LUA_VERSION_MINOR  - the minor version of Lua
-#   LUA_VERSION_PATCH  - the patch version of Lua
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-#   #include "lua.h"
-#
-# and not
-#
-# ::
-#
-#   #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-# Copyright 2013 Rolf Eike Beer <[email protected]>
-#
-# 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 names of Kitware, Inc., the Insight Software Consortium,
-# nor the names of their 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
-# HOLDER 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.
-#===========================================================================
-
-unset(_lua_include_subdirs)
-unset(_lua_library_names)
-
-# this is a function only to have all the variables inside go away automatically
-function(set_lua_version_vars)
-    set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
-
-    if (Lua_FIND_VERSION_EXACT)
-        if (Lua_FIND_VERSION_COUNT GREATER 1)
-            set(lua_append_versions ${Lua_FIND_VERSION_MAJOR} ${Lua_FIND_VERSION_MINOR})
-        endif ()
-    elseif (Lua_FIND_VERSION)
-        # once there is a different major version supported this should become a loop
-        if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
-            if (Lua_FIND_VERSION_COUNT EQUAL 1)
-                set(lua_append_versions ${LUA_VERSIONS5})
-            else ()
-                foreach (subver IN LISTS LUA_VERSIONS5)
-                    if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
-                        list(APPEND lua_append_versions ${subver})
-                    endif ()
-                endforeach ()
-            endif ()
-        endif ()
-    else ()
-        # once there is a different major version supported this should become a loop
-        set(lua_append_versions ${LUA_VERSIONS5})
-    endif ()
-
-    foreach (ver IN LISTS lua_append_versions)
-        string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
-        list(APPEND _lua_include_subdirs
-             include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
-             include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-             include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-        )
-        list(APPEND _lua_library_names
-             lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
-             lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-             lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-        )
-    endforeach ()
-
-    set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
-    set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
-endfunction(set_lua_version_vars)
-
-set_lua_version_vars()
-
-find_path(LUA_INCLUDE_DIR lua.h
-  HINTS
-    ENV LUA_DIR
-  PATH_SUFFIXES ${_lua_include_subdirs} include/lua include
-  PATHS
-  ~/Library/Frameworks
-  /Library/Frameworks
-  /sw # Fink
-  /opt/local # DarwinPorts
-  /opt/csw # Blastwave
-  /opt
-)
-unset(_lua_include_subdirs)
-
-find_library(LUA_LIBRARY
-  NAMES ${_lua_library_names} lua
-  HINTS
-    ENV LUA_DIR
-  PATH_SUFFIXES lib
-  PATHS
-  ~/Library/Frameworks
-  /Library/Frameworks
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
-)
-unset(_lua_library_names)
-
-if (LUA_LIBRARY)
-    # include the math library for Unix
-    if (UNIX AND NOT APPLE AND NOT BEOS)
-        find_library(LUA_MATH_LIBRARY m)
-        set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
-    # For Windows and Mac, don't need to explicitly include the math library
-    else ()
-        set(LUA_LIBRARIES "${LUA_LIBRARY}")
-    endif ()
-endif ()
-
-if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
-    # At least 5.[012] have different ways to express the version
-    # so all of them need to be tested. Lua 5.2 defines LUA_VERSION
-    # and LUA_RELEASE as joined by the C preprocessor, so avoid those.
-    file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_strings
-         REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
-
-    string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
-    if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
-        set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
-    else ()
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
-        if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
-            string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
-        endif ()
-        string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
-        string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
-        string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
-    endif ()
-
-    unset(lua_version_strings)
-endif()
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
-# all listed variables are TRUE
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
-                                  REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
-                                  VERSION_VAR LUA_VERSION_STRING)
-
-mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)

+ 279 - 296
Build/CMakeLists.txt → CMakeLists.txt

@@ -2,11 +2,13 @@
 # Build script for RmlUi ===========
 #===================================
 
+cmake_minimum_required(VERSION 3.0)
+
 if(APPLE)
 	# This has to be before most other options so CMake properly handles the 
 	# compiler variables, it MUST bebefore the project() definition
 	if(IOS_PLATFORM)
-		set(CMAKE_TOOLCHAIN_FILE cmake/Platform/iOS.cmake)
+		set(CMAKE_TOOLCHAIN_FILE Cmake/Platform/iOS.cmake)
 	endif(IOS_PLATFORM)
 
 	option(BUILD_UNIVERSAL_BINARIES "Build universal binaries for all architectures supported" ON)
@@ -29,12 +31,9 @@ if(APPLE)
 	endif (NOT CMAKE_OSX_ARCHITECTURES AND BUILD_UNIVERSAL_BINARIES)
 endif(APPLE)
 
-# We use the new OSX_ARCHITECTURES property
-# and GNUInstallDirs module
-cmake_minimum_required(VERSION 2.8.5)
-
 if(COMMAND cmake_policy)
-  cmake_policy(SET CMP0015 NEW)
+	cmake_policy(SET CMP0015 NEW)
+	cmake_policy(SET CMP0074 NEW)
 endif(COMMAND cmake_policy)
 
 # Enable the use of MACOSX_RPATH by default for CMake v3.0+; this effectively 
@@ -46,7 +45,7 @@ endif(COMMAND cmake_policy)
 # cmake --help-policy cmp0042
 # http://www.kitware.com/blog/home/post/510
 if(POLICY CMP0042)
-  cmake_policy(SET CMP0042 NEW)
+	cmake_policy(SET CMP0042 NEW)
 endif(POLICY CMP0042)
 
 project(RmlUi C CXX)
@@ -61,13 +60,7 @@ set(RMLUI_VERSION_TWEAK 0)
 set(PROJECT_VERSION ${RMLUI_VERSION_MAJOR}.${RMLUI_VERSION_MINOR}.${RMLUI_VERSION_PATCH}.${RMLUI_VERSION_TWEAK})
 
 # Search in the 'cmake' directory for additional CMake modules.
-list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
-
-# Old versions of CMake need some updated Modules, but we don't want
-# to override newer versions of CMake which have working versions
-if(CMAKE_MAJOR_VERSION LESS 3)
-	list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/v2fixes)
-endif()
+list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Cmake;${PROJECT_SOURCE_DIR}/Cmake/Modules)
 
 #===================================
 # Environment tests ================
@@ -83,23 +76,23 @@ include(TestForSTDNamespace)
 #===================================
 
 if(NOT DEFINED ENV{FREETYPE_DIR})
-	set(ENV{FREETYPE_DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
+	set(ENV{FREETYPE_DIR} "${PROJECT_SOURCE_DIR}/Dependencies")
 endif()
 
 if(NOT DEFINED ENV{LUA_DIR})
-	set(ENV{LUA_DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
+	set(ENV{LUA_DIR} "${PROJECT_SOURCE_DIR}/Dependencies")
 endif()
 
 if(NOT DEFINED ENV{SDL2DIR})
-	set(ENV{SDL2DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
+	set(ENV{SDL2DIR} "${PROJECT_SOURCE_DIR}/Dependencies")
 endif()
 
 if(NOT DEFINED ENV{SDL2_IMAGE_DIR})
-	set(ENV{SDL2_IMAGE_DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
+	set(ENV{SDL2_IMAGE_DIR} "${PROJECT_SOURCE_DIR}/Dependencies")
 endif()
 
 if(NOT DEFINED ENV{SFML_ROOT})
-	set(ENV{SFML_ROOT} "${PROJECT_SOURCE_DIR}/../Dependencies")
+	set(ENV{SFML_ROOT} "${PROJECT_SOURCE_DIR}/Dependencies")
 endif()
 
 #===================================
@@ -118,9 +111,9 @@ endif(APPLE)
 #===================================
 
 if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE Release CACHE STRING
-        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
-        FORCE)
+	set(CMAKE_BUILD_TYPE Release CACHE STRING
+		"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+		FORCE)
 endif()
 
 if(NOT IOS)
@@ -135,8 +128,8 @@ endif()
 
 option(BUILD_SAMPLES "Build samples" OFF)
 if(WIN32)
-	option(SKIP_DIRECTX_SAMPLES "Skip build of all DirectX related samples.  Only applies if BUILD_SAMPLES is ON" OFF)
-	option(SKIP_DIRECTX10_SAMPLE "Skip build of DirectX 10 related sample.  Only applies if BUILD_SAMPLES is ON and SKIP_DIRECTX_SAMPLES is OFF" OFF)
+	option(SKIP_DIRECTX_SAMPLES "Skip build of all DirectX related samples. Only applies if BUILD_SAMPLES is ON" ON)
+	option(SKIP_DIRECTX10_SAMPLE "Skip build of DirectX 10 related sample. Only applies if BUILD_SAMPLES is ON and SKIP_DIRECTX_SAMPLES is OFF" ON)
 endif()
 
 if(APPLE)
@@ -169,32 +162,21 @@ endif()
 #===================================
 
 # FreeType
-if(CMAKE_MAJOR_VERSION LESS 3)
-	# Freetype changed the layout of its header files, we  need to use 
-	# the FindFreetype module from cmake v3 at least, included here
-	find_package(Freetype-v2fix REQUIRED)	
-else()
-	find_package(Freetype REQUIRED)	
-endif()
+find_package(Freetype REQUIRED)	
 
 if(FREETYPE_FOUND)
-		include_directories(${FREETYPE_INCLUDE_DIRS})
-		link_directories(${FREETYPE_LINK_DIRS})
-		list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARY})
+	include_directories(${FREETYPE_INCLUDE_DIRS})
+	link_directories(${FREETYPE_LINK_DIRS})
+	list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARY})
 endif()
-mark_as_advanced(FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARY FREETYPE_LINK_DIRECTORIES)
 
 #Lua
 if(BUILD_LUA_BINDINGS)
-    if(CMAKE_MAJOR_VERSION LESS 3)
-        find_package(Lua-v2fix)
-    else()
-        find_package(Lua)
-    endif()
-    if(LUA_FOUND)
-        include_directories(${LUA_INCLUDE_DIR})
-        list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES})
-    endif()
+	find_package(Lua)
+	if(LUA_FOUND)
+		include_directories(${LUA_INCLUDE_DIR})
+		list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES})
+	endif()
 endif()
 
 
@@ -202,10 +184,8 @@ endif()
 # Setup paths ======================
 #===================================
 
-set(PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/..)
-
 include_directories(
-    ${PROJECT_SOURCE_DIR}/Include
+	${PROJECT_SOURCE_DIR}/Include
 )
 
 # Include list of source files
@@ -219,19 +199,19 @@ if(NOT BUILD_FRAMEWORK)
 set(LIBRARIES Core Controls Debugger)
 
 foreach(library ${LIBRARIES})
-    set(NAME Rml${library})
-
-    add_library(${NAME}
-                        ${${library}_HDR_FILES}
-                        ${${library}_PUB_HDR_FILES}
-                        ${MASTER_${library}_PUB_HDR_FILES}
-			${${library}_SRC_FILES}
-    )
-
-    set_target_properties(${NAME} PROPERTIES
-                           VERSION ${PROJECT_VERSION}
-                           SOVERSION ${RMLUI_VERSION_MAJOR}
-    )
+	set(NAME Rml${library})
+
+	add_library(${NAME}
+		${${library}_HDR_FILES}
+		${${library}_PUB_HDR_FILES}
+		${MASTER_${library}_PUB_HDR_FILES}
+		${${library}_SRC_FILES}
+	)
+
+	set_target_properties(${NAME} PROPERTIES
+	   VERSION ${PROJECT_VERSION}
+	   SOVERSION ${RMLUI_VERSION_MAJOR}
+	)
 	
 	if (MSVC)
 		target_compile_options(${NAME} PUBLIC "/MP")
@@ -239,16 +219,16 @@ foreach(library ${LIBRARIES})
 	
 	set_property(TARGET ${NAME} PROPERTY CXX_STANDARD 11)
 	set_property(TARGET ${NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
-    
-    install(TARGETS ${NAME}
-            EXPORT RmlUiTargets
-            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-    )
+	
+	install(TARGETS ${NAME}
+		EXPORT RmlUiTargets
+		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+	)
 	
 
-    set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
+	set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
 endforeach(library)
 
 if (MSVC)
@@ -289,68 +269,68 @@ else(NOT BUILD_FRAMEWORK)
 		SOVERSION ${RMLUI_VERSION_MAJOR}
 	)
 
-		set_property(SOURCE ${MASTER_PUB_HDR_FILES}
-			PROPERTY MACOSX_PACKAGE_LOCATION Headers
-		)
-		set_property(SOURCE ${Core_PUB_HDR_FILES}
-			PROPERTY MACOSX_PACKAGE_LOCATION Headers/Core
-		)
-		set_property(SOURCE ${Controls_PUB_HDR_FILES}
-			PROPERTY MACOSX_PACKAGE_LOCATION Headers/Controls
-		)
-		set_property(SOURCE ${Debugger_PUB_HDR_FILES}
-			PROPERTY MACOSX_PACKAGE_LOCATION Headers/Debugger
-		)
-		set_target_properties(${NAME} PROPERTIES
-			FRAMEWORK TRUE
-			FRAMEWORK_VERSION ${PROJECT_VERSION}
-			MACOSX_FRAMEWORK_IDENTIFIER com.rmlui.${NAME}
-			MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${RMLUI_VERSION_MAJOR}.${RMLUI_VERSION_MINOR}.${RMLUI_VERSION_PATCH}.${RMLUI_VERSION_TWEAK}
-			MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
-			XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
-			PUBLIC_HEADER ${MASTER_PUB_HDR_FILES}
-		)
+	set_property(SOURCE ${MASTER_PUB_HDR_FILES}
+		PROPERTY MACOSX_PACKAGE_LOCATION Headers
+	)
+	set_property(SOURCE ${Core_PUB_HDR_FILES}
+		PROPERTY MACOSX_PACKAGE_LOCATION Headers/Core
+	)
+	set_property(SOURCE ${Controls_PUB_HDR_FILES}
+		PROPERTY MACOSX_PACKAGE_LOCATION Headers/Controls
+	)
+	set_property(SOURCE ${Debugger_PUB_HDR_FILES}
+		PROPERTY MACOSX_PACKAGE_LOCATION Headers/Debugger
+	)
+	set_target_properties(${NAME} PROPERTIES
+		FRAMEWORK TRUE
+		FRAMEWORK_VERSION ${PROJECT_VERSION}
+		MACOSX_FRAMEWORK_IDENTIFIER com.rmlui.${NAME}
+		MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${RMLUI_VERSION_MAJOR}.${RMLUI_VERSION_MINOR}.${RMLUI_VERSION_PATCH}.${RMLUI_VERSION_TWEAK}
+		MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
+		XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
+		PUBLIC_HEADER ${MASTER_PUB_HDR_FILES}
+	)
 
-    install(TARGETS ${NAME}
-            EXPORT RmlUiTargets
-            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-            FRAMEWORK DESTINATION Library/Frameworks
-    )
+	install(TARGETS ${NAME}
+		EXPORT RmlUiTargets
+		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+		FRAMEWORK DESTINATION Library/Frameworks
+	)
 
-    set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
+	set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
 endif(NOT BUILD_FRAMEWORK)
 
 # Build Lua bindings
 if(BUILD_LUA_BINDINGS)
-    set(LIBRARIES Core Controls)
-
-    foreach(library ${LIBRARIES})
-        set(NAME Rml${library}Lua)
-
-        add_library(${NAME} ${Lua${library}_SRC_FILES}
-                            ${Lua${library}_HDR_FILES}
-                            ${Lua${library}_PUB_HDR_FILES}
-        )
-
-        set_target_properties(${NAME} PROPERTIES
-                           VERSION ${PROJECT_VERSION}
-                           SOVERSION ${RMLUI_VERSION_MAJOR}
-        )
-
-        set_property(TARGET ${NAME} PROPERTY CXX_STANDARD 11)
-        set_property(TARGET ${NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
-
-        install(TARGETS ${NAME}
-            EXPORT RmlUiTargets
-            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-        )
-        
-        set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
-    endforeach(library)
+	set(LIBRARIES Core Controls)
+
+	foreach(library ${LIBRARIES})
+		set(NAME Rml${library}Lua)
+
+		add_library(${NAME} ${Lua${library}_SRC_FILES}
+			${Lua${library}_HDR_FILES}
+			${Lua${library}_PUB_HDR_FILES}
+		)
+
+		set_target_properties(${NAME} PROPERTIES
+		   VERSION ${PROJECT_VERSION}
+		   SOVERSION ${RMLUI_VERSION_MAJOR}
+		)
+
+		set_property(TARGET ${NAME} PROPERTY CXX_STANDARD 11)
+		set_property(TARGET ${NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+
+		install(TARGETS ${NAME}
+			EXPORT RmlUiTargets
+			LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+			ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+			RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+		)
+		
+		set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
+	endforeach(library)
 endif()
 
 
@@ -384,54 +364,54 @@ endif()
 # Build and link the samples
 macro(bl_sample NAME)
 	if (WIN32)
-    	add_executable(${NAME} WIN32 ${${NAME}_SRC_FILES} ${${NAME}_HDR_FILES} )
+		add_executable(${NAME} WIN32 ${${NAME}_SRC_FILES} ${${NAME}_HDR_FILES} )
 	elseif(APPLE)
 		add_executable(${NAME} MACOSX_BUNDLE ${${NAME}_SRC_FILES} ${${NAME}_HDR_FILES} )
 
 		# The first rpath is to the proper location where the framework/library SHOULD be, the second is to the location actually seen
 		# in the build environment
-if(BUILD_FRAMEWORK)
-		set_target_properties(${NAME} PROPERTIES LINK_FLAGS "-rpath @executable_path/../Frameworks")
-else()
-		set_target_properties(${NAME} PROPERTIES LINK_FLAGS "-rpath @executable_path/../lib")
-endif()
-    else()
-    	add_executable(${NAME} ${${NAME}_SRC_FILES} ${${NAME}_HDR_FILES} )
-    endif()
+		if(BUILD_FRAMEWORK)
+			set_target_properties(${NAME} PROPERTIES LINK_FLAGS "-rpath @executable_path/../Frameworks")
+		else()
+			set_target_properties(${NAME} PROPERTIES LINK_FLAGS "-rpath @executable_path/../lib")
+		endif()
+	else()
+		add_executable(${NAME} ${${NAME}_SRC_FILES} ${${NAME}_HDR_FILES} )
+	endif()
 
-    target_link_libraries(${NAME} ${ARGN})
+	target_link_libraries(${NAME} ${ARGN})
 endmacro()
 
 if(BUILD_SAMPLES)
-    include(SampleFileList)
+	include(SampleFileList)
 
-    set(samples treeview customlog drag loaddocument transform bitmapfont animation)
-    set(tutorials template datagrid datagrid_tree tutorial_drag)
-    
+	set(samples treeview customlog drag loaddocument transform bitmapfont animation)
+	set(tutorials template datagrid datagrid_tree tutorial_drag)
+	
 if(NOT BUILD_FRAMEWORK)
-    set(sample_LIBRARIES
-    	shell 
-    	RmlCore 
-    	RmlControls
-    	RmlDebugger
-    )
+	set(sample_LIBRARIES
+		shell 
+		RmlCore 
+		RmlControls
+		RmlDebugger
+	)
 else(NOT BUILD_FRAMEWORK)
-    set(sample_LIBRARIES
-    	shell 
-    	Rml
-    )
+	set(sample_LIBRARIES
+		shell 
+		Rml
+	)
 endif(NOT BUILD_FRAMEWORK)
 
 	# Find OpenGL 
 	find_package(OpenGL REQUIRED)
-    	   
-    if(OPENGL_FOUND)
+		   
+	if(OPENGL_FOUND)
 	include_directories(${OPENGL_INCLUDE_DIR})
 	list(APPEND sample_LIBRARIES ${OPENGL_LIBRARIES})
-    endif()
-    
-    # Set up required system libraries
-    if(WIN32)
+	endif()
+	
+	# Set up required system libraries
+	if(WIN32)
 		if(SKIP_DIRECTX_SAMPLES)
 			message("-- Skipping all DirectX samples")
 			set(SKIP_DIRECTX10_SAMPLE ON)
@@ -470,50 +450,54 @@ endif(NOT BUILD_FRAMEWORK)
 				set(SKIP_DIRECTX10_SAMPLE ON)
 			endif()
 		endif()
-    elseif(APPLE)
+	elseif(APPLE)
 		include(FindCarbon)
-    	find_package(Carbon REQUIRED)
-    	
-    	if (Carbon_FOUND)
-    		include_directories(${Carbon_INCLUDE_DIR})
-        	list(APPEND sample_LIBRARIES ${Carbon_LIBRARIES})
-    	endif()
-    else()
-    	find_package(X11 REQUIRED)
-        if (X11_FOUND)
-        	list(APPEND sample_LIBRARIES ${X11_LIBRARIES})
+		find_package(Carbon REQUIRED)
+		
+		if (Carbon_FOUND)
+			include_directories(${Carbon_INCLUDE_DIR})
+			list(APPEND sample_LIBRARIES ${Carbon_LIBRARIES})
+		endif()
+	else()
+		find_package(X11 REQUIRED)
+		if (X11_FOUND)
+			list(APPEND sample_LIBRARIES ${X11_LIBRARIES})
 		# shell/src/x11/InputX11.cpp:InitialiseX11Keymap uses Xkb if
 		# possible instead of XGetKeyboardMapping for performance
 		if(X11_Xkb_FOUND)
 			FIND_PACKAGE_MESSAGE(X11 "Found X11 KBlib: ${X11_X11_LIB}" "[${X11_X11_LIB}][${X11_XkbINCLUDE_DIR}]")
 			add_definitions(-DHAS_X11XKBLIB)
 		endif()
-        endif()
-    endif()
+		endif()
+	endif()
    
-    set(SAMPLES_DIR opt/Rml/Samples CACHE PATH "path to samples dir")
+	set(SAMPLES_DIR opt/RmlUi/Samples CACHE PATH "path to samples dir")
+	
+	if(WIN32)
+		mark_as_advanced(SAMPLES_DIR)
+	endif()
 
-    # The samples and tutorials use the shell library
-    include_directories(${PROJECT_SOURCE_DIR}/Samples/shell/include)
+	# The samples and tutorials use the shell library
+	include_directories(${PROJECT_SOURCE_DIR}/Samples/shell/include)
 
-    # Build and install sample shell library
-    add_library(shell STATIC ${shell_SRC_FILES} ${shell_HDR_FILES})
+	# Build and install sample shell library
+	add_library(shell STATIC ${shell_SRC_FILES} ${shell_HDR_FILES})
 	set_property(TARGET shell PROPERTY CXX_STANDARD 11)
 	set_property(TARGET shell PROPERTY CXX_STANDARD_REQUIRED ON)
 
-    # Build and install the basic samples
-    foreach(sample ${samples})
-        bl_sample(${sample} ${sample_LIBRARIES})
+	# Build and install the basic samples
+	foreach(sample ${samples})
+		bl_sample(${sample} ${sample_LIBRARIES})
 		
 		set_property(TARGET ${sample} PROPERTY CXX_STANDARD 11)
 		set_property(TARGET ${sample} PROPERTY CXX_STANDARD_REQUIRED ON)
 
-        # The samples always set this as their current working directory
-        install(DIRECTORY DESTINATION ${SAMPLES_DIR}/basic/${sample})
-        install(TARGETS ${sample} 
-        	RUNTIME DESTINATION ${SAMPLES_DIR}/${sample}
-        	BUNDLE DESTINATION ${SAMPLES_DIR})
-    endforeach()
+		# The samples always set this as their current working directory
+		install(DIRECTORY DESTINATION ${SAMPLES_DIR}/basic/${sample})
+		install(TARGETS ${sample} 
+			RUNTIME DESTINATION ${SAMPLES_DIR}/${sample}
+			BUNDLE DESTINATION ${SAMPLES_DIR})
+	endforeach()
 
 	if(WIN32)
 		if(NOT SKIP_DIRECTX10_SAMPLE)
@@ -529,14 +513,14 @@ endif(NOT BUILD_FRAMEWORK)
 		endif()
 	endif()
 
-    message("-- Can SDL2 sample be built")
-    find_package(SDL2)
-    if(SDL2_FOUND)
+	message("-- Can SDL2 sample be built")
+	find_package(SDL2)
+	if(SDL2_FOUND)
 	find_package(SDL2_image)
 	if(SDL2_IMAGE_FOUND)
 		find_package(GLEW)
 		if(GLEW_FOUND)
-        		message("-- Can SDL2 sample be built - yes")
+			message("-- Can SDL2 sample be built - yes")
 			include_directories(${SDL2_INCLUDE_DIR} ${GLEW_INCLUDE_DIR})
 
 			bl_sample(sdl2 ${sample_LIBRARIES}  ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARY} ${GLEW_LIBRARY})
@@ -554,9 +538,9 @@ endif(NOT BUILD_FRAMEWORK)
 	else()
 	        message("-- Can SDL2 sample be built - SDL2_image not found")
 	endif()
-    else()
-        message("-- Can SDL2 sample be built - SDL2 not found")
-    endif()
+	else()
+		message("-- Can SDL2 sample be built - SDL2 not found")
+	endif()
 
 
 	message("-- Can SFML 2.x sample be built")
@@ -590,38 +574,38 @@ endif(NOT BUILD_FRAMEWORK)
 				BUNDLE DESTINATION ${SAMPLES_DIR})
 	endif()
 
-    # Build and install the tutorials
-    foreach(tutorial ${tutorials})
-        bl_sample(${tutorial} ${sample_LIBRARIES})
+	# Build and install the tutorials
+	foreach(tutorial ${tutorials})
+		bl_sample(${tutorial} ${sample_LIBRARIES})
 
 		set_property(TARGET ${tutorial} PROPERTY CXX_STANDARD 11)
 		set_property(TARGET ${tutorial} PROPERTY CXX_STANDARD_REQUIRED ON)
 		
-        # The tutorials always set this as their current working directory
-        install(DIRECTORY DESTINATION ${SAMPLES_DIR}/tutorial/${tutorial})
-        install(TARGETS ${tutorial}
-                RUNTIME DESTINATION ${SAMPLES_DIR}/${tutorial}
-                BUNDLE DESTINATION ${SAMPLES_DIR})
-    endforeach()
-
-    # Build and install invaders sample
-    bl_sample(invaders ${sample_LIBRARIES})
+		# The tutorials always set this as their current working directory
+		install(DIRECTORY DESTINATION ${SAMPLES_DIR}/tutorial/${tutorial})
+		install(TARGETS ${tutorial}
+			RUNTIME DESTINATION ${SAMPLES_DIR}/${tutorial}
+			BUNDLE DESTINATION ${SAMPLES_DIR})
+	endforeach()
+
+	# Build and install invaders sample
+	bl_sample(invaders ${sample_LIBRARIES})
 	set_property(TARGET invaders PROPERTY CXX_STANDARD 11)
 	set_property(TARGET invaders PROPERTY CXX_STANDARD_REQUIRED ON)
-    install(DIRECTORY DESTINATION ${SAMPLES_DIR}/invaders)
-    install(TARGETS invaders 
-    	RUNTIME DESTINATION ${SAMPLES_DIR}/invaders
-    	BUNDLE DESTINATION ${SAMPLES_DIR})
+	install(DIRECTORY DESTINATION ${SAMPLES_DIR}/invaders)
+	install(TARGETS invaders 
+		RUNTIME DESTINATION ${SAMPLES_DIR}/invaders
+		BUNDLE DESTINATION ${SAMPLES_DIR})
 
-    if(BUILD_LUA_BINDINGS)
-        bl_sample(luainvaders RmlCoreLua RmlControlsLua ${sample_LIBRARIES} ${LUA_BINDINGS_LINK_LIBS})
+	if(BUILD_LUA_BINDINGS)
+		bl_sample(luainvaders RmlCoreLua RmlControlsLua ${sample_LIBRARIES} ${LUA_BINDINGS_LINK_LIBS})
 		set_property(TARGET luainvaders PROPERTY CXX_STANDARD 11)
 		set_property(TARGET luainvaders PROPERTY CXX_STANDARD_REQUIRED ON)
-        install(DIRECTORY DESTINATION ${SAMPLES_DIR}/luainvaders)
-        install(TARGETS luainvaders 
-        	RUNTIME DESTINATION ${SAMPLES_DIR}/luainvaders
-        	BUNDLE DESTINATION ${SAMPLES_DIR})
-    endif()
+		install(DIRECTORY DESTINATION ${SAMPLES_DIR}/luainvaders)
+		install(TARGETS luainvaders 
+			RUNTIME DESTINATION ${SAMPLES_DIR}/luainvaders
+			BUNDLE DESTINATION ${SAMPLES_DIR})
+	endif()
 endif()
 
 
@@ -630,57 +614,57 @@ endif()
 #===================================
 
 if(BUILD_LUA_BINDINGS)
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Include/Rml
-            DESTINATION include
-    )
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Include/Rml
+			DESTINATION include
+	)
 else()
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Include/Rml
-            DESTINATION include
-            PATTERN "Lua" EXCLUDE
-    )
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Include/Rml
+			DESTINATION include
+			PATTERN "Lua" EXCLUDE
+	)
 endif()
 
 if(BUILD_SAMPLES)
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/assets
-            DESTINATION ${SAMPLES_DIR}
-    )
-
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/template/data
-            DESTINATION ${SAMPLES_DIR}/tutorial/template
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/datagrid/data
-            DESTINATION ${SAMPLES_DIR}/tutorial/datagrid
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/datagrid_tree/data
-            DESTINATION ${SAMPLES_DIR}/tutorial/datagrid_tree
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/tutorial_drag/data
-            DESTINATION ${SAMPLES_DIR}/tutorial/tutorial_drag
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/animation/data
-            DESTINATION ${SAMPLES_DIR}/basic/animation
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/transform/data
-            DESTINATION ${SAMPLES_DIR}/basic/transform
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/treeview/data
-            DESTINATION ${SAMPLES_DIR}/basic/treeview
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/drag/data
-            DESTINATION ${SAMPLES_DIR}/basic/drag
-    )
-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/invaders/data
-            DESTINATION ${SAMPLES_DIR}/invaders
-    )
-
-    if(BUILD_LUA_BINDINGS)
-        install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/luainvaders/data 
-                DESTINATION ${SAMPLES_DIR}/luainvaders
-        )
-        install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/luainvaders/lua 
-                DESTINATION ${SAMPLES_DIR}/luainvaders
-        )
-    endif()
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/assets
+			DESTINATION ${SAMPLES_DIR}
+	)
+
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/template/data
+			DESTINATION ${SAMPLES_DIR}/tutorial/template
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/datagrid/data
+			DESTINATION ${SAMPLES_DIR}/tutorial/datagrid
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/datagrid_tree/data
+			DESTINATION ${SAMPLES_DIR}/tutorial/datagrid_tree
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/tutorial/tutorial_drag/data
+			DESTINATION ${SAMPLES_DIR}/tutorial/tutorial_drag
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/animation/data
+			DESTINATION ${SAMPLES_DIR}/basic/animation
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/transform/data
+			DESTINATION ${SAMPLES_DIR}/basic/transform
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/treeview/data
+			DESTINATION ${SAMPLES_DIR}/basic/treeview
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/drag/data
+			DESTINATION ${SAMPLES_DIR}/basic/drag
+	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/invaders/data
+			DESTINATION ${SAMPLES_DIR}/invaders
+	)
+
+	if(BUILD_LUA_BINDINGS)
+		install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/luainvaders/data 
+				DESTINATION ${SAMPLES_DIR}/luainvaders
+		)
+		install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/luainvaders/lua 
+				DESTINATION ${SAMPLES_DIR}/luainvaders
+		)
+	endif()
 endif()
 
 #===================================
@@ -688,44 +672,43 @@ endif()
 #===================================
 
 # Try to include helper module
-include(CMakePackageConfigHelpers OPTIONAL
-  RESULT_VARIABLE PkgHelpers_AVAILABLE)
+include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE)
+
 # guard against older versions of cmake which do not provide it
 if(PkgHelpers_AVAILABLE)
-
-  set (INCLUDE_INSTALL_DIR "include")
-  set (LIB_INSTALL_DIR "lib")
-  set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include")
-
-  # generate configuration for install tree
-  configure_package_config_file(RmlUiConfig.cmake.install.in
-    ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake
-    INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake
-    PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR)
-  write_basic_package_version_file(
-    ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake
-    VERSION ${PROJECT_VERSION}
-    COMPATIBILITY SameMajorVersion )
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake
-    ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake
-    DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake )
-  install(EXPORT RmlUiTargets
-    DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake)
-
-  # generate configuration for build tree
-  configure_package_config_file(RmlUiConfig.cmake.build.in
-    ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake
-    INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
-    PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR)
-  export(TARGETS ${RMLUI_EXPORTED_TARGETS}
-    FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake")
-  write_basic_package_version_file(
-    ${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake
-    VERSION ${PROJECT_VERSION}
-    COMPATIBILITY SameMajorVersion )
-  set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.")
+	set (INCLUDE_INSTALL_DIR "include")
+	set (LIB_INSTALL_DIR "lib")
+	set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Include")
+
+	# generate configuration for install tree
+	configure_package_config_file(${PROJECT_SOURCE_DIR}/Cmake/RmlUiConfig.cmake.install.in
+		${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake
+		INSTALL_DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake
+		PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR)
+	write_basic_package_version_file(
+		${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake
+		VERSION ${PROJECT_VERSION}
+		COMPATIBILITY SameMajorVersion )
+	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfig.cmake
+		${CMAKE_CURRENT_BINARY_DIR}/install/RmlUiConfigVersion.cmake
+		DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake )
+	install(EXPORT RmlUiTargets
+		DESTINATION ${LIB_INSTALL_DIR}/RmlUi/cmake)
+
+	# generate configuration for build tree
+	configure_package_config_file(${PROJECT_SOURCE_DIR}/Cmake/RmlUiConfig.cmake.build.in
+		${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfig.cmake
+		INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
+		PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR)
+	export(TARGETS ${RMLUI_EXPORTED_TARGETS}
+		FILE "${CMAKE_CURRENT_BINARY_DIR}/RmlUiTargets.cmake")
+	write_basic_package_version_file(
+		${CMAKE_CURRENT_BINARY_DIR}/RmlUiConfigVersion.cmake
+		VERSION ${PROJECT_VERSION}
+		COMPATIBILITY SameMajorVersion )
+	set(RmlUi_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory containing a CMake configuration file for RmlUi.")
 else()
-  message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library"
-    " please update cmake to version which provides CMakePackageConfighelpers module"
-    " or write generators for RmlUiConfig.cmake by yourself.")
-endif()
+	message("If you wish to use find_package(RmlUi) in your own project to find RmlUi library"
+		" please update cmake to version which provides CMakePackageConfighelpers module"
+		" or write generators for RmlUiConfig.cmake by yourself.")
+endif()

+ 0 - 0
Build/cmake/FileList.cmake → Cmake/FileList.cmake


+ 0 - 0
Build/cmake/FindCarbon.cmake → Cmake/Modules/FindCarbon.cmake


+ 0 - 0
Build/cmake/FindDirectX.cmake → Cmake/Modules/FindDirectX.cmake


+ 0 - 0
Build/cmake/FindPkgMacros.cmake → Cmake/Modules/FindPkgMacros.cmake


+ 0 - 0
Build/cmake/FindSDL2.cmake → Cmake/Modules/FindSDL2.cmake


+ 0 - 0
Build/cmake/FindSDL2_image.cmake → Cmake/Modules/FindSDL2_image.cmake


+ 209 - 209
Build/cmake/FindSFML.cmake → Cmake/Modules/FindSFML.cmake

@@ -1,209 +1,209 @@
-# This script locates the SFML library
-# ------------------------------------
-#
-# Usage
-# -----
-#
-# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
-# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
-# example:
-#   find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
-#
-# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
-# If nothing is specified, the version won't be checked (ie. any version will be accepted).
-# example:
-#   find_package(SFML COMPONENTS ...)     // no specific version required
-#   find_package(SFML 2 COMPONENTS ...)   // any 2.x version
-#   find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
-#
-# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
-# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
-# In case of static linking, the SFML_STATIC macro will also be defined by this script.
-# example:
-#   set(SFML_STATIC_LIBRARIES TRUE)
-#   find_package(SFML 2 COMPONENTS network system)
-#
-# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
-# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
-# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
-# are available for both release and debug modes.
-#
-# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
-# to tell CMake where SFML is.
-#
-# Output
-# ------
-#
-# This script defines the following variables:
-# - For each specified module XXX (system, window, graphics, network, audio, main):
-#   - SFML_XXX_LIBRARY_DEBUG:   the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
-#   - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
-#   - SFML_XXX_LIBRARY:         the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
-#   - SFML_XXX_FOUND:           true if either the debug or release library of the xxx module is found
-# - SFML_LIBRARIES:   the list of all libraries corresponding to the required modules
-# - SFML_FOUND:       true if all the required modules are found
-# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
-#
-# example:
-#   find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
-#   include_directories(${SFML_INCLUDE_DIR})
-#   add_executable(myapp ...)
-#   target_link_libraries(myapp ${SFML_LIBRARIES})
-
-# define the SFML_STATIC macro if static build was chosen
-if(SFML_STATIC_LIBRARIES)
-    add_definitions(-DSFML_STATIC)
-endif()
-
-# deduce the libraries suffix from the options
-set(FIND_SFML_LIB_SUFFIX "")
-if(SFML_STATIC_LIBRARIES)
-    set(FIND_SFML_LIB_SUFFIX "${FIND_SFML_LIB_SUFFIX}-s")
-endif()
-
-# find the SFML include directory
-find_path(SFML_INCLUDE_DIR SFML/Config.hpp
-          PATH_SUFFIXES include
-          PATHS
-          ${SFML_ROOT}
-          $ENV{SFML_ROOT}
-          ~/Library/Frameworks
-          /Library/Frameworks
-          /usr/local/
-          /usr/
-          /sw          # Fink
-          /opt/local/  # DarwinPorts
-          /opt/csw/    # Blastwave
-          /opt/)
-
-# check the version number
-set(SFML_VERSION_OK TRUE)
-if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
-    # extract the major and minor version numbers from SFML/Config.hpp
-    # we have to handle framework a little bit differently :
-    if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
-        set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
-    else()
-        set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
-    endif()
-    FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
-    STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}")
-    STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
-    STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
-    math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}")
-
-    # if we could extract them, compare with the requested version number
-    if (SFML_VERSION_MAJOR)
-        # transform version numbers to an integer
-        math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10 + ${SFML_VERSION_MINOR}")
-
-        # compare them
-        if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
-            set(SFML_VERSION_OK FALSE)
-        endif()
-    else()
-        # SFML version is < 2.0
-        if (SFML_REQUESTED_VERSION GREATER 19)
-            set(SFML_VERSION_OK FALSE)
-            set(SFML_VERSION_MAJOR 1)
-            set(SFML_VERSION_MINOR x)
-        endif()
-    endif()
-endif()
-
-# find the requested modules
-set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
-set(FIND_SFML_LIB_PATHS
-    ${SFML_ROOT}
-    $ENV{SFML_ROOT}
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local
-    /usr
-    /sw
-    /opt/local
-    /opt/csw
-    /opt)
-foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
-    string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
-    string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
-    set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}${FIND_SFML_LIB_SUFFIX})
-
-    # no suffix for sfml-main, it is always a static library
-    if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
-        set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
-    endif()
-
-    # debug library
-    find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
-                 NAMES ${FIND_SFML_COMPONENT_NAME}-d
-                 PATH_SUFFIXES lib64 lib
-                 PATHS ${FIND_SFML_LIB_PATHS})
-
-    # release library
-    find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
-                 NAMES ${FIND_SFML_COMPONENT_NAME}
-                 PATH_SUFFIXES lib64 lib
-                 PATHS ${FIND_SFML_LIB_PATHS})
-
-    if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
-        # library found
-        set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
-        
-        # if both are found, set SFML_XXX_LIBRARY to contain both
-        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug     ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
-                                                          optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
-        endif()
-
-        # if only one debug/release variant is found, set the other to be equal to the found one
-        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
-            # debug and not release
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY         ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
-        endif()
-        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
-            # release and not debug
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY       ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
-        endif()
-    else()
-        # library not found
-        set(SFML_FOUND FALSE)
-        set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
-        set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
-        set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
-    endif()
-
-    # mark as advanced
-    MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
-                     SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
-                     SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
-
-    # add to the global list of libraries
-    set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
-endforeach()
-
-# handle errors
-if(NOT SFML_VERSION_OK)
-    # SFML version not ok
-    set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR})")
-    set(SFML_FOUND FALSE)
-elseif(NOT SFML_FOUND)
-    # include directory or library not found
-    set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
-endif()
-if (NOT SFML_FOUND)
-    if(SFML_FIND_REQUIRED)
-        # fatal error
-        message(FATAL_ERROR ${FIND_SFML_ERROR})
-    elseif(NOT SFML_FIND_QUIETLY)
-        # error but continue
-        message("${FIND_SFML_ERROR}")
-    endif()
-endif()
-
-# handle success
-if(SFML_FOUND)
-    message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}")
-endif()
+# This script locates the SFML library
+# ------------------------------------
+#
+# Usage
+# -----
+#
+# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
+# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
+# example:
+#   find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
+#
+# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
+# If nothing is specified, the version won't be checked (ie. any version will be accepted).
+# example:
+#   find_package(SFML COMPONENTS ...)     // no specific version required
+#   find_package(SFML 2 COMPONENTS ...)   // any 2.x version
+#   find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
+#
+# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
+# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
+# In case of static linking, the SFML_STATIC macro will also be defined by this script.
+# example:
+#   set(SFML_STATIC_LIBRARIES TRUE)
+#   find_package(SFML 2 COMPONENTS network system)
+#
+# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
+# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
+# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
+# are available for both release and debug modes.
+#
+# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
+# to tell CMake where SFML is.
+#
+# Output
+# ------
+#
+# This script defines the following variables:
+# - For each specified module XXX (system, window, graphics, network, audio, main):
+#   - SFML_XXX_LIBRARY_DEBUG:   the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
+#   - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
+#   - SFML_XXX_LIBRARY:         the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
+#   - SFML_XXX_FOUND:           true if either the debug or release library of the xxx module is found
+# - SFML_LIBRARIES:   the list of all libraries corresponding to the required modules
+# - SFML_FOUND:       true if all the required modules are found
+# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
+#
+# example:
+#   find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
+#   include_directories(${SFML_INCLUDE_DIR})
+#   add_executable(myapp ...)
+#   target_link_libraries(myapp ${SFML_LIBRARIES})
+
+# define the SFML_STATIC macro if static build was chosen
+if(SFML_STATIC_LIBRARIES)
+    add_definitions(-DSFML_STATIC)
+endif()
+
+# deduce the libraries suffix from the options
+set(FIND_SFML_LIB_SUFFIX "")
+if(SFML_STATIC_LIBRARIES)
+    set(FIND_SFML_LIB_SUFFIX "${FIND_SFML_LIB_SUFFIX}-s")
+endif()
+
+# find the SFML include directory
+find_path(SFML_INCLUDE_DIR SFML/Config.hpp
+          PATH_SUFFIXES include
+          PATHS
+          ${SFML_ROOT}
+          $ENV{SFML_ROOT}
+          ~/Library/Frameworks
+          /Library/Frameworks
+          /usr/local/
+          /usr/
+          /sw          # Fink
+          /opt/local/  # DarwinPorts
+          /opt/csw/    # Blastwave
+          /opt/)
+
+# check the version number
+set(SFML_VERSION_OK TRUE)
+if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
+    # extract the major and minor version numbers from SFML/Config.hpp
+    # we have to handle framework a little bit differently :
+    if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
+        set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
+    else()
+        set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
+    endif()
+    FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
+    STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}")
+    STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
+    STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
+    math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}")
+
+    # if we could extract them, compare with the requested version number
+    if (SFML_VERSION_MAJOR)
+        # transform version numbers to an integer
+        math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10 + ${SFML_VERSION_MINOR}")
+
+        # compare them
+        if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
+            set(SFML_VERSION_OK FALSE)
+        endif()
+    else()
+        # SFML version is < 2.0
+        if (SFML_REQUESTED_VERSION GREATER 19)
+            set(SFML_VERSION_OK FALSE)
+            set(SFML_VERSION_MAJOR 1)
+            set(SFML_VERSION_MINOR x)
+        endif()
+    endif()
+endif()
+
+# find the requested modules
+set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
+set(FIND_SFML_LIB_PATHS
+    ${SFML_ROOT}
+    $ENV{SFML_ROOT}
+    ~/Library/Frameworks
+    /Library/Frameworks
+    /usr/local
+    /usr
+    /sw
+    /opt/local
+    /opt/csw
+    /opt)
+foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
+    string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
+    string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
+    set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}${FIND_SFML_LIB_SUFFIX})
+
+    # no suffix for sfml-main, it is always a static library
+    if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
+        set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
+    endif()
+
+    # debug library
+    find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
+                 NAMES ${FIND_SFML_COMPONENT_NAME}-d
+                 PATH_SUFFIXES lib64 lib
+                 PATHS ${FIND_SFML_LIB_PATHS})
+
+    # release library
+    find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
+                 NAMES ${FIND_SFML_COMPONENT_NAME}
+                 PATH_SUFFIXES lib64 lib
+                 PATHS ${FIND_SFML_LIB_PATHS})
+
+    if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
+        # library found
+        set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
+        
+        # if both are found, set SFML_XXX_LIBRARY to contain both
+        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
+            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug     ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
+                                                          optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
+        endif()
+
+        # if only one debug/release variant is found, set the other to be equal to the found one
+        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
+            # debug and not release
+            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
+            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY         ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
+        endif()
+        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
+            # release and not debug
+            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
+            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY       ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
+        endif()
+    else()
+        # library not found
+        set(SFML_FOUND FALSE)
+        set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
+        set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
+        set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
+    endif()
+
+    # mark as advanced
+    MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
+                     SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
+                     SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
+
+    # add to the global list of libraries
+    set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
+endforeach()
+
+# handle errors
+if(NOT SFML_VERSION_OK)
+    # SFML version not ok
+    set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR})")
+    set(SFML_FOUND FALSE)
+elseif(NOT SFML_FOUND)
+    # include directory or library not found
+    set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
+endif()
+if (NOT SFML_FOUND)
+    if(SFML_FIND_REQUIRED)
+        # fatal error
+        message(FATAL_ERROR ${FIND_SFML_ERROR})
+    elseif(NOT SFML_FIND_QUIETLY)
+        # error but continue
+        message("${FIND_SFML_ERROR}")
+    endif()
+endif()
+
+# handle success
+if(SFML_FOUND)
+    message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}")
+endif()

+ 0 - 0
Build/cmake/Platform/iOS.cmake → Cmake/Platform/iOS.cmake


+ 3 - 3
Build/RmlUiConfig.cmake.build.in → Cmake/RmlUiConfig.cmake.build.in

@@ -1,10 +1,10 @@
 @PACKAGE_INIT@
 
 set_and_check(RmlUi_INCLUDE_DIRS "@PACKAGE_INCLUDE_DIR@")
-set(RmlUi_LIBRARIES @RML_EXPORTED_TARGETS@)
-list(GET RmlUi_LIBRARIES 0 RML_FIRST_TARGET)
+set(RmlUi_LIBRARIES @RMLUI_EXPORTED_TARGETS@)
+list(GET RmlUi_LIBRARIES 0 RMLUI_FIRST_TARGET)
 
-if(NOT (TARGET ${RML_FIRST_TARGET}))
+if(NOT (TARGET ${RMLUI_FIRST_TARGET}))
   include("${CMAKE_CURRENT_LIST_DIR}/RmlUiTargets.cmake")
 endif()
 

+ 0 - 0
Build/RmlUiConfig.cmake.install.in → Cmake/RmlUiConfig.cmake.install.in


+ 0 - 0
Build/cmake/SampleFileList.cmake → Cmake/SampleFileList.cmake


+ 8 - 8
Build/builddist.py → Cmake/builddist.py

@@ -155,15 +155,15 @@ def main():
 	Build('RmlControls', ['Debug', 'Release'])
 	Build('RmlDebugger', ['Debug', 'Release'])
 	
-	DelTree('../dist/RmlUi')
-	CopyFiles('../Include', '../dist/RmlUi/Include')
-	CopyFiles('../bin', '../dist/RmlUi/bin', ['\.dll$', '^[^_].*\.lib$', '\.py$', '\.pyd$'])
-	CopyFiles('../Samples', '../dist/RmlUi/Samples', ['\.h$', '\.cpp$', '\.vcproj$', '\.sln$', '\.vcproj\.user$', '\.rml$', '\.rcss$', '\.tga$', '\.py$', '\.otf$', '\.txt$'])
+	DelTree('../Distribution/RmlUi')
+	CopyFiles('../Include', '../Distribution/RmlUi/Include')
+	CopyFiles('../Build', '../Distribution/RmlUi/Build', ['\.dll$', '^[^_].*\.lib$', '\.py$', '\.pyd$'])
+	CopyFiles('../Samples', '../Distribution/RmlUi/Samples', ['\.h$', '\.cpp$', '\.vcproj$', '\.sln$', '\.vcproj\.user$', '\.rml$', '\.rcss$', '\.tga$', '\.py$', '\.otf$', '\.txt$'])
 	if options['FULL_SOURCE']:
-		CopyFiles('../Build', '../dist/RmlUi/Build', ['\.vcproj$', '\.sln$', '\.vsprops$', '\.py$'])
-		CopyFiles('../Source', '../dist/RmlUi/Source', ['\.cpp$', '\.h$', '\.inl$'])
-	shutil.copyfile('../changelog.txt', '../dist/RmlUi/changelog.txt')
-	Archive(options['ARCHIVE_NAME'] + '-' + options['RMLUI_VERSION'], '../dist/RmlUi');
+		CopyFiles('../Build', '../Distribution/RmlUi/Build', ['\.vcproj$', '\.sln$', '\.vsprops$', '\.py$'])
+		CopyFiles('../Source', '../Distribution/RmlUi/Source', ['\.cpp$', '\.h$', '\.inl$'])
+	shutil.copyfile('../changelog.txt', '../Distribution/RmlUi/changelog.txt')
+	Archive(options['ARCHIVE_NAME'] + '-' + options['RMLUI_VERSION'], '../Distribution/RmlUi');
 	
 if __name__ == '__main__':
 	main()

+ 0 - 0
Build/cmake/gen_filelists.sh → Cmake/gen_filelists.sh


+ 0 - 0
Build/cmake/gen_samplelists.sh → Cmake/gen_samplelists.sh


+ 0 - 0
Build/plist/RocketControlsOSX-Info.plist → Cmake/plist/RocketControlsOSX-Info.plist


+ 0 - 0
Build/plist/RocketCoreOSX-Info.plist → Cmake/plist/RocketCoreOSX-Info.plist


+ 0 - 0
Build/plist/RocketDebuggerOSX-Info.plist → Cmake/plist/RocketDebuggerOSX-Info.plist


+ 0 - 42
how_to_build_for_mingw.txt

@@ -1,42 +0,0 @@
-Download FreeType. Get the Binaries package:
-	http://gnuwin32.sourceforge.net/packages/freetype.htm
-Direct link:
-	http://gnuwin32.sourceforge.net/downlinks/freetype-bin-zip.php
-	
-Extract to Dependencies\freetype
-
-Go into the Build folder and run cmake. However, notice:
-
-** REPLACE C:\MinGW\bin\mingw32-make.exe with the path to your MinGW make.exe file.
-** You have to have the C:\MinGW\bin in the path (or cmake will complain for missing libgmp-10.dll, etc).
-** You must not have msys/bin in the path, it doesn't work with cmake
-** Use -DRMLUI_STATIC_LIB if static libs are wanted. However, you will also need -DRMLUI_STATIC_LIB to your own application when including RmlUi files.
-** Notice that the generator "MinGW Makefiles" match the mingw32-make.exe, while the generator "msys Makefiles" match the msys/bin/make.exe. The first combination is used for
-
-compiling from the DOS prompt, and the second one for compiling from a MinGW shell.
-
-cmake -G "MinGW Makefiles" -D CMAKE_MAKE_PROGRAM="c:\MinGW\bin\mingw32-make.exe" -D FREETYPE_INCLUDE_DIRS="..\Dependencies\freetype\include;..\Dependencies\freetype\include
-
-\freetype2" -D FREETYPE_LIBRARY="..\Dependencies\freetype\lib\libfreetype.dll.a" .
-
-
-Once cmake completes successfully, run make
-
-	make
-
-The project will compile and three libraries will be generated in the Build folder, use them to link with your project.
-	RmlCore.dll.a
-	RmlControls.dll.a
-	RmlDebugger.dll.a
-
-The corresponding dll files are also created, and need to be available when running your application (if not linked statically):
-	RmlCore.a
-	RmlControls.a
-	RmlDebugger.a
-
-From Dependencies/freetype/bin, get the file:
-	freetype6.dll
-
-If you get the cryptic error message "Can't correctly start the application (0xc000007b)", then zlib1.dll is also needed (from elsewhere).
-
-Done!