diff --git a/CMakeLists.txt b/CMakeLists.txt index 35a60dc..43b044f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,13 +247,13 @@ if(NOT RAKE) endif() set(MRUBY_BUILDDIR ${CMAKE_SOURCE_DIR}/build/mruby) -set(MRUBY_DIR ${THIRDPARTY_DIR}/mruby) +set(MRUBY_DIR @mruby@) if(ANDROID) set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_android.rb) else() set(MRUBY_CONFIG ${MRUBY_BUILDDIR}/tic_default.rb) endif() -set(MRUBY_LIB ${MRUBY_DIR}/build/target/lib/libmruby.a) +set(MRUBY_LIB ${MRUBY_DIR}/lib/libmruby.a) if(MSVC) set(MRUBY_TOOLCHAIN visualcpp) @@ -271,26 +271,6 @@ if(ANDROID_NDK_HOME) set(MRUBY_RAKE_EXTRA_OPTS "${MRUBY_RAKE_EXTRA_OPTS} ANDROID_NDK_HOME=${ANDROID_NDK_HOME}") endif() -ExternalProject_Add(mruby_vendor - SOURCE_DIR ${MRUBY_DIR} - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE TRUE - BUILD_COMMAND - ${RAKE} clean all "MRUBY_CONFIG=${MRUBY_CONFIG}" - "TARGET_CC=\"${CMAKE_C_COMPILER}\"" - "TARGET_AR=\"${CMAKE_AR}\"" - "TARGET_CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BUILD_TYPE_UC}}" - "TARGET_LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_LINKER_FLAGS_${BUILD_TYPE_UC}}" - "BUILD_TYPE=${BUILD_TYPE_UC}" - "MRUBY_SYSROOT=${MRUBY_SYSROOT}" - "MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN}" - "ANDROID_ARCH=${CMAKE_ANDROID_ARCH_ABI}" - "ANDROID_PLATFORM=android-${CMAKE_SYSTEM_VERSION}" - ${MRUBY_RAKE_EXTRA_OPTS} - INSTALL_COMMAND "" - BUILD_BYPRODUCTS ${MRUBY_LIB} -) - add_library(mruby STATIC IMPORTED GLOBAL) set_property(TARGET mruby APPEND PROPERTY IMPORTED_LOCATION ${MRUBY_LIB} @@ -298,7 +278,6 @@ set_property(TARGET mruby APPEND set_property(TARGET mruby APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MRUBY_DIR}/include ) -add_dependencies(mruby mruby_vendor) ################################ # SQUIRREL @@ -1055,6 +1034,19 @@ if(BUILD_SOKOL) target_link_options(tic80-sokol PRIVATE -static -mconsole) endif() + if(LINUX) + configure_file("${PROJECT_SOURCE_DIR}/build/linux/tic80.desktop.in" "${PROJECT_SOURCE_DIR}/build/linux/tic80.desktop") + + install(TARGETS tic80-sokol DESTINATION bin) + + SET(TIC80_DESKTOP_DIR "share/applications/") + SET(TIC80_PIXMAPS_DIR "share/icons/") + + install (FILES ${PROJECT_SOURCE_DIR}/build/linux/tic80.desktop DESTINATION ${TIC80_DESKTOP_DIR}) + install (FILES ${PROJECT_SOURCE_DIR}/build/linux/tic80.xml DESTINATION ${TIC80_DESKTOP_DIR}) + install (FILES ${PROJECT_SOURCE_DIR}/build/linux/tic80.png DESTINATION ${TIC80_PIXMAPS_DIR}) + endif() + target_link_libraries(tic80-sokol tic80studio sokol) endif()