summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorHubert Figuière <hub@figuiere.net>2015-03-06 11:11:01 +0100
committerHubert Figuière <hub@figuiere.net>2015-03-06 11:11:01 +0100
commit606a7df73750084a36fe69651e7b672333a76412 (patch)
treee337e53680715d69be570ccfcf8757ca898ea124 /build
parent4652015fe779e12fb06ff8fa56bf70e373cd3894 (diff)
Update to XMP SDK CC 2014.12
Diffstat (limited to 'build')
-rw-r--r--build/CMakeLists.txt3
-rwxr-xr-xbuild/GenerateXMPToolkitSDK_win.bat14
-rw-r--r--build/ProductConfig.cmake170
-rw-r--r--build/README.txt32
-rw-r--r--build/XMP_Config.cmake501
-rw-r--r--build/XMP_ConfigCommon.cmake481
-rw-r--r--build/XMP_Ios.cmake109
-rw-r--r--build/XMP_Linux.cmake143
-rw-r--r--build/XMP_Mac.cmake129
-rw-r--r--build/XMP_Win.cmake127
-rwxr-xr-x[-rw-r--r--]build/cmake.bat0
-rwxr-xr-x[-rw-r--r--]build/cmake.command0
-rwxr-xr-x[-rw-r--r--]build/cmake_all.bat0
-rwxr-xr-xbuild/shared/CMakeUtils.bat12
-rw-r--r--build/shared/SharedConfig_Common.cmake71
-rw-r--r--build/shared/ToolchainLLVM.cmake4
16 files changed, 756 insertions, 1040 deletions
diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt
index 7a04a8d..2a96ea9 100644
--- a/build/CMakeLists.txt
+++ b/build/CMakeLists.txt
@@ -65,8 +65,7 @@ set(XMP_ROOT ${PROJECT_SOURCE_DIR}/..)
# Shared config
# ==============================================================================
# setup some values before calling shared config
-set(XMP_THIS_PROJECT_RELATIVEPATH "..")
-include(${CMAKE_CURRENT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/build/XMP_Config.cmake)
+include(${XMP_ROOT}/build/XMP_Config.cmake)
# ==============================================================================
# Sub projects
diff --git a/build/GenerateXMPToolkitSDK_win.bat b/build/GenerateXMPToolkitSDK_win.bat
index 06444d5..767d625 100755
--- a/build/GenerateXMPToolkitSDK_win.bat
+++ b/build/GenerateXMPToolkitSDK_win.bat
@@ -41,7 +41,7 @@ set GENERATE_ALL=On
:32DLL
echo "Generating XMPSDKToolkit Dynamic Win32"
-set VS_VERSION=2010
+set VS_VERSION=2011
set BUILD_TYPE=Dynamic
set BITS=32
IF "%GENERATE_ALL%"=="On" (
@@ -52,7 +52,7 @@ GOTO GenerateNow
:32LIB
echo "Generating XMPSDKToolkit Static Win32"
-set VS_VERSION=2010
+set VS_VERSION=2011
set BUILD_TYPE=Static
set BITS=32
IF "%GENERATE_ALL%"=="On" (
@@ -62,7 +62,7 @@ GOTO GenerateNow
:64DLL
echo "Generating XMPSDKToolkit Dynamic x64"
-set VS_VERSION=2010
+set VS_VERSION=2011
set BUILD_TYPE=Dynamic
set BITS=64
IF "%GENERATE_ALL%"=="On" (
@@ -72,7 +72,7 @@ GOTO GenerateNow
:64LIB
echo "Generating XMPSDKToolkit Static x64"
-set VS_VERSION=2010
+set VS_VERSION=2011
set BUILD_TYPE=Static
set BITS=64
IF "%GENERATE_ALL%"=="On" (
@@ -98,9 +98,9 @@ exit /B 0
:CLEANALL
echo "Cleaning..."
-if exist vc10 rmdir /S /Q vc10
-if exist ..\XMPCore\build\vc10 rmdir /S /Q ..\XMPCore\build\vc10
-if exist ..\XMPFiles\build\vc10 rmdir /S /Q ..\XMPFiles\build\vc10
+if exist vc11 rmdir /S /Q vc11
+if exist ..\XMPCore\build\vc11 rmdir /S /Q ..\XMPCore\build\vc11
+if exist ..\XMPFiles\build\vc11 rmdir /S /Q ..\XMPFiles\build\vc11
if exist ..\public\libraries\windows rmdir /S /Q ..\public\libraries\windows
if exist ..\public\libraries\windows_x64 rmdir /S /Q ..\public\libraries\windows_x64
echo "Done"
diff --git a/build/ProductConfig.cmake b/build/ProductConfig.cmake
new file mode 100644
index 0000000..b310ca9
--- /dev/null
+++ b/build/ProductConfig.cmake
@@ -0,0 +1,170 @@
+#/*************************************************************************
+#*
+#* ADOBE CONFIDENTIAL
+#* ___________________
+#*
+#* Copyright [2012] Adobe Systems Incorporated
+#* All Rights Reserved.
+#*
+#* NOTICE: All information contained herein is, and remains
+#* the property of Adobe Systems Incorporated and its suppliers,
+#* if any. The intellectual and technical concepts contained
+#* herein are proprietary to Adobe Systems Incorporated and its
+#* suppliers and are protected by trade secret or copyright law.
+#* Dissemination of this information or reproduction of this material
+#* is strictly forbidden unless prior written permission is obtained
+#* from Adobe Systems Incorporated.
+#**************************************************************************/
+
+# ==============================================================================
+# define minimum cmake version
+cmake_minimum_required(VERSION 2.8.0)
+
+# ==============================================================================
+# Product Config for XMP Toolkit
+# ==============================================================================
+if (UNIX)
+ if (APPLE)
+ set(XMP_ENABLE_SECURE_SETTINGS "ON")
+
+ if (APPLE_IOS)
+ set(XMP_PLATFORM_SHORT "ios")
+ set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
+ add_definitions(-DIOS_ENV=1)
+
+ # shared flags
+ set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} ${XMP_EXTRA_COMPILE_FLAGS}")
+ set(XMP_SHARED_COMPILE_DEBUG_FLAGS "-O0 -DDEBUG=1 -D_DEBUG=1")
+ set(XMP_SHARED_COMPILE_RELEASE_FLAGS "-Os -DNDEBUG=1 -D_NDEBUG=1")
+
+ set(XMP_PLATFORM_BEGIN_WHOLE_ARCHIVE "")
+ set(XMP_PLATFORM_END_WHOLE_ARCHIVE "")
+ else ()
+ set(XMP_PLATFORM_SHORT "mac")
+ if(CMAKE_CL_64)
+ set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
+ add_definitions(-DXMP_64=1)
+ else(CMAKE_CL_64)
+ set(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX" FORCE)
+ add_definitions(-DXMP_64=0)
+ endif(CMAKE_CL_64)
+
+ # is SDK and deployment target set?
+ if(NOT DEFINED XMP_OSX_SDK)
+ # no, so default to CS6 settings
+ #set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.2")
+ set(XMP_OSX_SDK 10.8)
+ set(XMP_OSX_TARGET 10.7)
+ endif()
+
+ add_definitions(-DMAC_ENV=1)
+
+
+ #
+ # shared flags
+ #
+ set(XMP_SHARED_COMPILE_FLAGS "-Wall -Wextra")
+ set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} -Wno-missing-field-initializers -Wno-shadow") # disable some warnings
+
+ set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS}")
+
+ set(XMP_SHARED_CXX_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} -Wno-reorder") # disable warnings
+
+ set(XMP_PLATFORM_BEGIN_WHOLE_ARCHIVE "")
+ set(XMP_PLATFORM_END_WHOLE_ARCHIVE "")
+ set(XMP_DYLIBEXTENSION "dylib")
+ endif ()
+
+ #There were getting set from SetupTargetArchitecture.
+ if(APPLE_IOS)
+ set(XMP_CPU_FOLDERNAME "$(ARCHS_STANDARD_32_BIT)")
+ else()
+ if(CMAKE_CL_64)
+ set(XMP_BITDEPTH "64")
+ set(XMP_CPU_FOLDERNAME "intel_64")
+ else()
+ set(XMP_BITDEPTH "32")
+ set(XMP_CPU_FOLDERNAME "intel")
+ endif()
+ endif()
+
+ # XMP_PLATFORM_FOLDER is used in OUTPUT_DIR and Debug/Release get automatically added for VS/XCode projects
+ if(APPLE_IOS)
+ set(XMP_PLATFORM_FOLDER "ios/${XMP_CPU_FOLDERNAME}")
+ else()
+ set(XMP_PLATFORM_FOLDER "macintosh/${XMP_CPU_FOLDERNAME}")
+ endif()
+ else ()
+ if(NOT CMAKE_CROSSCOMPILING)
+ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+ # running on 64bit machine
+ set(XMP_EXTRA_BUILDMACHINE "Buildmachine is 64bit")
+ else()
+ # running on 32bit machine
+ set(XMP_EXTRA_BUILDMACHINE "Buildmachine is 32bit")
+ endif()
+
+ if(CMAKE_CL_64)
+ set(XMP_EXTRA_COMPILE_FLAGS "-m64")
+ set(XMP_EXTRA_LINK_FLAGS "-m64")
+ set(XMP_PLATFORM_FOLDER "i80386linux_x64") # add XMP_BUILDMODE_DIR to follow what other platforms do
+ set(XMP_GCC_LIBPATH /user/unicore/i80386linux_x64/compiler/gcc4.4.4/linux2.6_64/lib64)
+ else()
+ set(XMP_EXTRA_LINK_FLAGS "-m32 -mtune=i686")
+ set(XMP_PLATFORM_FOLDER "i80386linux") # add XMP_BUILDMODE_DIR to follow what other platforms do
+ set(XMP_GCC_LIBPATH /user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/lib)
+ endif()
+ else()
+ # running toolchain
+ if(CMAKE_CL_64)
+ set(XMP_EXTRA_COMPILE_FLAGS "-m64")
+ set(XMP_EXTRA_LINK_FLAGS "-m64")
+ set(XMP_PLATFORM_FOLDER "i80386linux_x64") # add XMP_BUILDMODE_DIR to follow what other platforms do
+ set(XMP_GCC_LIBPATH /user/unicore/i80386linux_x64/compiler/gcc4.4.4/linux2.6_64/lib64)
+ else()
+ set(XMP_EXTRA_COMPILE_FLAGS "-m32 -mtune=i686")
+ set(XMP_EXTRA_LINK_FLAGS "-m32")
+ set(XMP_PLATFORM_FOLDER "i80386linux") # add XMP_BUILDMODE_DIR to follow what other platforms do
+ set(XMP_GCC_LIBPATH /user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/lib)
+ endif()
+
+ set(XMP_EXTRA_BUILDMACHINE "Cross compiling")
+ endif()
+ set(XMP_PLATFORM_VERSION "linux2.6") # add XMP_BUILDMODE_DIR to follow what other platforms do
+
+ add_definitions(-DUNIX_ENV=1)
+ # Linux -------------------------------------------
+ set(XMP_PLATFORM_SHORT "linux")
+ #gcc path is not set correctly
+ #set(CMAKE_C_COMPILER "/user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/bin/gcc")
+ #set(CMAKE_CXX_COMPILER "/user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/bin/gcc")
+ #set(XMP_GCC_LIBPATH /user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/lib)
+ set(XMP_PLATFORM_LINK "-z defs -Xlinker -Bsymbolic -Wl,--no-undefined ${XMP_EXTRA_LINK_FLAGS} ${XMP_TOOLCHAIN_LINK_FLAGS} -lrt -ldl -luuid -lpthread ${XMP_GCC_LIBPATH}/libssp.a")
+ set(XMP_SHARED_COMPILE_FLAGS "-Wno-multichar -Wno-implicit -D_FILE_OFFSET_BITS=64 -funsigned-char ${XMP_EXTRA_COMPILE_FLAGS} ${XMP_TOOLCHAIN_COMPILE_FLAGS}")
+ set(XMP_SHARED_COMPILE_DEBUG_FLAGS " ")
+ set(XMP_SHARED_COMPILE_RELEASE_FLAGS "-fwrapv ")
+
+ if(NOT XMP_DISABLE_FASTMATH)
+ # set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} -ffast-math")
+ # set(XMP_SHARED_COMPILE_RELEASE_FLAGS "${XMP_SHARED_COMPILE_RELEASE_FLAGS} -fomit-frame-pointer -funroll-loops")
+ endif()
+ endif()
+else ()
+ if(CMAKE_CL_64)
+ set(XMP_PLATFORM_FOLDER "windows_x64") # leave XMP_BUILDMODE_DIR away, since CMAKE_CFG_INTDIR gets added by CMake automatically
+ else(CMAKE_CL_64)
+ set(XMP_PLATFORM_FOLDER "windows") # leave XMP_BUILDMODE_DIR away, since CMAKE_CFG_INTDIR gets added by CMake automatically
+ endif(CMAKE_CL_64)
+ set(XMP_PLATFORM_SHORT "win")
+ set(XMP_PLATFORM_LINK "")
+ set(XMP_SHARED_COMPILE_FLAGS "-DWIN_ENV=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_SCL_SECURE_NO_WARNINGS=1 /J /fp:precise")
+ set(XMP_SHARED_COMPILE_DEBUG_FLAGS "")
+ set(XMP_SHARED_COMPILE_RELEASE_FLAGS "/O1 /Ob2 /Os /Oy- /GL /FD ")
+
+ set(XMP_SHARED_COMPILE_DEBUG_FLAGS "${XMP_SHARED_COMPILE_DEBUG_FLAGS} /MDd")
+ set(XMP_SHARED_COMPILE_RELEASE_FLAGS "${XMP_SHARED_COMPILE_RELEASE_FLAGS} /MD")
+
+ set(XMP_PLATFORM_LINK_WIN "${XMP_WIN32_LINK_EXTRAFLAGS} /MAP")
+endif ()
+
+
diff --git a/build/README.txt b/build/README.txt
index 1169937..322c4c8 100644
--- a/build/README.txt
+++ b/build/README.txt
@@ -1,23 +1,23 @@
-This README describes steps to generate project files on different platforms.These platform specific projects can then be used to build the XMPToolkit SDK.Before generating the projects the SDK developer needs to copy dependencies to the proper locations. Refer to "Dependencies" section in XMP Toolkit Programmer's Guide.
+This README describes steps to generate project files on different platforms. These platform specific projects can then be used to build the XMPToolkit SDK. Before generating the projects the SDK developer needs to copy the dependencies to the proper locations. Refer to "Dependencies" section in the XMP Toolkit Programmer's Guide.
-WINDOWS XP and above
-Options to generate Project files in Windows is of the form "Generate XMPSDKToolkit [Dynamic|static] [Win32|x64]".An option of "Dynamic" indicates that the generated project files will build a dll for the XMP SDK components.On the other hand the option of "Static" indicates that the generated project files will build a static lib for the XMP SDK components.Options for "Win32" or "x64" indicates that the generated project files will build the library for 32 bit or 64 bit applications respectively.
-1. Open the windows command prompt and change the current directory to <xmpsdk>/build. 2. Run the batch file GenerateXMPToolkitSDK_win.bat. There will be four options(2-5) to build projects for different configurations, one option(6) to generate projects for all configurations and one option(1) to clean all the projects. 3. After running the batch file (options 2-6),the vc10 projects(using cmake) will be generated at the location <xmpsdk>/build/vc10/<static|dynamic>/<windows|windows_x64>/<XMPToolkitSDK.sln|XMPToolkitSDK64.sln>. 4. Open the visual studio solution file and build XMP Toolkit SDK for debug/release configuration.
-MAC OS X 10.6 and above
-Options to generate Project files in Mac is of the form "Generate XMPSDKToolkit [Dynamic|static] [32|64|iOS]".An option of "Dynamic" indicates that the generated project files will build a framework for the XMP SDK components.On the other hand the option of "Static" indicates that the generated project files will build a static lib for the XMP SDK components.Options for "32" or "64" indicates that the generated project files will build for 32 bit or 64 bit applications respectively. The option of "iOS" will generate the project files that will build XMP Core library for iOS simulators and iOS devices.
+WINDOWS 7 and above
+Options to generate Project files in Windows are of the form "Generate XMPSDKToolkit [Dynamic|static] [Win32|x64]". An option of "Dynamic" indicates that the generated project files will build a dll for the XMP SDK components. On the other hand the option of "Static" indicates that the generated project files will build a static lib for the XMP SDK components. Options for "Win32" or "x64" indicate that the generated project files will build the library for 32 bit or 64 bit applications respectively.
+1. Open the windows command prompt and change the current directory to <xmpsdk>/build. 2. Run the batch file GenerateXMPToolkitSDK_win.bat. There will be four options(2-5) to build projects for different configurations, one option(6) to generate projects for all configurations and one option(1) to clean all the projects. 3. After running the batch file (options 2-6),the vc11 projects(using cmake) will be generated at the location <xmpsdk>/build/vc11/<static|dynamic>/<windows|windows_x64>/<XMPToolkitSDK.sln|XMPToolkitSDK64.sln>. 4. Open the Visual Studio solution file and build XMP Toolkit SDK for debug/release configuration.
+MAC OS X 10.7 and above
+Options to generate Project files in Mac are of the form "Generate XMPSDKToolkit [Dynamic|static] [32|64|iOS]". An option of "Dynamic" indicates that the generated project files will build a framework for the XMP SDK components. On the other hand the option of "Static" indicates that the generated project files will build a static lib for the XMP SDK components. Options for "32" or "64" indicate that the generated project files will build for 32 bit or 64 bit applications respectively. The option of "iOS" will generate the project files that will build XMP Core library for iOS simulators and iOS devices.
1. Open the Terminal on Mac and change the current directory to <xmpsdk>/build. 2. Run the shell script GenerateXMPToolkitSDK_mac.sh. There will be five options(2-6) to build projects for different configurations, one option(7) to generate projects for all configurations and one option(1) to clean all the projects.
3. After running the batch file (options 2-7),the xcode projects will be generated(using cmake) at the location <xmpsdk>/build/xcode/<static|dynamic>/<intel|intel_64>/<XMPToolkitSDK.xcodeproj|XMPToolkitSDK64.xcodeproj>.
4. Open the xcodeproj file and build XMP Toolkit SDK for debug/release configuration.
-Note: When multiple Xcode versions are installed on a system, the developer has to use xcode-select command to specify the Xcode version that he wishes to use.This is done in two steps by fetching the current Xcode folder and changing it if required.
+Note: When multiple Xcode versions are installed on a system, the developer has to use xcode-select command to specify the Xcode version that he/she wishes to use. This is done in two steps by fetching the current Xcode folder and changing it if required.
1) Fetch the current Xcode folder $ xcode-select -print-path
-2) Change the Xcode Folder if required.For example if the new XCode path is /Applications/Xcode.app $ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer Note: Presently a single scheme is created for each project. For building different configurations the Release or Debug configurations has to be selected using "Edit Scheme -> Run -> Release/Debug
-LINUX
-Options to generate makefiles in Linux is given in the form of a Makefile with different targets.The targets available are
-StaticAll: Generate the Makefiles for static libraries and build them. Includes both Debug and Release libs. DynamicAll: Generate the Makefiles for shared libraries and build them. Includes both Debug and Release libs. DebugAll: Generate the Makefiles for Debug libraries and build them. Includes both static and dynamic libs. ReleaseAll: Generate the Makefiles for Release libraries and build them. Includes both static and dynamic libs.
+2) Change the Xcode Folder if required. For example if the new XCode path is /Applications/Xcode.app $ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer Note: Presently a single scheme is created for each project. For building different configurations the Release or Debug configurations has to be selected using "Edit Scheme -> Run -> Release/Debug
+ LINUX
+Options to generate makefiles in Linux are given in the form of a Makefile with different targets. The targets available are
+StaticAll: Generates the Makefiles for static libraries and builds them. Includes both Debug and Release libs. DynamicAll: Generates the Makefiles for shared libraries and builds them. Includes both Debug and Release libs. DebugAll: Generates the Makefiles for Debug libraries and builds them. Includes both static and dynamic libs. ReleaseAll: Generates the Makefiles for Release libraries and builds them. Includes both static and dynamic libs.
1. Change the current directory to <xmpsdk>/build. 2. Make sure the gcc location is added to $PATH and its libraries location to $LD_LIBRARY_PATH. There is a need to add libuuid.so library path to the $LD_LIBRARY_PATH as well.
-3. This <xmpsdk>/build folder contains a Makefile which has different targets to build and the default is to build all of them.The Makefile generates the makefiles(using cmake) to build the project and then calls these makefiles to build the target.
+3. This <xmpsdk>/build folder contains a Makefile which has different targets to build and the default is to build all of them. The Makefile generates the makefiles(using cmake) to build the project and then calls these makefiles to build the target.
-Note: Generating gcc Makefiles to build the project requires the path to the gcc set in the CMake toolchain file for Linux i.e. <xmpsdk>/build/shared/ToolchainGCC.cmake. In this file modifications must be done by the developer to set the CMAKE_FIND_ROOT_PATH so that CMake picks the desired gcc compiler. He may also want to change the parameter XMP_ENABLE_SECURE_SETTINGS as per the configured gcc.
- a) If the gcc is configured with --enable-libssp (can be checked by executing gcc -v), he has to set the variable XMP_GCC_LIBPATH inside of file <xmpsdk>/build/XMP_Linux.cmake to the path containing the static lib( libssp.a).In this case he can set the variable the XMP_ENABLE_SECURE_SETTINGS on.
-b) If the gcc is configured with --disable-libssp, he has to set the variable XMP_ENABLE_SECURE_SETTINGS off.
-================================================================================================================================================= Note: The projects for different platforms are now generated using CMake. CMake generates projects with absolute paths so they cannot be copied from one place to other. If the projects is to be moved then whole tree has to be copied to the new location and CMake should be invoked again
+Note: Generating gcc Makefiles to build the project requires the path to the gcc set in the CMake toolchain file for Linux i.e. <xmpsdk>/build/shared/ToolchainGCC.cmake. In this file modifications must be done by the developer to set the CMAKE_FIND_ROOT_PATH so that CMake picks the desired gcc compiler. He/She may also want to change the parameter XMP_ENABLE_SECURE_SETTINGS as per the configured gcc.
+ a) If the gcc is configured with --enable-libssp (can be checked by executing gcc -v), he/she has to set the variable XMP_GCC_LIBPATH inside of file <xmpsdk>/build/ProductConfig.cmake to the path containing the static lib( libssp.a). In this case he/she can set the variable the XMP_ENABLE_SECURE_SETTINGS on.
+b) If the gcc is configured with --disable-libssp, he/she has to set the variable XMP_ENABLE_SECURE_SETTINGS off.
+================================================================================================================================================= Note: The projects for different platforms are generated using CMake. CMake generates projects with absolute paths so they cannot be copied from one place to other. If the project is to be moved, then the whole tree has to be copied to the new location and CMake should be invoked again.
diff --git a/build/XMP_Config.cmake b/build/XMP_Config.cmake
index 60526c3..e0377de 100644
--- a/build/XMP_Config.cmake
+++ b/build/XMP_Config.cmake
@@ -12,510 +12,13 @@
cmake_minimum_required(VERSION 2.8.6)
# ==============================================================================
-# Shared config for XMPTOOLKIT and TestRunner
+# XMP config for XMPTOOLKIT and TestRunner
# ==============================================================================
if(NOT DEFINED XMP_ROOT)
set(XMP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH})
- message (XMP_ROOT= " ${XMP_ROOT} ")
endif()
if(NOT DEFINED COMMON_BUILD_SHARED_DIR)
set(COMMON_BUILD_SHARED_DIR ${XMP_ROOT}/build/shared)
- message (COMMON_BUILD_SHARED_DIR= " ${COMMON_BUILD_SHARED_DIR} ")
endif()
+include(${XMP_ROOT}/build/XMP_ConfigCommon.cmake)
-#add definition specific to XMP and shared by all projects
-add_definitions(-DXML_STATIC=1 -DHAVE_EXPAT_CONFIG_H=1)
-if(XMP_BUILD_STATIC)
- add_definitions(-DXMP_StaticBuild=1)
-endif()
-
-set (XMPROOT_DIR ${XMP_ROOT})
-set (COMPONENT XMP)
-
-
-# Load project specific MACRO, VARIABLES; set for component and pass to the common file where there are set
-if (UNIX)
- if (APPLE)
- if (APPLE_IOS)
- include(${XMP_ROOT}/build/XMP_Ios.cmake)
- else ()
- include(${XMP_ROOT}/build/XMP_Mac.cmake)
- endif ()
- else ()
- execute_process(COMMAND "uname" OUTPUT_VARIABLE OSNAME)
- string(TOUPPER "${OSNAME}" OSNAME)
-
- if ( ${OSNAME} MATCHES SUNOS)
- execute_process(COMMAND "uname" "-p" OUTPUT_VARIABLE PLATFORM_SUNOS_ARCH)
- string(TOUPPER "${PLATFORM_SUNOS_ARCH}" PLATFORM_SUNOS_ARCH)
-
- if ( ${PLATFORM_SUNOS_ARCH} MATCHES SPARC)
- include(${XMP_ROOT}/build/XMP_sunos_sparc.cmake)
- else()
- include(${XMP_ROOT}/build/XMP_sunos_intel.cmake)
- endif()
- else()
- include(${XMP_ROOT}/build/XMP_Linux.cmake)
- endif()
- endif ()
-else ()
- if (WIN32)
- include(${XMP_ROOT}/build/XMP_Win.cmake)
- endif ()
-endif ()
-
-
-
-include(${COMMON_BUILD_SHARED_DIR}/SharedConfig.cmake)
-
-
-# ==============================================================================
-# Function: Create output dir and copy static library to it
-# ==============================================================================
-#
-function(CreateStaticLib productname outputDir)
- if(UNIX)
- add_custom_command (TARGET ${productname} POST_BUILD
- COMMAND mkdir -p ${outputDir}
- COMMAND cp -f -p ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${productname}.a ${outputDir}/lib${productname}.a
- COMMENT "create output directory and copy lib to it")
- endif(UNIX)
-endfunction(CreateStaticLib)
-
-# ==============================================================================
-# Function: Copy resource(s) to bundle/lib resource folder
-# ==============================================================================
-#
-function(CopyResource appname outputDir copyWhat)
- if(XMP_BUILD_STATIC)
- add_custom_command (TARGET ${productname} COMMAND ${CMAKE_COMMAND} -E remove_directory ${outputDir} COMMENT "Remove resource dir")
- if(UNIX)
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMAND mkdir -p ${outputDir}
- COMMAND cp -f ${copyWhat} ${outputDir}
- COMMENT "Copy resource")
- else(UNIX)
- file(TO_NATIVE_PATH "${outputDir}" outputDir_NAT)
- file(TO_NATIVE_PATH "${copyWhat}" copyWhat_NAT)
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMAND mkdir ${outputDir_NAT}
- COMMAND copy /Y ${copyWhat_NAT} ${outputDir_NAT}
- COMMENT "Copy resource")
- endif(UNIX)
- else(XMP_BUILD_STATIC)
- if(UNIX)
- if(APPLE)
- if(APPLE_IOS)
- else(APPLE_IOS)
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMAND mkdir -p ${outputDir}
- COMMAND cp -f ${copyWhat} ${outputDir}
- COMMENT "Copy resource")
- endif(APPLE_IOS)
- else(APPLE)
- # Linux
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMAND mkdir -p ${outputDir}
- COMMAND cp -f ${copyWhat} ${outputDir}
- COMMENT "Copy resource")
- endif(APPLE)
- endif(UNIX)
- endif(XMP_BUILD_STATIC)
-endfunction(CopyResource)
-
-# ==============================================================================
-# Function: Create a plugin shell and copy necessary things into resource folder
-# ==============================================================================
-# Win: DLL, resources are linked into DLL
-# OSX: Make Bundle, resources are copied into Bundle's resource folder
-# Linux: so, resources reside in a folder next to the so with so's name and ".resource" extension
-#
-function(CreatePlugin productname outputDir copyWhat)
- if(UNIX)
- if(APPLE)
- if(APPLE_IOS OR XMP_BUILD_STATIC)
- CreateStaticLib(${productname} ${outputDir})
- CopyResource(${productname} "${outputDir}/lib${productname}.resources" "${copyWhat}")
- else()
- # create a bundle, copy essential executable into bundle, but don't change output path
- #MakeBundle(${productname} "bundle" ${outputDir} "Info.plist" "Info_plist.h")
- MakeBundle(${productname} "xpi" ${outputDir} "" )
- # copy resources
- #CopyResource(${productname} "${outputDir}/${productname}.bundle/Contents/Resources" "${copyWhat}")
-
- # redo on this level: force no extension to make below bundle creation work
- set(CMAKE_SHARED_MODULE_PREFIX "" PARENT_SCOPE)
- set(CMAKE_SHARED_MODULE_SUFFIX "" PARENT_SCOPE)
- endif()
- else(APPLE)
- # Linux
- if(XMP_BUILD_STATIC)
- CreateStaticLib(${productname} ${outputDir})
- CopyResource(${productname} "${outputDir}/lib${productname}.resources" "${copyWhat}")
- else()
- set(XMP_SHARED_MODULE_SUFFIX ".xpi")
- set_target_properties(${productname} PROPERTIES SUFFIX ${XMP_SHARED_MODULE_SUFFIX})
- set_target_properties(${productname} PROPERTIES PREFIX "")
- set(LIBRARY_OUTPUT_PATH ${outputDir} PARENT_SCOPE)
- # copy resources
- #CopyResource(${productname} "${outputDir}/${productname}.resources" "${copyWhat}")
-
- # ExpliXMPly set a softlink with the version e.g plugin.so.2.0.0-> plugin.so for each Plugin
- #if ( NOT DEFINED XMP_VERSION)
- set (XMP_VERSION 1.0.0) # if not set this should only be the case for the SDK templates we set it to 1.0.0
- #endif()
- #set_target_properties(${productname} PROPERTIES SOVERSION ${XMP_VERSION})
- endif()
- endif(APPLE)
- else(UNIX)
- if(WIN32)
- # set pre/suf-fix
- set(CMAKE_SHARED_MODULE_PREFIX "" PARENT_SCOPE)
- set(XMP_SHARED_MODULE_SUFFIX ".xpi")
- set_target_properties(${productname} PROPERTIES SUFFIX ${XMP_SHARED_MODULE_SUFFIX})
- # we can't use LIBRARY_OUTPUT_PATH, so build in CMake dir and copy, otherwise an unwanted subfolder is created
- add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND}
- -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/${XMP_BUILDMODE_DIR} ${outputDir}/${TARGET_NAME}
- COMMENT "Copy to output dir")
-
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPRODUCT_NAME=\"${PRODUCT_NAME}\"" PARENT_SCOPE)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPRODUCT_NAME=\"${PRODUCT_NAME}\"" PARENT_SCOPE)
-
- if(XMP_BUILD_STATIC)
- CopyResource(${productname} "${outputDir}/${productname}.resources" "${copyWhat}")
- endif(XMP_BUILD_STATIC)
- endif(WIN32)
- endif(UNIX)
-endfunction(CreatePlugin)
-
-# ==============================================================================
-# Function: Find plugins in XMPPlugin folder and return the list of names
-# ==============================================================================
-#
-function(FindEnabledPlugins resultName)
- file (GLOB XMPPLUGIN_DIRS ${XMP_ROOT}/XMPPlugin/*)
- foreach(item ${XMPPLUGIN_DIRS})
- file (GLOB plugin_project FILES ${item}/build/CMakeLists.txt)
- if(plugin_project)
- get_filename_component(pluginProjectName ${item} NAME)
- if (NOT ${pluginProjectName}_EXCLUDE)
- set(names ${names} ${pluginProjectName})
- endif()
- endif()
- endforeach()
- set(${resultName} ${names} PARENT_SCOPE)
-endfunction(FindEnabledPlugins)
-
-# ==============================================================================
-# Function: Append static lib to target
-# ==============================================================================
-#
-function(AppendStaticLib outputDir targetName srcLibDir srcLibName)
- if(UNIX)
- if(APPLE_IOS)
- add_custom_command (TARGET ${targetName} POST_BUILD
- COMMAND mkdir -p ${srcLibDir}/${srcLibName}_TEMP
- COMMAND cd ${srcLibDir}/${srcLibName}_TEMP && ${CMAKE_AR} x ${srcLibDir}/lib${srcLibName}.a
- #COMMAND split lipo ${srcLibDir}/lib${srcLibName}.a -thin armv6 -output ${srcLibDir}/lib${srcLibName}arm6.a
- #COMMAND split lipo ${srcLibDir}/lib${srcLibName}.a -thin armv7 -output ${srcLibDir}/lib${srcLibName}arm7.a
- #COMMAND merge again lipo ${srcLibDir}/lib${srcLibName}arm6.a ${srcLibDir}/lib${srcLibName}arm7.a -create -output ${srcLibDir}/lib${srcLibName}.a
- COMMAND ${CMAKE_AR} rs ${outputDir}/lib${targetName}.a ${srcLibDir}/${srcLibName}_TEMP/*.o
- COMMAND rm -rf ${srcLibDir}/${srcLibName}_TEMP
- COMMENT "extract objects from lib${srcLibName}.a and pack to lib${targetName}.a")
- else()
- add_custom_command (TARGET ${targetName} POST_BUILD
- COMMAND mkdir -p ${srcLibDir}/${srcLibName}_TEMP
- COMMAND cd ${srcLibDir}/${srcLibName}_TEMP
- && ${CMAKE_AR} x ${srcLibDir}/lib${srcLibName}.a
- COMMAND ${CMAKE_AR} rs ${outputDir}/lib${targetName}.a ${srcLibDir}/${srcLibName}_TEMP/*.o
- COMMAND rm -rf ${srcLibDir}/${srcLibName}_TEMP
- COMMENT "extract objects from lib${srcLibName}.a and pack to lib${targetName}.a")
- endif()
- else(UNIX)
- if(WIN32)
- add_custom_command (TARGET ${targetName} POST_BUILD
- COMMAND cd ${outputDir}
- && lib.exe /OUT:${targetName}.lib ${outputDir}/${targetName}.lib ${srcLibDir}/${srcLibName}.lib
- COMMENT "extract objects from ${srcLibName}.lib and pack to ${targetName}.lib")
- endif(WIN32)
- endif(UNIX)
-endfunction(AppendStaticLib)
-
-# ==============================================================================
-# Function: INTERNAL used only!
-# Merge static plugin libraries into output library
-# ==============================================================================
-#
-function(MergeStaticLibs_Internal outputDir targetName useSubDir srcLibDir srcLibNames)
- foreach(libName ${${srcLibNames}})
- if(useSubDir)
- set(correctedDir ${srcLibDir}/${libName})
- else()
- set(correctedDir ${srcLibDir})
- endif()
- AppendStaticLib(${outputDir} ${targetName} ${correctedDir} ${libName})
- endforeach()
-endfunction(MergeStaticLibs_Internal)
-
-# ==============================================================================
-# Function: Merge static plugin libraries into output library
-# ==============================================================================
-#
-function(MergeStaticLibs outputDir targetName useSubDir srcLibDir srcLibNames)
- MergeStaticLibs_Internal(${outputDir} ${targetName} ${useSubDir} ${srcLibDir} ${srcLibNames})
- if(APPLE)
- if(APPLE_IOS)
- else(APPLE_IOS)
- # APPLE need run ranlib to fix broken TOC
- add_custom_command (TARGET ${targetName} POST_BUILD
- COMMENT "Run ranlib to fix broken TOC of library file lib${targetName}.a"
- COMMAND ${CMAKE_RANLIB} ${outputDir}/lib${targetName}.a
- )
- endif(APPLE_IOS)
- endif(APPLE)
-endfunction(MergeStaticLibs)
-
-# ==============================================================================
-# Function: Get XMP Framework's output name
-# ==============================================================================
-#
-function(GetXMPFrameworkOutputName result)
- if(UNIX)
- if(APPLE)
- if(XMP_BUILD_STATIC)
- set(outputName "libXMP.a")
- else()
- set(outputName "XMP.framework")
- endif()
- else(APPLE)
- if(XMP_BUILD_STATIC)
- set(outputName "libXMP.a")
- else()
- set(outputName "libXMP.so")
- endif()
- endif(APPLE)
- else(UNIX)
- if(WIN32)
- if(XMP_BUILD_STATIC)
- set(outputName "XMP.lib")
- else()
- set(outputName "XMP.dll")
- endif()
- endif(WIN32)
- endif(UNIX)
- set(${result} ${outputName} PARENT_SCOPE)
-endfunction(GetXMPFrameworkOutputName)
-
-# ==============================================================================
-# Macro: Add Plugin API files to project
-# For convenience we define the sources as a variable. You can add
-# header files and cpp/c files and CMake will sort them out
-# ==============================================================================
-#
-macro(AddPluginApiFiles relativePathToXMPPluginFolder)
- file (GLOB API_INCLUDE_FILES ${PROJECT_SOURCE_DIR}/${relativePathToXMPPluginFolder}/XMPFilesPlugins/api/source/*.h)
- source_group(api\\include FILES ${API_INCLUDE_FILES})
-
- file (GLOB API_SOURCE_FILES ${PROJECT_SOURCE_DIR}/${relativePathToXMPPluginFolder}/XMPFilesPlugins/api/source/*.cpp )
- source_group(api\\source FILES ${API_SOURCE_FILES})
-endmacro(AddPluginApiFiles)
-
-# ==============================================================================
-# Macro: Add Resource files to project
-# For convenience we define the sources as a variable. You can add
-# header files and cpp/c files and CMake will sort them out
-# ==============================================================================
-#
-macro(AddPluginResourceFiles)
- list(APPEND RESOURCE_FILES ${PROJECT_ROOT}/resource/txt/MODULE_IDENTIFIER.txt)
- if (CMAKE_CL_64)
- list(APPEND RESOURCE_FILES ${PROJECT_ROOT}/resource/txt/XMPPLUGINUIDS-64.txt)
- else()
- list(APPEND RESOURCE_FILES ${PROJECT_ROOT}/resource/txt/XMPPLUGINUIDS-32.txt)
- endif()
-
- # If we build for windows systems, we also include the resource file containing the manifest, icon and other resources
- if(WIN32)
- if (CMAKE_CL_64)
- list (APPEND RESOURCE_FILES ${RESOURCE_ROOT}/${XMP_PLATFORM_SHORT}/${PRODUCT_NAME}-64.rc)
- else(CMAKE_CL_64)
- list (APPEND RESOURCE_FILES ${RESOURCE_ROOT}/${XMP_PLATFORM_SHORT}/${PRODUCT_NAME}-32.rc)
- endif(CMAKE_CL_64)
- endif()
- source_group("Resource Files" FILES ${RESOURCE_FILES})
-endmacro(AddPluginResourceFiles)
-
-
-# ==============================================================================
-# Macro: Set Plugin Output folder
-# ==============================================================================
-#
-macro(SetPluginOutputPath)
- if(UNIX)
- if(APPLE)
- set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${CMAKE_CFG_INTDIR})
- else()
- endif()
- else()
- set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${CMAKE_CFG_INTDIR}/${PRODUCT_NAME})
- endif()
-endmacro(SetPluginOutputPath)
-
-# ==============================================================================
-# Function: Setup XMP for the application
-# Copy XMP library, create a symbolic link to Plug-ins, copy MediaAccess and fixup
-# ==============================================================================
-#
-function(SetupXMPForApp appname outputDir)
- # are optional parameter set?
- if(ARGV2 AND NOT APPLE_IOS)
- if(${ARGV2} MATCHES "FFMPEG")
- set(copyFFMpegLibs 1)
- else()
- set(copyFFMpegLibs 0)
- endif()
- else()
- set(copyFFMpegLibs 0)
- endif()
-
- if(NOT copyFFMpegLibs)
- set(ignoreCommand "#")
- else ()
- set(ignoreCommand "COMMAND")
- endif()
-
- if(APPLE_IOS)
- set(ignoreCommandOnIOS "#")
- set(ignoreCommandOnOSX "COMMAND")
- else ()
- set(ignoreCommandOnIOS "COMMAND")
- set(ignoreCommandOnOSX "#")
- endif()
-
-
- if(UNIX)
- if(APPLE)
- set(BUILT_PRODUCTS_DIR ${outputDir}/${appname}.app/Contents)
- # GetXMPFrameworkOutputName(XMP_FRAMEWORK_NAME)
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMENT "Copy necessary XMP items and create symlink to Plug-ins dir"
- COMMAND echo clear XMP dir
- ${ignoreCommandOnIOS} rm -fR ${BUILT_PRODUCTS_DIR}/Frameworks/XMP
- COMMAND mkdir -p ${BUILT_PRODUCTS_DIR}/Frameworks/XMP
- ${ignoreCommandOnIOS} echo Copy XMP
- ${ignoreCommandOnIOS} rm -fR ${BUILT_PRODUCTS_DIR}/Frameworks/${XMP_FRAMEWORK_NAME}*
- ${ignoreCommandOnIOS} ln -s ${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME} ${BUILT_PRODUCTS_DIR}/Frameworks/${XMP_FRAMEWORK_NAME}
- ${ignoreCommandOnIOS} ln -s ${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME}.dSYM ${BUILT_PRODUCTS_DIR}/Frameworks/${XMP_FRAMEWORK_NAME}.dSYM
- ${ignoreCommand} echo Copy MediaAccess
- ${ignoreCommand} mkdir -p ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess
- ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/ ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess
- ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/ffmpeg/bin/${XMP_BITDEPTH}/lib* ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess
- ${ignoreCommand} ${XMPROOT_DIR}/XMPMediaAccess/build/UpdateFFMPEGLibSearchPath.sh "@executable_path/../Frameworks/XMP/MediaAccess" "${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess"
- ${ignoreCommandOnIOS} echo Copy XMP plugins shared libs
- ${ignoreCommandOnIOS} cp -f -p -R ${XMPLIBRARIES_DIR}/Plug-ins/copy_to_app_dir/ ${BUILT_PRODUCTS_DIR}/Frameworks/
- ${ignoreCommandOnIOS} echo create symlinks
- ${ignoreCommandOnIOS} ln -s ${XMPLIBRARIES_DIR}/Plug-ins/ ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/Plug-ins
- ${ignoreCommandOnOSX} echo copy plugin data
- ${ignoreCommandOnOSX} mkdir -p ${BUILT_PRODUCTS_DIR}/Resources/XMP/Plug-ins
- ${ignoreCommandOnOSX} cp -fpR ${XMPLIBRARIES_DIR}/Plug-ins/ ${BUILT_PRODUCTS_DIR}/Resources/XMP/Plug-ins
- )
- else(APPLE)
- # Do not copy FFMpeg libs if they don't exist
- if(NOT EXISTS ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/FFMpegWrapper.mediaaccess)
- set(ignoreCommand "#")
- else ()
- set(ignoreCommand "COMMAND")
- endif()
-
- set(BUILT_PRODUCTS_DIR ${outputDir})
- # GetXMPFrameworkOutputName(XMP_FRAMEWORK_NAME)
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMENT "Copy necessary XMP items and create symlink to Plug-ins dir"
- COMMAND echo clear XMP dir
- COMMAND rm -f -R ${BUILT_PRODUCTS_DIR}/XMP
- COMMAND mkdir -p ${BUILT_PRODUCTS_DIR}/XMP
- COMMAND echo Copy XMP
- COMMAND rm -f -R ${BUILT_PRODUCTS_DIR}/libXMP*
- COMMAND ln -s ${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME} ${BUILT_PRODUCTS_DIR}/${XMP_FRAMEWORK_NAME}
- ${ignoreCommand} echo Copy MediaAccess
- ${ignoreCommand} mkdir -p ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
- ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/*.* ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
- #COMMAND ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/ffmpeg/bin/${XMP_BITDEPTH}/*.* ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
- COMMAND echo Copy XMP plugins shared libs
- #COMMAND cp -f -p -R ${XMPLIBRARIES_DIR}/Plug-ins/copy_to_app_dir/ ${BUILT_PRODUCTS_DIR}/
- COMMAND echo create symlinks
- COMMAND ln -s ${XMPLIBRARIES_DIR}/Plug-ins/ ${BUILT_PRODUCTS_DIR}/XMP/Plug-ins
- )
- endif(APPLE)
- else(UNIX)
- if(WIN32)
- # Windows -------------------------------------------
- set(BUILT_PRODUCTS_DIR ${outputDir})
- # GetXMPFrameworkOutputName(XMP_FRAMEWORK_NAME)
- file(TO_NATIVE_PATH "${BUILT_PRODUCTS_DIR}/XMP/Plug-ins" BUILT_PLUGINS_DIR_NAT)
- file(TO_NATIVE_PATH "${XMPLIBRARIES_DIR}/Plug-ins" PLUGINS_DIR_NAT)
- file(TO_NATIVE_PATH "${BUILT_PRODUCTS_DIR}/${XMP_FRAMEWORK_NAME}" DEST_XMP_NAT)
- file(TO_NATIVE_PATH "${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME}" SRC_XMP_NAT)
- file(TO_NATIVE_PATH "${BUILT_PRODUCTS_DIR}/XMP.pdb" DEST_XMP_PDB_NAT)
- file(TO_NATIVE_PATH "${XMPLIBRARIES_DIR}/XMP.pdb" SRC_XMP_PDB_NAT)
-
- #For Windows XP we need to use junction.exe instead of mklink which is only available on Windows Vista and above
- if((${CMAKE_SYSTEM} MATCHES "Windows-5.1") OR (${CMAKE_SYSTEM} MATCHES "Windows-5.2"))
- message (STATUS "- Use junction.exe to create links instead of mklink we either run on Win XP 32 or 64 bit")
- set(link_command ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/resources/tools/junction/junction.exe -accepteula )
- set(remove_XMP "echo")
- set(copy_link_XMP ${CMAKE_COMMAND} -E copy ${SRC_XMP_NAT} ${BUILT_PRODUCTS_DIR}/)
- set(copy_link_XMP_pdb ${CMAKE_COMMAND} -E copy ${SRC_XMP_PDB_NAT} ${BUILT_PRODUCTS_DIR}/)
- else()
- set(link_command mklink /D )
- set(remove_XMP ${CMAKE_COMMAND} -E remove -f ${DEST_XMP_NAT} ${DEST_XMP_PDB_NAT})
- set(copy_link_XMP mklink ${DEST_XMP_NAT} ${SRC_XMP_NAT})
- set(copy_link_XMP_pdb mklink ${DEST_XMP_PDB_NAT} ${SRC_XMP_PDB_NAT})
- endif()
-
- add_custom_command (TARGET ${appname} POST_BUILD
- COMMENT "Copy necessary XMP items and create symlink to Plug-ins dir"
- COMMAND echo - clear XMP dir
- COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILT_PRODUCTS_DIR}/XMP
- COMMAND echo - symlink XMP.dll and XMP.pdb
- COMMAND ${remove_XMP}
- COMMAND ${copy_link_XMP}
- COMMAND ${copy_link_XMP_pdb}
- COMMAND echo - copy XMP plugins shared libs (tbb etc)
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${XMPLIBRARIES_DIR}/Plug-ins/copy_to_app_dir/ ${BUILT_PRODUCTS_DIR}
- ${ignoreCommand} echo - copy FFMPEG libs
- ${ignoreCommand} ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/ffmpeg/bin/${XMP_BITDEPTH}/ ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
- ${ignoreCommand} ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/FFMpegWrapper.mediaaccess ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess/FFMpegWrapper.mediaaccess
- ${ignoreCommand} ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/ffmpegwrapper.pdb ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess/ffmpegwrapper.pdb
- COMMAND echo - remove symbolic link to plug-ins dir
- COMMAND rmdir ${BUILT_PLUGINS_DIR_NAT}
- COMMAND echo - execute symbolic link command
- COMMAND ${link_command} ${BUILT_PLUGINS_DIR_NAT} ${PLUGINS_DIR_NAT}
- )
- endif(WIN32)
- endif(UNIX)
-endfunction(SetupXMPForApp)
-
-# ==============================================================================
-# Function: GenerateInitFileForStaticBuild
-# Collect registrar initializer functions and create source in temp directory
-# out of it for static linkage
-# ==============================================================================
-#
-function(GenerateInitFileForStaticBuild)
- if(XMP_BUILD_STATIC)
- set(targetFile ${XMP_ROOT}/XMPApi/source/PluginStaticInit_TEMP.cpp)
- file(REMOVE ${targetFile})
-
- set(initDecl "#if XMP_BUILD_STATIC\n\n")
- set(initFunc "namespace XMP\n{\n void InstanciateRegistrarsForAllPlugins()\n {\n")
- foreach(pluginName ${XMP_ENABLED_PLUGINS})
- set(initDecl "${initDecl}extern void ${pluginName}_InstanciateRegistrars()\;\n")
- set(initFunc "${initFunc} ::${pluginName}_InstanciateRegistrars()\;\n")
- endforeach()
- set(initFunc "${initFunc} }\n}\n")
- set(initFunc "${initDecl}\n${initFunc}\n#endif\n")
-
- file(WRITE ${targetFile} ${initFunc})
- endif(XMP_BUILD_STATIC)
-endfunction(GenerateInitFileForStaticBuild)
diff --git a/build/XMP_ConfigCommon.cmake b/build/XMP_ConfigCommon.cmake
new file mode 100644
index 0000000..0dbb31b
--- /dev/null
+++ b/build/XMP_ConfigCommon.cmake
@@ -0,0 +1,481 @@
+# =================================================================================================
+# ADOBE SYSTEMS INCORPORATED
+# Copyright 2013 Adobe Systems Incorporated
+# All Rights Reserved
+#
+# NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
+# of the Adobe license agreement accompanying it.
+# =================================================================================================
+
+# ==============================================================================
+# define minimum cmake version
+cmake_minimum_required(VERSION 2.8.6)
+
+#add definition specific to XMP and shared by all projects
+add_definitions(-DXML_STATIC=1 -DHAVE_EXPAT_CONFIG_H=1 )
+if(XMP_BUILD_STATIC)
+ add_definitions(-DXMP_StaticBuild=1)
+else()
+ add_definitions(-DXMP_DynamicBuild=1)
+endif()
+add_definitions(-DBUILDING_XMPCOMMON_LIB=1)
+
+set (XMPROOT_DIR ${XMP_ROOT})
+set (COMPONENT XMP)
+
+
+# Load project specific MACRO, VARIABLES; set for component and pass to the common file where there are set
+include(${XMP_ROOT}/build/ProductConfig.cmake)
+include(${COMMON_BUILD_SHARED_DIR}/SharedConfig.cmake)
+
+
+# ==============================================================================
+# Function: Create output dir and copy static library to it
+# ==============================================================================
+#
+function(CreateStaticLib productname outputDir)
+ if(UNIX)
+ add_custom_command (TARGET ${productname} POST_BUILD
+ COMMAND mkdir -p ${outputDir}
+ COMMAND cp -f -p ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${productname}.a ${outputDir}/lib${productname}.a
+ COMMENT "create output directory and copy lib to it")
+ endif(UNIX)
+endfunction(CreateStaticLib)
+
+# ==============================================================================
+# Function: Copy resource(s) to bundle/lib resource folder
+# ==============================================================================
+#
+function(CopyResource appname outputDir copyWhat)
+ if(XMP_BUILD_STATIC)
+ add_custom_command (TARGET ${productname} COMMAND ${CMAKE_COMMAND} -E remove_directory ${outputDir} COMMENT "Remove resource dir")
+ if(UNIX)
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMAND mkdir -p ${outputDir}
+ COMMAND cp -f ${copyWhat} ${outputDir}
+ COMMENT "Copy resource")
+ else(UNIX)
+ file(TO_NATIVE_PATH "${outputDir}" outputDir_NAT)
+ file(TO_NATIVE_PATH "${copyWhat}" copyWhat_NAT)
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMAND mkdir ${outputDir_NAT}
+ COMMAND copy /Y ${copyWhat_NAT} ${outputDir_NAT}
+ COMMENT "Copy resource")
+ endif(UNIX)
+ else(XMP_BUILD_STATIC)
+ if(UNIX)
+ if(APPLE)
+ if(APPLE_IOS)
+ else(APPLE_IOS)
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMAND mkdir -p ${outputDir}
+ COMMAND cp -f ${copyWhat} ${outputDir}
+ COMMENT "Copy resource")
+ endif(APPLE_IOS)
+ else(APPLE)
+ # Linux
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMAND mkdir -p ${outputDir}
+ COMMAND cp -f ${copyWhat} ${outputDir}
+ COMMENT "Copy resource")
+ endif(APPLE)
+ endif(UNIX)
+ endif(XMP_BUILD_STATIC)
+endfunction(CopyResource)
+
+# ==============================================================================
+# Function: Create a plugin shell and copy necessary things into resource folder
+# ==============================================================================
+# Win: DLL, resources are linked into DLL
+# OSX: Make Bundle, resources are copied into Bundle's resource folder
+# Linux: so, resources reside in a folder next to the so with so's name and ".resource" extension
+#
+function(CreatePlugin productname outputDir copyWhat)
+ if(UNIX)
+ if(APPLE)
+ if(APPLE_IOS OR XMP_BUILD_STATIC)
+ CreateStaticLib(${productname} ${outputDir})
+ CopyResource(${productname} "${outputDir}/lib${productname}.resources" "${copyWhat}")
+ else()
+ # create a bundle, copy essential executable into bundle, but don't change output path
+ #MakeBundle(${productname} "bundle" ${outputDir} "Info.plist" "Info_plist.h")
+ MakeBundle(${productname} "xpi" ${outputDir} "" )
+ # copy resources
+ #CopyResource(${productname} "${outputDir}/${productname}.bundle/Contents/Resources" "${copyWhat}")
+
+ # redo on this level: force no extension to make below bundle creation work
+ set(CMAKE_SHARED_MODULE_PREFIX "" PARENT_SCOPE)
+ set(CMAKE_SHARED_MODULE_SUFFIX "" PARENT_SCOPE)
+ endif()
+ else(APPLE)
+ # Linux
+ if(XMP_BUILD_STATIC)
+ CreateStaticLib(${productname} ${outputDir})
+ CopyResource(${productname} "${outputDir}/lib${productname}.resources" "${copyWhat}")
+ else()
+ set(XMP_SHARED_MODULE_SUFFIX ".xpi")
+ set_target_properties(${productname} PROPERTIES SUFFIX ${XMP_SHARED_MODULE_SUFFIX})
+ set_target_properties(${productname} PROPERTIES PREFIX "")
+ set(LIBRARY_OUTPUT_PATH ${outputDir} PARENT_SCOPE)
+ # copy resources
+ #CopyResource(${productname} "${outputDir}/${productname}.resources" "${copyWhat}")
+
+ # ExpliXMPly set a softlink with the version e.g plugin.so.2.0.0-> plugin.so for each Plugin
+ #if ( NOT DEFINED XMP_VERSION)
+ set (XMP_VERSION 1.0.0) # if not set this should only be the case for the SDK templates we set it to 1.0.0
+ #endif()
+ #set_target_properties(${productname} PROPERTIES SOVERSION ${XMP_VERSION})
+ endif()
+ endif(APPLE)
+ else(UNIX)
+ if(WIN32)
+ # set pre/suf-fix
+ set(CMAKE_SHARED_MODULE_PREFIX "" PARENT_SCOPE)
+ set(XMP_SHARED_MODULE_SUFFIX ".xpi")
+ set_target_properties(${productname} PROPERTIES SUFFIX ${XMP_SHARED_MODULE_SUFFIX})
+ # we can't use LIBRARY_OUTPUT_PATH, so build in CMake dir and copy, otherwise an unwanted subfolder is created
+ add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND}
+ -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/${XMP_BUILDMODE_DIR} ${outputDir}/${TARGET_NAME}
+ COMMENT "Copy to output dir")
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPRODUCT_NAME=\"${PRODUCT_NAME}\"" PARENT_SCOPE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPRODUCT_NAME=\"${PRODUCT_NAME}\"" PARENT_SCOPE)
+
+ if(XMP_BUILD_STATIC)
+ CopyResource(${productname} "${outputDir}/${productname}.resources" "${copyWhat}")
+ endif(XMP_BUILD_STATIC)
+ endif(WIN32)
+ endif(UNIX)
+endfunction(CreatePlugin)
+
+# ==============================================================================
+# Function: Find plugins in XMPPlugin folder and return the list of names
+# ==============================================================================
+#
+function(FindEnabledPlugins resultName)
+ file (GLOB XMPPLUGIN_DIRS ${XMP_ROOT}/XMPPlugin/*)
+ foreach(item ${XMPPLUGIN_DIRS})
+ file (GLOB plugin_project FILES ${item}/build/CMakeLists.txt)
+ if(plugin_project)
+ get_filename_component(pluginProjectName ${item} NAME)
+ if (NOT ${pluginProjectName}_EXCLUDE)
+ set(names ${names} ${pluginProjectName})
+ endif()
+ endif()
+ endforeach()
+ set(${resultName} ${names} PARENT_SCOPE)
+endfunction(FindEnabledPlugins)
+
+# ==============================================================================
+# Function: Append static lib to target
+# ==============================================================================
+#
+function(AppendStaticLib outputDir targetName srcLibDir srcLibName)
+ if(UNIX)
+ if(APPLE_IOS)
+ add_custom_command (TARGET ${targetName} POST_BUILD
+ COMMAND mkdir -p ${srcLibDir}/${srcLibName}_TEMP
+ COMMAND cd ${srcLibDir}/${srcLibName}_TEMP && ${CMAKE_AR} x ${srcLibDir}/lib${srcLibName}.a
+ #COMMAND split lipo ${srcLibDir}/lib${srcLibName}.a -thin armv6 -output ${srcLibDir}/lib${srcLibName}arm6.a
+ #COMMAND split lipo ${srcLibDir}/lib${srcLibName}.a -thin armv7 -output ${srcLibDir}/lib${srcLibName}arm7.a
+ #COMMAND merge again lipo ${srcLibDir}/lib${srcLibName}arm6.a ${srcLibDir}/lib${srcLibName}arm7.a -create -output ${srcLibDir}/lib${srcLibName}.a
+ COMMAND ${CMAKE_AR} rs ${outputDir}/lib${targetName}.a ${srcLibDir}/${srcLibName}_TEMP/*.o
+ COMMAND rm -rf ${srcLibDir}/${srcLibName}_TEMP
+ COMMENT "extract objects from lib${srcLibName}.a and pack to lib${targetName}.a")
+ else()
+ add_custom_command (TARGET ${targetName} POST_BUILD
+ COMMAND mkdir -p ${srcLibDir}/${srcLibName}_TEMP
+ COMMAND cd ${srcLibDir}/${srcLibName}_TEMP
+ && ${CMAKE_AR} x ${srcLibDir}/lib${srcLibName}.a
+ COMMAND ${CMAKE_AR} rs ${outputDir}/lib${targetName}.a ${srcLibDir}/${srcLibName}_TEMP/*.o
+ COMMAND rm -rf ${srcLibDir}/${srcLibName}_TEMP
+ COMMENT "extract objects from lib${srcLibName}.a and pack to lib${targetName}.a")
+ endif()
+ else(UNIX)
+ if(WIN32)
+ add_custom_command (TARGET ${targetName} POST_BUILD
+ COMMAND cd ${outputDir}
+ && lib.exe /OUT:${targetName}.lib ${outputDir}/${targetName}.lib ${srcLibDir}/${srcLibName}.lib
+ COMMENT "extract objects from ${srcLibName}.lib and pack to ${targetName}.lib")
+ endif(WIN32)
+ endif(UNIX)
+endfunction(AppendStaticLib)
+
+# ==============================================================================
+# Function: INTERNAL used only!
+# Merge static plugin libraries into output library
+# ==============================================================================
+#
+function(MergeStaticLibs_Internal outputDir targetName useSubDir srcLibDir srcLibNames)
+ foreach(libName ${${srcLibNames}})
+ if(useSubDir)
+ set(correctedDir ${srcLibDir}/${libName})
+ else()
+ set(correctedDir ${srcLibDir})
+ endif()
+ AppendStaticLib(${outputDir} ${targetName} ${correctedDir} ${libName})
+ endforeach()
+endfunction(MergeStaticLibs_Internal)
+
+# ==============================================================================
+# Function: Merge static plugin libraries into output library
+# ==============================================================================
+#
+function(MergeStaticLibs outputDir targetName useSubDir srcLibDir srcLibNames)
+ MergeStaticLibs_Internal(${outputDir} ${targetName} ${useSubDir} ${srcLibDir} ${srcLibNames})
+ if(APPLE)
+ if(APPLE_IOS)
+ else(APPLE_IOS)
+ # APPLE need run ranlib to fix broken TOC
+ add_custom_command (TARGET ${targetName} POST_BUILD
+ COMMENT "Run ranlib to fix broken TOC of library file lib${targetName}.a"
+ COMMAND ${CMAKE_RANLIB} ${outputDir}/lib${targetName}.a
+ )
+ endif(APPLE_IOS)
+ endif(APPLE)
+endfunction(MergeStaticLibs)
+
+# ==============================================================================
+# Function: Get XMP Framework's output name
+# ==============================================================================
+#
+function(GetXMPFrameworkOutputName result)
+ if(UNIX)
+ if(APPLE)
+ if(XMP_BUILD_STATIC)
+ set(outputName "libXMP.a")
+ else()
+ set(outputName "XMP.framework")
+ endif()
+ else(APPLE)
+ if(XMP_BUILD_STATIC)
+ set(outputName "libXMP.a")
+ else()
+ set(outputName "libXMP.so")
+ endif()
+ endif(APPLE)
+ else(UNIX)
+ if(WIN32)
+ if(XMP_BUILD_STATIC)
+ set(outputName "XMP.lib")
+ else()
+ set(outputName "XMP.dll")
+ endif()
+ endif(WIN32)
+ endif(UNIX)
+ set(${result} ${outputName} PARENT_SCOPE)
+endfunction(GetXMPFrameworkOutputName)
+
+# ==============================================================================
+# Macro: Add Plugin API files to project
+# For convenience we define the sources as a variable. You can add
+# header files and cpp/c files and CMake will sort them out
+# ==============================================================================
+#
+macro(AddPluginApiFiles relativePathToXMPPluginFolder)
+ file (GLOB API_INCLUDE_FILES ${PROJECT_SOURCE_DIR}/${relativePathToXMPPluginFolder}/XMPFilesPlugins/api/source/*.h)
+ source_group(api\\include FILES ${API_INCLUDE_FILES})
+
+ file (GLOB API_SOURCE_FILES ${PROJECT_SOURCE_DIR}/${relativePathToXMPPluginFolder}/XMPFilesPlugins/api/source/*.cpp )
+ source_group(api\\source FILES ${API_SOURCE_FILES})
+endmacro(AddPluginApiFiles)
+
+# ==============================================================================
+# Macro: Add Resource files to project
+# For convenience we define the sources as a variable. You can add
+# header files and cpp/c files and CMake will sort them out
+# ==============================================================================
+#
+macro(AddPluginResourceFiles)
+ list(APPEND RESOURCE_FILES ${PROJECT_ROOT}/resource/txt/MODULE_IDENTIFIER.txt)
+ if (CMAKE_CL_64)
+ list(APPEND RESOURCE_FILES ${PROJECT_ROOT}/resource/txt/XMPPLUGINUIDS-64.txt)
+ else()
+ list(APPEND RESOURCE_FILES ${PROJECT_ROOT}/resource/txt/XMPPLUGINUIDS-32.txt)
+ endif()
+
+ # If we build for windows systems, we also include the resource file containing the manifest, icon and other resources
+ if(WIN32)
+ if (CMAKE_CL_64)
+ list (APPEND RESOURCE_FILES ${RESOURCE_ROOT}/${XMP_PLATFORM_SHORT}/${PRODUCT_NAME}-64.rc)
+ else(CMAKE_CL_64)
+ list (APPEND RESOURCE_FILES ${RESOURCE_ROOT}/${XMP_PLATFORM_SHORT}/${PRODUCT_NAME}-32.rc)
+ endif(CMAKE_CL_64)
+ endif()
+ source_group("Resource Files" FILES ${RESOURCE_FILES})
+endmacro(AddPluginResourceFiles)
+
+
+# ==============================================================================
+# Macro: Set Plugin Output folder
+# ==============================================================================
+#
+macro(SetPluginOutputPath)
+ if(UNIX)
+ if(APPLE)
+ set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${CMAKE_CFG_INTDIR})
+ else()
+ endif()
+ else()
+ set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${CMAKE_CFG_INTDIR}/${PRODUCT_NAME})
+ endif()
+endmacro(SetPluginOutputPath)
+
+# ==============================================================================
+# Function: Setup XMP for the application
+# Copy XMP library, create a symbolic link to Plug-ins, copy MediaAccess and fixup
+# ==============================================================================
+#
+function(SetupXMPForApp appname outputDir)
+ # are optional parameter set?
+ if(ARGV2 AND NOT APPLE_IOS)
+ if(${ARGV2} MATCHES "FFMPEG")
+ set(copyFFMpegLibs 1)
+ else()
+ set(copyFFMpegLibs 0)
+ endif()
+ else()
+ set(copyFFMpegLibs 0)
+ endif()
+
+ if(NOT copyFFMpegLibs)
+ set(ignoreCommand "#")
+ else ()
+ set(ignoreCommand "COMMAND")
+ endif()
+
+ if(APPLE_IOS)
+ set(ignoreCommandOnIOS "#")
+ set(ignoreCommandOnOSX "COMMAND")
+ else ()
+ set(ignoreCommandOnIOS "COMMAND")
+ set(ignoreCommandOnOSX "#")
+ endif()
+
+
+ if(UNIX)
+ if(APPLE)
+ set(BUILT_PRODUCTS_DIR ${outputDir}/${appname}.app/Contents)
+ # GetXMPFrameworkOutputName(XMP_FRAMEWORK_NAME)
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMENT "Copy necessary XMP items and create symlink to Plug-ins dir"
+ COMMAND echo clear XMP dir
+ ${ignoreCommandOnIOS} rm -fR ${BUILT_PRODUCTS_DIR}/Frameworks/XMP
+ COMMAND mkdir -p ${BUILT_PRODUCTS_DIR}/Frameworks/XMP
+ ${ignoreCommandOnIOS} echo Copy XMP
+ ${ignoreCommandOnIOS} rm -fR ${BUILT_PRODUCTS_DIR}/Frameworks/${XMP_FRAMEWORK_NAME}*
+ ${ignoreCommandOnIOS} ln -s ${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME} ${BUILT_PRODUCTS_DIR}/Frameworks/${XMP_FRAMEWORK_NAME}
+ ${ignoreCommandOnIOS} ln -s ${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME}.dSYM ${BUILT_PRODUCTS_DIR}/Frameworks/${XMP_FRAMEWORK_NAME}.dSYM
+ ${ignoreCommand} echo Copy MediaAccess
+ ${ignoreCommand} mkdir -p ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess
+ ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/ ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess
+ ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/ffmpeg/bin/${XMP_BITDEPTH}/lib* ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess
+ ${ignoreCommand} ${XMPROOT_DIR}/XMPMediaAccess/build/UpdateFFMPEGLibSearchPath.sh "@executable_path/../Frameworks/XMP/MediaAccess" "${BUILT_PRODUCTS_DIR}/Frameworks/XMP/MediaAccess"
+ ${ignoreCommandOnIOS} echo Copy XMP plugins shared libs
+ ${ignoreCommandOnIOS} cp -f -p -R ${XMPLIBRARIES_DIR}/Plug-ins/copy_to_app_dir/ ${BUILT_PRODUCTS_DIR}/Frameworks/
+ ${ignoreCommandOnIOS} echo create symlinks
+ ${ignoreCommandOnIOS} ln -s ${XMPLIBRARIES_DIR}/Plug-ins/ ${BUILT_PRODUCTS_DIR}/Frameworks/XMP/Plug-ins
+ ${ignoreCommandOnOSX} echo copy plugin data
+ ${ignoreCommandOnOSX} mkdir -p ${BUILT_PRODUCTS_DIR}/Resources/XMP/Plug-ins
+ ${ignoreCommandOnOSX} cp -fpR ${XMPLIBRARIES_DIR}/Plug-ins/ ${BUILT_PRODUCTS_DIR}/Resources/XMP/Plug-ins
+ )
+ else(APPLE)
+ # Do not copy FFMpeg libs if they don't exist
+ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/FFMpegWrapper.mediaaccess)
+ set(ignoreCommand "#")
+ else ()
+ set(ignoreCommand "COMMAND")
+ endif()
+
+ set(BUILT_PRODUCTS_DIR ${outputDir})
+ # GetXMPFrameworkOutputName(XMP_FRAMEWORK_NAME)
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMENT "Copy necessary XMP items and create symlink to Plug-ins dir"
+ COMMAND echo clear XMP dir
+ COMMAND rm -f -R ${BUILT_PRODUCTS_DIR}/XMP
+ COMMAND mkdir -p ${BUILT_PRODUCTS_DIR}/XMP
+ COMMAND echo Copy XMP
+ COMMAND rm -f -R ${BUILT_PRODUCTS_DIR}/libXMP*
+ COMMAND ln -s ${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME} ${BUILT_PRODUCTS_DIR}/${XMP_FRAMEWORK_NAME}
+ ${ignoreCommand} echo Copy MediaAccess
+ ${ignoreCommand} mkdir -p ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
+ ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/*.* ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
+ #COMMAND ${ignoreCommand} cp -fpR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/ffmpeg/bin/${XMP_BITDEPTH}/*.* ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
+ COMMAND echo Copy XMP plugins shared libs
+ #COMMAND cp -f -p -R ${XMPLIBRARIES_DIR}/Plug-ins/copy_to_app_dir/ ${BUILT_PRODUCTS_DIR}/
+ COMMAND echo create symlinks
+ COMMAND ln -s ${XMPLIBRARIES_DIR}/Plug-ins/ ${BUILT_PRODUCTS_DIR}/XMP/Plug-ins
+ )
+ endif(APPLE)
+ else(UNIX)
+ if(WIN32)
+ # Windows -------------------------------------------
+ set(BUILT_PRODUCTS_DIR ${outputDir})
+ # GetXMPFrameworkOutputName(XMP_FRAMEWORK_NAME)
+ file(TO_NATIVE_PATH "${BUILT_PRODUCTS_DIR}/XMP/Plug-ins" BUILT_PLUGINS_DIR_NAT)
+ file(TO_NATIVE_PATH "${XMPLIBRARIES_DIR}/Plug-ins" PLUGINS_DIR_NAT)
+ file(TO_NATIVE_PATH "${BUILT_PRODUCTS_DIR}/${XMP_FRAMEWORK_NAME}" DEST_XMP_NAT)
+ file(TO_NATIVE_PATH "${XMPLIBRARIES_DIR}/${XMP_FRAMEWORK_NAME}" SRC_XMP_NAT)
+ file(TO_NATIVE_PATH "${BUILT_PRODUCTS_DIR}/XMP.pdb" DEST_XMP_PDB_NAT)
+ file(TO_NATIVE_PATH "${XMPLIBRARIES_DIR}/XMP.pdb" SRC_XMP_PDB_NAT)
+
+ #For Windows XP we need to use junction.exe instead of mklink which is only available on Windows Vista and above
+ if((${CMAKE_SYSTEM} MATCHES "Windows-5.1") OR (${CMAKE_SYSTEM} MATCHES "Windows-5.2"))
+ message (STATUS "- Use junction.exe to create links instead of mklink we either run on Win XP 32 or 64 bit")
+ set(link_command ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/resources/tools/junction/junction.exe -accepteula )
+ set(remove_XMP "echo")
+ set(copy_link_XMP ${CMAKE_COMMAND} -E copy ${SRC_XMP_NAT} ${BUILT_PRODUCTS_DIR}/)
+ set(copy_link_XMP_pdb ${CMAKE_COMMAND} -E copy ${SRC_XMP_PDB_NAT} ${BUILT_PRODUCTS_DIR}/)
+ else()
+ set(link_command mklink /D )
+ set(remove_XMP ${CMAKE_COMMAND} -E remove -f ${DEST_XMP_NAT} ${DEST_XMP_PDB_NAT})
+ set(copy_link_XMP mklink ${DEST_XMP_NAT} ${SRC_XMP_NAT})
+ set(copy_link_XMP_pdb mklink ${DEST_XMP_PDB_NAT} ${SRC_XMP_PDB_NAT})
+ endif()
+
+ add_custom_command (TARGET ${appname} POST_BUILD
+ COMMENT "Copy necessary XMP items and create symlink to Plug-ins dir"
+ COMMAND echo - clear XMP dir
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILT_PRODUCTS_DIR}/XMP
+ COMMAND echo - symlink XMP.dll and XMP.pdb
+ COMMAND ${remove_XMP}
+ COMMAND ${copy_link_XMP}
+ COMMAND ${copy_link_XMP_pdb}
+ COMMAND echo - copy XMP plugins shared libs (tbb etc)
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${XMPLIBRARIES_DIR}/Plug-ins/copy_to_app_dir/ ${BUILT_PRODUCTS_DIR}
+ ${ignoreCommand} echo - copy FFMPEG libs
+ ${ignoreCommand} ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/ffmpeg/bin/${XMP_BITDEPTH}/ ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess
+ ${ignoreCommand} ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/FFMpegWrapper.mediaaccess ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess/FFMpegWrapper.mediaaccess
+ ${ignoreCommand} ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/toolkit/public/SDK/bin/MediaAccess/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}/ffmpegwrapper.pdb ${BUILT_PRODUCTS_DIR}/XMP/MediaAccess/ffmpegwrapper.pdb
+ COMMAND echo - remove symbolic link to plug-ins dir
+ COMMAND rmdir ${BUILT_PLUGINS_DIR_NAT}
+ COMMAND echo - execute symbolic link command
+ COMMAND ${link_command} ${BUILT_PLUGINS_DIR_NAT} ${PLUGINS_DIR_NAT}
+ )
+ endif(WIN32)
+ endif(UNIX)
+endfunction(SetupXMPForApp)
+
+# ==============================================================================
+# Function: GenerateInitFileForStaticBuild
+# Collect registrar initializer functions and create source in temp directory
+# out of it for static linkage
+# ==============================================================================
+#
+function(GenerateInitFileForStaticBuild)
+ if(XMP_BUILD_STATIC)
+ set(targetFile ${XMP_ROOT}/XMPApi/source/PluginStaticInit_TEMP.cpp)
+ file(REMOVE ${targetFile})
+
+ set(initDecl "#if XMP_BUILD_STATIC\n\n")
+ set(initFunc "namespace XMP\n{\n void InstanciateRegistrarsForAllPlugins()\n {\n")
+ foreach(pluginName ${XMP_ENABLED_PLUGINS})
+ set(initDecl "${initDecl}extern void ${pluginName}_InstanciateRegistrars()\;\n")
+ set(initFunc "${initFunc} ::${pluginName}_InstanciateRegistrars()\;\n")
+ endforeach()
+ set(initFunc "${initFunc} }\n}\n")
+ set(initFunc "${initDecl}\n${initFunc}\n#endif\n")
+
+ file(WRITE ${targetFile} ${initFunc})
+ endif(XMP_BUILD_STATIC)
+endfunction(GenerateInitFileForStaticBuild)
diff --git a/build/XMP_Ios.cmake b/build/XMP_Ios.cmake
deleted file mode 100644
index 3dd2e08..0000000
--- a/build/XMP_Ios.cmake
+++ /dev/null
@@ -1,109 +0,0 @@
-# =================================================================================================
-# ADOBE SYSTEMS INCORPORATED
-# Copyright 2013 Adobe Systems Incorporated
-# All Rights Reserved
-#
-# NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
-# of the Adobe license agreement accompanying it.
-# =================================================================================================
-
-# ==============================================================================
-# define minimum cmake version
-cmake_minimum_required(VERSION 2.8.6)
-
-# ==============================================================================
-# Shared config for ios
-# ==============================================================================
-
-
-set(XMP_PLATFORM_SHORT "ios")
-
-set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
-
-add_definitions(-DIOS_ENV=1)
-
-set(XMP_ENABLE_SECURE_SETTINGS "ON")
-
-# shared flags
-set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} ${XMP_EXTRA_COMPILE_FLAGS}")
-set(XMP_SHARED_COMPILE_DEBUG_FLAGS "-O0 -DDEBUG=1 -D_DEBUG=1")
-set(XMP_SHARED_COMPILE_RELEASE_FLAGS "-Os -DNDEBUG=1 -D_NDEBUG=1")
-
-set(XMP_PLATFORM_BEGIN_WHOLE_ARCHIVE "")
-set(XMP_PLATFORM_END_WHOLE_ARCHIVE "")
-
-# ==============================================================================
-# Function: architecture related settings
-# ==============================================================================
-function(SetupTargetArchitecture)
- if(APPLE_IOS)
- set(XMP_CPU_FOLDERNAME "$(ARCHS_STANDARD_32_BIT)" PARENT_SCOPE)
- else()
- if(CMAKE_CL_64)
- set(XMP_BITDEPTH "64" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel_64" PARENT_SCOPE)
- else()
- set(XMP_BITDEPTH "32" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel" PARENT_SCOPE)
- endif()
- endif()
-endfunction(SetupTargetArchitecture)
-
-SetupTargetArchitecture()
-# XMP_PLATFORM_FOLDER is used in OUTPUT_DIR and Debug/Release get automatically added for VS/XCode projects
-set(XMP_PLATFORM_FOLDER "ios/${XMP_CPU_FOLDERNAME}")
-
-# ==============================================================================
-# Function: Set internal build target directory. See XMP_PLATFORM_FOLDER for
-# further construction and when CMAKE_CFG_INTDIR/CMAKE_BUILD_TYPE are set
-# (generator dependent).
-# ==============================================================================
-function(SetupInternalBuildDirectory)
- if(CMAKE_CFG_INTDIR STREQUAL ".")
- # CMAKE_BUILD_TYPE only available for makefile builds
- set(XMP_IS_MAKEFILE_BUILD "ON" PARENT_SCOPE)
- if((${CMAKE_BUILD_TYPE} MATCHES "Debug") OR (${CMAKE_BUILD_TYPE} MATCHES "debug") )
- set(XMP_BUILDMODE_DIR "debug" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR "release" PARENT_SCOPE)
- endif()
- else()
- # Visual/XCode have dedicated Debug/Release target modes. CMAKE_CFG_INTDIR is set.
- if(APPLE_IOS)
-# TODO: fixme
-# set(XMP_BUILDMODE_DIR "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" PARENT_SCOPE)
- set(XMP_BUILDMODE_DIR "$(CONFIGURATION)" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR ${CMAKE_CFG_INTDIR} PARENT_SCOPE)
- endif()
- set(XMP_IS_MAKEFILE_BUILD "OFF" PARENT_SCOPE)
- endif()
-endfunction(SetupInternalBuildDirectory)
-
-# ==============================================================================
-# Function: Setup general and specific folder structures
-# ==============================================================================
-function(SetupGeneralDirectories)
- set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(PROJECT_ROOT ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(SOURCE_ROOT ${PROJECT_SOURCE_DIR}/../source PARENT_SCOPE)
- set(RESOURCE_ROOT ${PROJECT_SOURCE_DIR}/../resource PARENT_SCOPE)
-
- # ==============================================================================
- # XMP specific defines
- # ==============================================================================
-
- # Construct output directory
- # The CMAKE_CFG_INTDIR gets automatically set for generators which differenciate different build targets (eg. VS, XCode), but is emtpy for Linux !
- # In this case Debug/Release is added to the OUTPUT_DIR when used for LIBRARY_OUTPUT_PATH.
- string(TOLOWER ${XMP_BUILDMODE_DIR} LOWERCASE_XMP_BUILDMODE_DIR)
- set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # XMP lib locations constructed with ${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}, since the target folder (Debug/Release) isn't added automatically
- set(XMPROOT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH} PARENT_SCOPE)
- set(XMPLIBRARIES_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
- set(XMPPLUGIN_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPPlugin PARENT_SCOPE)
- set(XMPPLUGIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # each plugin project should implement function named SetupProjectSpecifiedDirectories to specify the directories used by project itself
-endfunction(SetupGeneralDirectories) \ No newline at end of file
diff --git a/build/XMP_Linux.cmake b/build/XMP_Linux.cmake
deleted file mode 100644
index 8e668b7..0000000
--- a/build/XMP_Linux.cmake
+++ /dev/null
@@ -1,143 +0,0 @@
-# =================================================================================================
-# ADOBE SYSTEMS INCORPORATED
-# Copyright 2013 Adobe Systems Incorporated
-# All Rights Reserved
-#
-# NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
-# of the Adobe license agreement accompanying it.
-# =================================================================================================
-
-# ==============================================================================
-# define minimum cmake version
-cmake_minimum_required(VERSION 2.8.6)
-
-# ==============================================================================
-# Shared config for linux
-# ==============================================================================
-
-# ==============================================================================
-# Linux: Setup cross-compiling 32/64bit
-# ==============================================================================
-if(NOT CMAKE_CROSSCOMPILING)
- if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
- # running on 64bit machine
- set(XMP_EXTRA_BUILDMACHINE "Buildmachine is 64bit")
- else()
- # running on 32bit machine
- set(XMP_EXTRA_BUILDMACHINE "Buildmachine is 32bit")
- endif()
-
- if(CMAKE_CL_64)
- set(XMP_EXTRA_COMPILE_FLAGS "-m64")
- set(XMP_EXTRA_LINK_FLAGS "-m64")
- set(XMP_PLATFORM_FOLDER "i80386linux_x64") # add XMP_BUILDMODE_DIR to follow what other platforms do
- set(XMP_GCC_LIBPATH /usr/lib64/gcc/x86_64-redhat-linux/4.4.4/)
- else()
- set(XMP_EXTRA_LINK_FLAGS "-m32 -mtune=i686")
- set(XMP_PLATFORM_FOLDER "i80386linux") # add XMP_BUILDMODE_DIR to follow what other platforms do
- set(XMP_GCC_LIBPATH /usr/lib/gcc/i686-redhat-linux/4.4.4/)
- endif()
-else()
- # running toolchain
- if(CMAKE_CL_64)
- set(XMP_EXTRA_COMPILE_FLAGS "-m64")
- set(XMP_EXTRA_LINK_FLAGS "-m64")
- set(XMP_PLATFORM_FOLDER "i80386linux_x64") # add XMP_BUILDMODE_DIR to follow what other platforms do
- set(XMP_GCC_LIBPATH /usr/lib64/gcc/x86_64-redhat-linux/4.4.4/)
- else()
- set(XMP_EXTRA_COMPILE_FLAGS "-m32 -mtune=i686")
- set(XMP_EXTRA_LINK_FLAGS "-m32")
- set(XMP_PLATFORM_FOLDER "i80386linux") # add XMP_BUILDMODE_DIR to follow what other platforms do
- set(XMP_GCC_LIBPATH /usr/lib/gcc/i686-redhat-linux/4.4.4/)
- endif()
-
- set(XMP_EXTRA_BUILDMACHINE "Cross compiling")
-endif()
-set(XMP_PLATFORM_VERSION "linux2.6") # add XMP_BUILDMODE_DIR to follow what other platforms do
-
-add_definitions(-DUNIX_ENV=1)
-# Linux -------------------------------------------
-set(XMP_PLATFORM_SHORT "linux")
-#gcc path is not set correctly
-
-set(XMP_PLATFORM_LINK "-z defs -Xlinker -Bsymbolic -Wl,--no-undefined ${XMP_EXTRA_LINK_FLAGS} ${XMP_TOOLCHAIN_LINK_FLAGS} -lrt -ldl -luuid -lpthread")
-
-if(XMP_ENABLE_SECURE_SETTINGS)
- set(XMP_PLATFORM_LINK "${XMP_PLATFORM_LINK} ${XMP_GCC_LIBPATH}/libssp.a")
-endif()
-set(XMP_SHARED_COMPILE_FLAGS "-Wno-multichar -Wno-implicit -D_FILE_OFFSET_BITS=64 -funsigned-char ${XMP_EXTRA_COMPILE_FLAGS} ${XMP_TOOLCHAIN_COMPILE_FLAGS}")
-set(XMP_SHARED_COMPILE_DEBUG_FLAGS " ")
-set(XMP_SHARED_COMPILE_RELEASE_FLAGS "-fwrapv ")
-
-
-# ==============================================================================
-# Function: architecture related settings
-# ==============================================================================
-function(SetupTargetArchitecture)
- if(APPLE_IOS)
- set(XMP_CPU_FOLDERNAME "$(ARCHS_STANDARD_32_BIT)" PARENT_SCOPE)
- else()
- if(CMAKE_CL_64)
- set(XMP_BITDEPTH "64" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel_64" PARENT_SCOPE)
- else()
- set(XMP_BITDEPTH "32" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel" PARENT_SCOPE)
- endif()
- endif()
-endfunction(SetupTargetArchitecture)
-
-# ==============================================================================
-# Function: Set internal build target directory. See XMP_PLATFORM_FOLDER for
-# further construction and when CMAKE_CFG_INTDIR/CMAKE_BUILD_TYPE are set
-# (generator dependent).
-# ==============================================================================
-function(SetupInternalBuildDirectory)
- if(CMAKE_CFG_INTDIR STREQUAL ".")
- # CMAKE_BUILD_TYPE only available for makefile builds
- set(XMP_IS_MAKEFILE_BUILD "ON" PARENT_SCOPE)
- if((${CMAKE_BUILD_TYPE} MATCHES "Debug") OR (${CMAKE_BUILD_TYPE} MATCHES "debug") )
- set(XMP_BUILDMODE_DIR "debug" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR "release" PARENT_SCOPE)
- endif()
- else()
- # Visual/XCode have dedicated Debug/Release target modes. CMAKE_CFG_INTDIR is set.
- if(APPLE_IOS)
- # TODO: fixme
- # set(XMP_BUILDMODE_DIR "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" PARENT_SCOPE)
- set(XMP_BUILDMODE_DIR "$(CONFIGURATION)" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR ${CMAKE_CFG_INTDIR} PARENT_SCOPE)
- endif()
- set(XMP_IS_MAKEFILE_BUILD "OFF" PARENT_SCOPE)
- endif()
- endfunction(SetupInternalBuildDirectory)
-
- # ==============================================================================
- # Function: Setup general and specific folder structures
- # ==============================================================================
- function(SetupGeneralDirectories)
- set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(PROJECT_ROOT ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(SOURCE_ROOT ${PROJECT_SOURCE_DIR}/../source PARENT_SCOPE)
- set(RESOURCE_ROOT ${PROJECT_SOURCE_DIR}/../resource PARENT_SCOPE)
-
- # ==============================================================================
- # XMP specific defines
- # ==============================================================================
-
- # Construct output directory
- # The CMAKE_CFG_INTDIR gets automatically set for generators which differenciate different build targets (eg. VS, XCode), but is emtpy for Linux !
- # In this case Debug/Release is added to the OUTPUT_DIR when used for LIBRARY_OUTPUT_PATH.
- string(TOLOWER ${XMP_BUILDMODE_DIR} LOWERCASE_XMP_BUILDMODE_DIR)
- set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # XMP lib locations constructed with ${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}, since the target folder (Debug/Release) isn't added automatically
- set(XMPROOT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH} PARENT_SCOPE)
- set(XMPLIBRARIES_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
- set(XMPPLUGIN_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPPlugin PARENT_SCOPE)
- set(XMPPLUGIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # each plugin project should implement function named SetupProjectSpecifiedDirectories to specify the directories used by project itself
-endfunction(SetupGeneralDirectories)
diff --git a/build/XMP_Mac.cmake b/build/XMP_Mac.cmake
deleted file mode 100644
index 7087d07..0000000
--- a/build/XMP_Mac.cmake
+++ /dev/null
@@ -1,129 +0,0 @@
-# =================================================================================================
-# ADOBE SYSTEMS INCORPORATED
-# Copyright 2013 Adobe Systems Incorporated
-# All Rights Reserved
-#
-# NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
-# of the Adobe license agreement accompanying it.
-# =================================================================================================
-
-# ==============================================================================
-# define minimum cmake version
-cmake_minimum_required(VERSION 2.8.6)
-
-# ==============================================================================
-# Shared config for mac
-# ==============================================================================
-
-
-set(XMP_PLATFORM_SHORT "mac")
-if(CMAKE_CL_64)
- set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
- add_definitions(-DXMP_64=1)
-else(CMAKE_CL_64)
- set(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX" FORCE)
- add_definitions(-DXMP_64=0)
-endif(CMAKE_CL_64)
-
-# is SDK and deployment target set?
-if(NOT DEFINED XMP_OSX_SDK)
- # no, so default to CS6 settings
- #set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.2")
- set(XMP_OSX_SDK 10.7)
- set(XMP_OSX_TARGET 10.6)
-endif()
-
-add_definitions(-DMAC_ENV=1)
-
-
-#
-# shared flags
-#
-set(XMP_SHARED_COMPILE_FLAGS "-Wall -Wextra")
-set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} -Wno-missing-field-initializers -Wno-shadow") # disable some warnings
-
-set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS}")
-
-set(XMP_SHARED_CXX_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} -Wno-reorder") # disable warnings
-
-set(XMP_PLATFORM_BEGIN_WHOLE_ARCHIVE "")
-set(XMP_PLATFORM_END_WHOLE_ARCHIVE "")
-set(XMP_DYLIBEXTENSION "dylib")
-
-
-
-# ==============================================================================
-# Function: architecture related settings
-# ==============================================================================
-function(SetupTargetArchitecture)
- if(APPLE_IOS)
- set(XMP_CPU_FOLDERNAME "$(ARCHS_STANDARD_32_BIT)" PARENT_SCOPE)
- else()
- if(CMAKE_CL_64)
- set(XMP_BITDEPTH "64" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel_64" PARENT_SCOPE)
- else()
- set(XMP_BITDEPTH "32" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel" PARENT_SCOPE)
- endif()
- endif()
-endfunction(SetupTargetArchitecture)
-
-SetupTargetArchitecture()
-# XMP_PLATFORM_FOLDER is used in OUTPUT_DIR and Debug/Release get automatically added for VS/XCode projects
-set(XMP_PLATFORM_FOLDER "macintosh/${XMP_CPU_FOLDERNAME}")
-
-# ==============================================================================
-# Function: Set internal build target directory. See XMP_PLATFORM_FOLDER for
-# further construction and when CMAKE_CFG_INTDIR/CMAKE_BUILD_TYPE are set
-# (generator dependent).
-# ==============================================================================
-function(SetupInternalBuildDirectory)
- if(CMAKE_CFG_INTDIR STREQUAL ".")
- # CMAKE_BUILD_TYPE only available for makefile builds
- set(XMP_IS_MAKEFILE_BUILD "ON" PARENT_SCOPE)
- if((${CMAKE_BUILD_TYPE} MATCHES "Debug") OR (${CMAKE_BUILD_TYPE} MATCHES "debug") )
- set(XMP_BUILDMODE_DIR "debug" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR "release" PARENT_SCOPE)
- endif()
- else()
- # Visual/XCode have dedicated Debug/Release target modes. CMAKE_CFG_INTDIR is set.
- if(APPLE_IOS)
-# TODO: fixme
-# set(XMP_BUILDMODE_DIR "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" PARENT_SCOPE)
- set(XMP_BUILDMODE_DIR "$(CONFIGURATION)" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR ${CMAKE_CFG_INTDIR} PARENT_SCOPE)
- endif()
- set(XMP_IS_MAKEFILE_BUILD "OFF" PARENT_SCOPE)
- endif()
-endfunction(SetupInternalBuildDirectory)
-
-# ==============================================================================
-# Function: Setup general and specific folder structures
-# ==============================================================================
-function(SetupGeneralDirectories)
- set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(PROJECT_ROOT ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(SOURCE_ROOT ${PROJECT_SOURCE_DIR}/../source PARENT_SCOPE)
- set(RESOURCE_ROOT ${PROJECT_SOURCE_DIR}/../resource PARENT_SCOPE)
-
- # ==============================================================================
- # XMP specific defines
- # ==============================================================================
-
- # Construct output directory
- # The CMAKE_CFG_INTDIR gets automatically set for generators which differenciate different build targets (eg. VS, XCode), but is emtpy for Linux !
- # In this case Debug/Release is added to the OUTPUT_DIR when used for LIBRARY_OUTPUT_PATH.
- string(TOLOWER ${XMP_BUILDMODE_DIR} LOWERCASE_XMP_BUILDMODE_DIR)
- set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # XMP lib locations constructed with ${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}, since the target folder (Debug/Release) isn't added automatically
- set(XMPROOT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH} PARENT_SCOPE)
- set(XMPLIBRARIES_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
- set(XMPPLUGIN_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPPlugin PARENT_SCOPE)
- set(XMPPLUGIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # each plugin project should implement function named SetupProjectSpecifiedDirectories to specify the directories used by project itself
-endfunction(SetupGeneralDirectories) \ No newline at end of file
diff --git a/build/XMP_Win.cmake b/build/XMP_Win.cmake
deleted file mode 100644
index 1e31dc5..0000000
--- a/build/XMP_Win.cmake
+++ /dev/null
@@ -1,127 +0,0 @@
-# =================================================================================================
-# ADOBE SYSTEMS INCORPORATED
-# Copyright 2013 Adobe Systems Incorporated
-# All Rights Reserved
-#
-# NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
-# of the Adobe license agreement accompanying it.
-# =================================================================================================
-
-# ==============================================================================
-# define minimum cmake version
-cmake_minimum_required(VERSION 2.8.6)
-
-# ==============================================================================
-# Shared config for windows
-# ==============================================================================
-
-if(CMAKE_CL_64)
- set(XMP_SHARED_COMPILE_FLAGS " -DWIN64 -D_WIN64=1 ")
- set(XMP_PLATFORM_FOLDER "windows_x64") # leave XMP_BUILDMODE_DIR away, since CMAKE_CFG_INTDIR gets added by CMake automatically
- set(XMP_WIN32_CXX_EXTRAFLAGS "/bigobj")
- set(XMP_WIN32_LINK_EXTRAFLAGS "")
-else(CMAKE_CL_64)
- set(XMP_SHARED_COMPILE_FLAGS "-DWIN32")
- set(XMP_PLATFORM_FOLDER "windows") # leave XMP_BUILDMODE_DIR away, since CMAKE_CFG_INTDIR gets added by CMake automatically
- set(XMP_WIN32_CXX_EXTRAFLAGS "/arch:SSE2")
- set(XMP_WIN32_LINK_EXTRAFLAGS "/SAFESEH /NXCOMPAT /LARGEADDRESSAWARE")
-endif(CMAKE_CL_64)
-set(XMP_PLATFORM_SHORT "win")
-set(XMP_PLATFORM_LINK "")
-set(XMP_SHARED_COMPILE_FLAGS "${XMP_SHARED_COMPILE_FLAGS} -DWIN_ENV=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_SCL_SECURE_NO_WARNINGS=1 -DNOMINMAX -DUNICODE -D_UNICODE ${XMP_WIN32_CXX_EXTRAFLAGS} /J /MP /W3 /GF /GS /EHsc /fp:precise /nologo /Zi /TP /errorReport:prompt")
-set(XMP_SHARED_COMPILE_DEBUG_FLAGS "-DDEBUG /Od /RTC1")
-set(XMP_SHARED_COMPILE_RELEASE_FLAGS "-DNDEBUG /O1 /Ob2 /Os /Oy- /GL /FD /Gy")
-
-set(XMP_SHARED_COMPILE_DEBUG_FLAGS "${XMP_SHARED_COMPILE_DEBUG_FLAGS} /MDd")
-set(XMP_SHARED_COMPILE_RELEASE_FLAGS "${XMP_SHARED_COMPILE_RELEASE_FLAGS} /MD")
-if(MSVC90)
- set(XMP_SHARED_COMPILE_DEBUG_FLAGS "${XMP_SHARED_COMPILE_DEBUG_FLAGS} -D_SECURE_SCL=1 -D_HAS_ITERATOR_DEBUGGING=1")
- set(XMP_SHARED_COMPILE_RELEASE_FLAGS "${XMP_SHARED_COMPILE_RELEASE_FLAGS} -D_SECURE_SCL=0 -D_HAS_ITERATOR_DEBUGGING=0")
-else()
- set(XMP_SHARED_COMPILE_DEBUG_FLAGS "${XMP_SHARED_COMPILE_DEBUG_FLAGS} -D_ITERATOR_DEBUG_LEVEL=2")
- set(XMP_SHARED_COMPILE_RELEASE_FLAGS "${XMP_SHARED_COMPILE_RELEASE_FLAGS} -D_ITERATOR_DEBUG_LEVEL=0")
-endif()
-
-
-set(XMP_PLATFORM_LINK_WIN "${XMP_WIN32_LINK_EXTRAFLAGS} /INCREMENTAL:NO /DYNAMICBASE /MAP")
-
-if(NOT DEFINED XMP_TOOLSET)
- if(MSVC90)
- set(XMP_TOOLSET "${XMP_TOOLSET} -DXMP_TOOLSET_VC90")
- elseif(MSVC10)
- set(XMP_TOOLSET "${XMP_TOOLSET} -DXMP_TOOLSET_VC10")
- endif()
-endif()
-
-
-# ==============================================================================
-# Function: architecture related settings
-# ==============================================================================
-function(SetupTargetArchitecture)
- if(APPLE_IOS)
- set(XMP_CPU_FOLDERNAME "$(ARCHS_STANDARD_32_BIT)" PARENT_SCOPE)
- else()
- if(CMAKE_CL_64)
- set(XMP_BITDEPTH "64" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel_64" PARENT_SCOPE)
- else()
- set(XMP_BITDEPTH "32" PARENT_SCOPE)
- set(XMP_CPU_FOLDERNAME "intel" PARENT_SCOPE)
- endif()
- endif()
-endfunction(SetupTargetArchitecture)
-
-# ==============================================================================
-# Function: Set internal build target directory. See XMP_PLATFORM_FOLDER for
-# further construction and when CMAKE_CFG_INTDIR/CMAKE_BUILD_TYPE are set
-# (generator dependent).
-# ==============================================================================
-function(SetupInternalBuildDirectory)
- if(CMAKE_CFG_INTDIR STREQUAL ".")
- # CMAKE_BUILD_TYPE only available for makefile builds
- set(XMP_IS_MAKEFILE_BUILD "ON" PARENT_SCOPE)
- if((${CMAKE_BUILD_TYPE} MATCHES "Debug") OR (${CMAKE_BUILD_TYPE} MATCHES "debug") )
- set(XMP_BUILDMODE_DIR "debug" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR "release" PARENT_SCOPE)
- endif()
- else()
- # Visual/XCode have dedicated Debug/Release target modes. CMAKE_CFG_INTDIR is set.
- if(APPLE_IOS)
-# TODO: fixme
-# set(XMP_BUILDMODE_DIR "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" PARENT_SCOPE)
- set(XMP_BUILDMODE_DIR "$(CONFIGURATION)" PARENT_SCOPE)
- else()
- set(XMP_BUILDMODE_DIR ${CMAKE_CFG_INTDIR} PARENT_SCOPE)
- endif()
- set(XMP_IS_MAKEFILE_BUILD "OFF" PARENT_SCOPE)
- endif()
-endfunction(SetupInternalBuildDirectory)
-
-# ==============================================================================
-# Function: Setup general and specific folder structures
-# ==============================================================================
-function(SetupGeneralDirectories)
- set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(PROJECT_ROOT ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
- set(SOURCE_ROOT ${PROJECT_SOURCE_DIR}/../source PARENT_SCOPE)
- set(RESOURCE_ROOT ${PROJECT_SOURCE_DIR}/../resource PARENT_SCOPE)
-
- # ==============================================================================
- # XMP specific defines
- # ==============================================================================
-
- # Construct output directory
- # The CMAKE_CFG_INTDIR gets automatically set for generators which differenciate different build targets (eg. VS, XCode), but is emtpy for Linux !
- # In this case Debug/Release is added to the OUTPUT_DIR when used for LIBRARY_OUTPUT_PATH.
- string(TOLOWER ${XMP_BUILDMODE_DIR} LOWERCASE_XMP_BUILDMODE_DIR)
- set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # XMP lib locations constructed with ${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR}, since the target folder (Debug/Release) isn't added automatically
- set(XMPROOT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH} PARENT_SCOPE)
- set(XMPLIBRARIES_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/public/libraries/${XMP_PLATFORM_FOLDER}/${LOWERCASE_XMP_BUILDMODE_DIR} PARENT_SCOPE)
- set(XMPPLUGIN_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPPlugin PARENT_SCOPE)
- set(XMPPLUGIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${XMP_THIS_PROJECT_RELATIVEPATH}/XMPFilesPlugins/public/${XMP_PLATFORM_FOLDER}/${XMP_BUILDMODE_DIR} PARENT_SCOPE)
-
- # each plugin project should implement function named SetupProjectSpecifiedDirectories to specify the directories used by project itself
-endfunction(SetupGeneralDirectories)
diff --git a/build/cmake.bat b/build/cmake.bat
index de802bd..de802bd 100644..100755
--- a/build/cmake.bat
+++ b/build/cmake.bat
diff --git a/build/cmake.command b/build/cmake.command
index 4c540e6..4c540e6 100644..100755
--- a/build/cmake.command
+++ b/build/cmake.command
diff --git a/build/cmake_all.bat b/build/cmake_all.bat
index a79b43c..a79b43c 100644..100755
--- a/build/cmake_all.bat
+++ b/build/cmake_all.bat
diff --git a/build/shared/CMakeUtils.bat b/build/shared/CMakeUtils.bat
index 7203697..d2719b5 100755
--- a/build/shared/CMakeUtils.bat
+++ b/build/shared/CMakeUtils.bat
@@ -8,7 +8,7 @@
REM Available Arguments:
REM [64|32] Bit Architecture (optional, 64 is default)
-REM [2008|2010|2012] VS Version(optional, 2010 is default)
+REM [2008|2011|2011] VS Version(optional, 2011 is default)
REM [Dynamic | Static] optional, Dynamic by default
REM [WarningAsError] optional
REM [Clean] optional
@@ -22,7 +22,7 @@ set CleanCMake=OFF
set XMPROOT=%buildSharedLoc%/../..
:: Default Generator
-set GeneratorVersion=Visual Studio 10
+set GeneratorVersion=Visual Studio 11
set GeneratorArchitecture=Win64
set CMake_Arch64Bit=ON
set CMake_ARCH=x64
@@ -59,9 +59,9 @@ set CMake_LibTypeFolderName=dynamic
)
:: Visual Studio Version
- if /I "%1"=="2010" (
- echo "Generator VS 2010 specified"
- set GeneratorVersion=Visual Studio 10
+ if /I "%1"=="2011" (
+ echo "Generator VS 2011 specified"
+ set GeneratorVersion=Visual Studio 11
set CMakeGenVersion_FolderSuffix=
)
@@ -94,7 +94,7 @@ set CMake64_Folder_Suffix=
)
:: CMake Folder specified:
-set CMakeFolder="vc10/%CMake_LibTypeFolderName%/windows%CMake64_Folder_Suffix%"
+set CMakeFolder="vc11/%CMake_LibTypeFolderName%/windows%CMake64_Folder_Suffix%"
echo CMakeFolder: %CMakeFolder%
:: Create generator type from VS version and architecture
diff --git a/build/shared/SharedConfig_Common.cmake b/build/shared/SharedConfig_Common.cmake
index 32341c5..20ddbf1 100644
--- a/build/shared/SharedConfig_Common.cmake
+++ b/build/shared/SharedConfig_Common.cmake
@@ -11,6 +11,49 @@
# define minimum cmake version
cmake_minimum_required(VERSION 2.8.6)
+# ==============================================================================
+# Function: architecture related settings
+# ==============================================================================
+function(SetupTargetArchitecture)
+ if(APPLE_IOS)
+ set(${COMPONENT}_CPU_FOLDERNAME "$(ARCHS_STANDARD_32_BIT)" PARENT_SCOPE)
+ else()
+ if(CMAKE_CL_64)
+ set(${COMPONENT}_BITDEPTH "64" PARENT_SCOPE)
+ set(${COMPONENT}_CPU_FOLDERNAME "intel_64" PARENT_SCOPE)
+ else()
+ set(${COMPONENT}_BITDEPTH "32" PARENT_SCOPE)
+ set(${COMPONENT}_CPU_FOLDERNAME "intel" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction(SetupTargetArchitecture)
+
+# ==============================================================================
+# Function: Set internal build target directory. See ${COMPONENT}_PLATFORM_FOLDER for
+# further construction and when CMAKE_CFG_INTDIR/CMAKE_BUILD_TYPE are set
+# (generator dependent).
+# ==============================================================================
+function(SetupInternalBuildDirectory)
+ if(CMAKE_CFG_INTDIR STREQUAL ".")
+ # CMAKE_BUILD_TYPE only available for makefile builds
+ set(${COMPONENT}_IS_MAKEFILE_BUILD "ON" PARENT_SCOPE)
+ if((${CMAKE_BUILD_TYPE} MATCHES "Debug") OR (${CMAKE_BUILD_TYPE} MATCHES "debug") )
+ set(${COMPONENT}_BUILDMODE_DIR "debug" PARENT_SCOPE)
+ else()
+ set(${COMPONENT}_BUILDMODE_DIR "release" PARENT_SCOPE)
+ endif()
+ else()
+ # Visual/XCode have dedicated Debug/Release target modes. CMAKE_CFG_INTDIR is set.
+ if(APPLE_IOS)
+# TODO: fixme
+# set(${COMPONENT}_BUILDMODE_DIR "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" PARENT_SCOPE)
+ set(${COMPONENT}_BUILDMODE_DIR "$(CONFIGURATION)" PARENT_SCOPE)
+ else()
+ set(${COMPONENT}_BUILDMODE_DIR ${CMAKE_CFG_INTDIR} PARENT_SCOPE)
+ endif()
+ set(${COMPONENT}_IS_MAKEFILE_BUILD "OFF" PARENT_SCOPE)
+ endif()
+endfunction(SetupInternalBuildDirectory)
# ==============================================================================
@@ -46,6 +89,34 @@ function(SetupCompilerFlags)
endfunction(SetupCompilerFlags)
+# ==============================================================================
+# Function: Setup general and specific folder structures
+# ==============================================================================
+function(SetupGeneralDirectories)
+ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
+ set(PROJECT_ROOT ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
+ set(SOURCE_ROOT ${PROJECT_SOURCE_DIR}/../source PARENT_SCOPE)
+ set(RESOURCE_ROOT ${PROJECT_SOURCE_DIR}/../resource PARENT_SCOPE)
+
+ # ==============================================================================
+ # ${COMPONENT} specific defines
+ # ==============================================================================
+
+ # Construct output directory
+ # The CMAKE_CFG_INTDIR gets automatically set for generators which differenciate different build targets (eg. VS, XCode), but is emtpy for Linux !
+ # In this case Debug/Release is added to the OUTPUT_DIR when used for LIBRARY_OUTPUT_PATH.
+
+ string(TOLOWER ${${COMPONENT}_BUILDMODE_DIR} LOWERCASE_${COMPONENT}_BUILDMODE_DIR)
+ set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${${COMPONENT}_THIS_PROJECT_RELATIVEPATH}/public/libraries/${${COMPONENT}_PLATFORM_FOLDER}/${LOWERCASE_${COMPONENT}_BUILDMODE_DIR} PARENT_SCOPE)
+
+ # ${COMPONENT} lib locations constructed with ${${COMPONENT}_PLATFORM_FOLDER}/${${COMPONENT}_BUILDMODE_DIR}, since the target folder (Debug/Release) isn't added automatically
+ set(${COMPONENT}ROOT_DIR ${PROJECT_SOURCE_DIR}/${${COMPONENT}_THIS_PROJECT_RELATIVEPATH}/ PARENT_SCOPE)
+ set(${COMPONENT}LIBRARIES_DIR ${PROJECT_SOURCE_DIR}/${${COMPONENT}_THIS_PROJECT_RELATIVEPATH}/public/libraries/${${COMPONENT}_PLATFORM_FOLDER}/${LOWERCASE_${COMPONENT}_BUILDMODE_DIR} PARENT_SCOPE)
+ set(${COMPONENT}PLUGIN_DIR ${PROJECT_SOURCE_DIR}/${${COMPONENT}_THIS_PROJECT_RELATIVEPATH}/${COMPONENT}Plugin PARENT_SCOPE)
+ set(${COMPONENT}PLUGIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/${${COMPONENT}_THIS_PROJECT_RELATIVEPATH}/${COMPONENT}FilesPlugins/public/${${COMPONENT}_PLATFORM_FOLDER}/${${COMPONENT}_BUILDMODE_DIR} PARENT_SCOPE)
+
+ # each plugin project should implement function named SetupProjectSpecifiedDirectories to specify the directories used by project itself
+endfunction(SetupGeneralDirectories)
# ==============================================================================
# Function: Converts a semicolon separated list into whitespace separated string
diff --git a/build/shared/ToolchainLLVM.cmake b/build/shared/ToolchainLLVM.cmake
index a20abff..37bbb71 100644
--- a/build/shared/ToolchainLLVM.cmake
+++ b/build/shared/ToolchainLLVM.cmake
@@ -14,5 +14,5 @@
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
# SDK and deployment
-set(XMP_OSX_SDK 10.7)
-set(XMP_OSX_TARGET 10.6)
+set(XMP_OSX_SDK 10.8)
+set(XMP_OSX_TARGET 10.7)