CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright (c) 2008-2023 the Urho3D project
  2. # License: MIT
  3. if (NOT CMAKE_PROJECT_NAME STREQUAL Urho3D)
  4. # Set CMake minimum version
  5. cmake_minimum_required (VERSION 3.10.2)
  6. # Set project name
  7. project (Urho3D-ExternalProject-PackageTool)
  8. # Set CMake modules search path
  9. set (CMAKE_MODULE_PATH ${BAKED_CMAKE_SOURCE_DIR}/cmake/Modules)
  10. # Include UrhoCommon.cmake module after setting project name
  11. include (UrhoCommon)
  12. # Define additional source files
  13. set (MINI_URHO_CPP_FILES
  14. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Container/Allocator.cpp
  15. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Container/HashBase.cpp
  16. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Container/RefCounted.cpp
  17. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Container/Str.cpp
  18. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Container/VectorBase.cpp
  19. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Context.cpp
  20. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/EventProfiler.cpp
  21. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Mutex.cpp
  22. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Object.cpp
  23. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/ProcessUtils.cpp
  24. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Profiler.cpp
  25. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/StringHashRegister.cpp
  26. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/StringUtils.cpp
  27. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Thread.cpp
  28. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Timer.cpp
  29. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Core/Variant.cpp
  30. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/Deserializer.cpp
  31. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/File.cpp
  32. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/FileSystem.cpp
  33. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/Log.cpp
  34. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/MemoryBuffer.cpp
  35. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/PackageFile.cpp
  36. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/Serializer.cpp
  37. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/IO/VectorBuffer.cpp
  38. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Color.cpp
  39. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Matrix3.cpp
  40. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Matrix3x4.cpp
  41. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Matrix4.cpp
  42. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Quaternion.cpp
  43. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Rect.cpp
  44. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/StringHash.cpp
  45. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Vector2.cpp
  46. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Vector3.cpp
  47. ${BAKED_CMAKE_SOURCE_DIR}/Source/Urho3D/Math/Vector4.cpp
  48. )
  49. # Define preprocessor macros
  50. add_definitions (-DMINI_URHO)
  51. # Setup SDK-like include dir in the build tree for building the mini-urho
  52. set (DEST_INCLUDE_DIR include/Urho3D)
  53. file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEST_INCLUDE_DIR}/ThirdParty)
  54. # Add dependency targets
  55. if (NOT CMAKE_SYSTEM_NAME STREQUAL Linux)
  56. include (CheckIncludeFile)
  57. check_include_file (stdint.h HAVE_STDINT_H)
  58. add_subdirectory (${BAKED_CMAKE_SOURCE_DIR}/Source/ThirdParty/LibCpuId host/LibCpuId)
  59. set (LIBS LibCpuId)
  60. endif ()
  61. add_subdirectory (${BAKED_CMAKE_SOURCE_DIR}/Source/ThirdParty/LZ4 host/LZ4)
  62. set (INCLUDE_DIRS ${BAKED_CMAKE_BINARY_DIR}/include ${BAKED_CMAKE_BINARY_DIR}/include/Urho3D ${CMAKE_BINARY_DIR}/${DEST_INCLUDE_DIR}/ThirdParty)
  63. endif ()
  64. # Define target name
  65. if (TARGET PackageTool) # The target name is already taken by host-tool external project, so use a postfix for the target-tool
  66. set (POSTFIX _target)
  67. endif ()
  68. set (TARGET_NAME PackageTool${POSTFIX})
  69. # Define source files
  70. define_source_files (EXTRA_CPP_FILES ${MINI_URHO_CPP_FILES})
  71. # Define dependency libs
  72. list (APPEND LIBS LZ4)
  73. # Setup target
  74. setup_executable (TOOL)
  75. adjust_target_name () # Remove postfix from the executable/binary name