2023-05-01 16:24:56 +00:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2023-05-21 20:32:50 +00:00
|
|
|
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)
|
|
|
|
project(rayjs)
|
2023-05-01 16:24:56 +00:00
|
|
|
|
2023-05-04 15:00:22 +00:00
|
|
|
message("=== Configure raylib ===")
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/raylib EXCLUDE_FROM_ALL)
|
2023-05-02 19:33:02 +00:00
|
|
|
|
|
|
|
message("=== Configure QuickJS ===")
|
2023-05-01 16:24:56 +00:00
|
|
|
# add quickjs
|
|
|
|
set(quickjs_version 2021-03-27)
|
|
|
|
set(quickjs_sources_root ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/quickjs)
|
|
|
|
set(quickjs_sources
|
|
|
|
${quickjs_sources_root}/quickjs.h
|
2023-05-23 15:45:10 +00:00
|
|
|
#${quickjs_sources_root}/quickjs-libc.h
|
2023-05-01 16:24:56 +00:00
|
|
|
${quickjs_sources_root}/quickjs.c
|
|
|
|
${quickjs_sources_root}/libregexp.c
|
|
|
|
${quickjs_sources_root}/libunicode.c
|
|
|
|
${quickjs_sources_root}/libbf.c
|
|
|
|
${quickjs_sources_root}/cutils.c
|
2023-05-23 15:45:10 +00:00
|
|
|
#${quickjs_sources_root}/quickjs-libc.c
|
2023-05-01 16:24:56 +00:00
|
|
|
)
|
|
|
|
add_library(quickjs STATIC
|
|
|
|
${quickjs_sources}
|
|
|
|
)
|
|
|
|
target_compile_definitions(quickjs
|
|
|
|
PRIVATE
|
|
|
|
CONFIG_VERSION="${quickjs_version}"
|
|
|
|
)
|
|
|
|
target_include_directories(quickjs
|
|
|
|
PRIVATE
|
|
|
|
${quickjs_sources_root}
|
|
|
|
)
|
|
|
|
|
2023-06-15 13:32:20 +00:00
|
|
|
add_library(lightmapper INTERFACE)
|
|
|
|
target_include_directories(lightmapper INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/lightmapper)
|
|
|
|
|
2023-05-01 16:24:56 +00:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
2023-05-04 15:00:22 +00:00
|
|
|
file(GLOB files src/*.c)
|
2023-05-21 20:32:50 +00:00
|
|
|
#add_executable(${CMAKE_PROJECT_NAME} MACOSX_BUNDLE ${files})
|
2023-05-02 19:33:02 +00:00
|
|
|
add_executable(${CMAKE_PROJECT_NAME} ${files})
|
|
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE include)
|
|
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE src)
|
2023-06-02 06:03:36 +00:00
|
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE thirdparty/raygui/src)
|
2023-06-19 21:24:30 +00:00
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} quickjs raylib lightmapper)
|