| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #
- # Copyright (c) 2008-2015 the Urho3D project.
- #
- # Permission is hereby granted, free of charge, to any person obtaining a copy
- # of this software and associated documentation files (the "Software"), to deal
- # in the Software without restriction, including without limitation the rights
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- # copies of the Software, and to permit persons to whom the Software is
- # furnished to do so, subject to the following conditions:
- #
- # The above copyright notice and this permission notice shall be included in
- # all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
- #
- # Set project name
- project (Urho3D-Tools)
- # Find Urho3D library
- find_package (Urho3D REQUIRED)
- include_directories (${URHO3D_INCLUDE_DIRS})
- # Urho3DPlayer target is rather special, although it is here, it is not a tool because it builds into platform-specific binary
- if (NOT EMSCRIPTEN)
- add_subdirectory (Urho3DPlayer)
- endif ()
- # Build PackageTool using host compiler toolchain
- if ((CMAKE_CROSSCOMPILING OR IOS) AND URHO3D_PACKAGING)
- # When cross-compiling, build the host tool as external project
- include (ExternalProject)
- if (IOS)
- # For iOS target, its host is MacOSX; Also workaround a known CMake/Xcode generator bug which prevents it from installing binaries correctly
- set (OSX_HOST -DCMAKE_OSX_SYSROOT=macosx BUILD_COMMAND bash -c "sed -i '' 's/EFFECTIVE_PLATFORM_NAME//g' CMakeScripts/install_postBuildPhase.make*")
- endif ()
- ExternalProject_Add (PackageTool
- SOURCE_DIR ${CMAKE_SOURCE_DIR}/Source/Tools/PackageTool
- CMAKE_ARGS -DDEST_RUNTIME_DIR=${CMAKE_BINARY_DIR}/bin/tool -DBAKED_CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DBAKED_CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} ${OSX_HOST})
- install (PROGRAMS ${CMAKE_BINARY_DIR}/bin/tool/PackageTool DESTINATION ${DEST_RUNTIME_DIR}/tool)
- endif ()
- # All tools must be natively built and output to bin/tool subdir to differentiate them from platform-specific binaries in the bin directory
- set_output_directories (${CMAKE_BINARY_DIR}/bin/tool RUNTIME PDB)
- if (URHO3D_TOOLS)
- # Urho3D tools
- add_subdirectory (AssetImporter)
- add_subdirectory (OgreImporter)
- add_subdirectory (PackageTool)
- add_subdirectory (RampGenerator)
- add_subdirectory (SpritePacker)
- if (URHO3D_ANGELSCRIPT)
- add_subdirectory (ScriptCompiler)
- endif ()
- elseif ((NOT CMAKE_CROSSCOMPILING AND NOT IOS) AND URHO3D_PACKAGING)
- # PackageTool target is required but we are not cross-compiling, so build it as per normal
- add_subdirectory (PackageTool)
- endif ()
|