2019-11-23 20:27:39 +08:00
|
|
|
# print cmake debug info
|
|
|
|
set(CMAKE_DEBUG_TARGET_PROPERTIES
|
|
|
|
# INCLUDE_DIRECTORIES
|
|
|
|
# COMPILE_DEFINITIONS
|
|
|
|
# COMPILE_OPTIONS
|
|
|
|
# AUTOUIC_OPTIONS
|
|
|
|
# POSITION_INDEPENDENT_CODE
|
|
|
|
)
|
|
|
|
|
2023-07-08 17:13:30 +08:00
|
|
|
# The ``OLD`` behavior for this policy is to set ``OpenGL_GL_PREFERENCE`` to
|
|
|
|
# ``LEGACY``. The ``NEW`` behavior for this policy is to set
|
|
|
|
# ``OpenGL_GL_PREFERENCE`` to ``GLVND``.
|
|
|
|
# need review those libs: X11 Xi Xrandr Xxf86vm Xinerama Xcursor rt m
|
|
|
|
cmake_policy(SET CMP0072 NEW)
|
|
|
|
|
2022-10-01 16:24:52 +08:00
|
|
|
# some useful variables for every one ax project
|
2019-11-23 20:27:39 +08:00
|
|
|
set(ENGINE_BINARY_PATH ${PROJECT_BINARY_DIR}/engine)
|
|
|
|
|
|
|
|
if(CMAKE_TOOLCHAIN_FILE)
|
2023-09-02 19:56:50 +08:00
|
|
|
message(STATUS "Using toolchain file:" ${CMAKE_TOOLCHAIN_FILE})
|
2019-11-23 20:27:39 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# the default behavior of build module
|
2022-12-17 16:35:20 +08:00
|
|
|
option(AX_ENABLE_EXT_LUA "Build lua libraries" ON)
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2020-08-03 20:31:47 +08:00
|
|
|
# hold the extensions list to auto link to app
|
2022-05-13 21:06:17 +08:00
|
|
|
set(_AX_EXTENSION_LIBS "" CACHE INTERNAL "extensions for auto link to target application")
|
2020-08-03 20:31:47 +08:00
|
|
|
|
2023-09-02 19:56:50 +08:00
|
|
|
# configure android GLSLCC compile output, this is the first include cmake module
|
|
|
|
if (ANDROID)
|
2023-10-02 09:47:11 +08:00
|
|
|
file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}/proj.android/app/build/runtime/axslc" _GLSLCC_OUT_DIR)
|
2023-09-02 19:56:50 +08:00
|
|
|
set(GLSLCC_OUT_DIR "${_GLSLCC_OUT_DIR}" CACHE STRING "" FORCE)
|
|
|
|
message(AUTHOR_WARNING "Set GLSLCC_OUT_DIR to ${GLSLCC_OUT_DIR} for android")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# import minimal AXGLSLCC.cmake for shader compiler support
|
|
|
|
# the function: ax_target_compile_shaders avaiable from it
|
|
|
|
set(GLSLCC_FIND_PROG_ROOT "${_AX_ROOT}/tools/external/glslcc")
|
|
|
|
include(AXGLSLCC)
|
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
# include helper functions
|
2022-08-08 18:02:17 +08:00
|
|
|
include(AXBuildHelpers)
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
# set common compiler options
|
|
|
|
# add target compile define function
|
|
|
|
# add target compile options function
|
2022-08-08 18:02:17 +08:00
|
|
|
include(AXConfigDefine)
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
# config libraries dependence
|
2022-08-08 18:02:17 +08:00
|
|
|
include(AXConfigDepend)
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2024-01-19 20:33:40 +08:00
|
|
|
message(AUTHOR_WARNING "CMAKE_VERSION:" ${CMAKE_VERSION})
|
2023-06-13 20:30:57 +08:00
|
|
|
message(STATUS "CMAKE_HOST_SYSTEM_NAME:" ${CMAKE_HOST_SYSTEM_NAME})
|
|
|
|
message(STATUS "CMAKE_SYSTEM_NAME:" ${CMAKE_SYSTEM_NAME})
|
|
|
|
message(STATUS "CMAKE_GENERATOR_PLATFORM:" ${CMAKE_GENERATOR_PLATFORM})
|
|
|
|
message(STATUS "CMAKE_SYSTEM_PROCESSOR:" ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
message(STATUS "CMAKE_CXX_COMPILER_ID:" ${CMAKE_CXX_COMPILER_ID})
|
|
|
|
message(STATUS "FUZZ_MSVC=${FUZZ_MSVC}, FULL_CLANG=${FULL_CLANG}")
|
|
|
|
|
2023-03-11 22:10:18 +08:00
|
|
|
message(STATUS "PROJECT_NAME:" ${PROJECT_NAME})
|
|
|
|
message(STATUS "PROJECT_SOURCE_DIR:" ${PROJECT_SOURCE_DIR})
|
2023-07-06 16:09:54 +08:00
|
|
|
message(STATUS "_AX_ROOT:" ${_AX_ROOT})
|
2023-03-11 22:10:18 +08:00
|
|
|
message(STATUS "CMAKE_MODULE_PATH:" ${CMAKE_MODULE_PATH})
|
|
|
|
# delete binary dir if you hope a full clean re-build
|
|
|
|
message(STATUS "PROJECT_BINARY_DIR:" ${PROJECT_BINARY_DIR})
|
|
|
|
message(STATUS "ENGINE_BINARY_PATH:" ${ENGINE_BINARY_PATH})
|
|
|
|
message(STATUS "ARCH_ALIAS:" ${ARCH_ALIAS})
|
2024-01-02 21:10:28 +08:00
|
|
|
|
2024-01-19 20:33:40 +08:00
|
|
|
_1k_deprecated_32bit(axmol 2.2.0)
|