2024-04-14 16:28:42 +08:00
|
|
|
set(AWTK_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Path to AWTK root directory")
|
|
|
|
|
|
|
|
# 查找awtk库的头文件和库文件
|
|
|
|
find_library(AWTK_LIBRARY NAMES awtk PATHS ${AWTK_ROOT_DIR}/bin)
|
|
|
|
|
|
|
|
file(COPY ${AWTK_LIBRARY} DESTINATION ${PROJECT_SOURCE_DIR}/bin)
|
|
|
|
|
2024-04-15 07:43:58 +08:00
|
|
|
add_compile_definitions(WITH_FS_RES)
|
|
|
|
add_compile_definitions(HAS_STDIO)
|
|
|
|
add_compile_definitions(HAS_STD_MALLOC)
|
|
|
|
|
2024-04-14 16:28:42 +08:00
|
|
|
set(AWTK_LIBRARIES ${AWTK_LIBRARY})
|
2024-04-25 18:39:16 +08:00
|
|
|
set(AWTK_INCLUDE_DIRS ${AWTK_ROOT_DIR}/src ${AWTK_ROOT_DIR}/3rd ${AWTK_ROOT_DIR}/src/ext_widgets ${AWTK_ROOT_DIR}/src ${AWTK_ROOT_DIR}/3rd/SDL/include ${AWTK_ROOT_DIR}/3rd/nanovg/base)
|
2024-04-14 16:28:42 +08:00
|
|
|
|
2024-04-15 08:37:38 +08:00
|
|
|
link_directories(${AWTK_ROOT_DIR}/bin)
|
|
|
|
include_directories(${AWTK_INCLUDE_DIRS})
|
|
|
|
|
2024-04-15 07:43:58 +08:00
|
|
|
if(WIN32)
|
|
|
|
file(COPY ${AWTK_ROOT_DIR}/bin/awtk.dll DESTINATION ${CMAKE_BINARY_DIR}/Debug)
|
2024-04-26 18:36:49 +08:00
|
|
|
file(COPY ${AWTK_ROOT_DIR}/bin/awtk.dll DESTINATION ${PROJECT_SOURCE_DIR}/bin)
|
2024-04-15 07:43:58 +08:00
|
|
|
endif()
|
2024-04-14 16:28:42 +08:00
|
|
|
|
2024-04-15 07:43:58 +08:00
|
|
|
#示例请参考 awtk-hello/CMakeLists.txt
|