-
Hi, I'm trying to translate this CMakeLists.txt file to xmake.lua cmake_minimum_required(VERSION 3.8)
project(app CXX)
# Some basics, set accordingly to your needs.
set(CMAKE_CXX_STANDARD 11)
# Where the 'app' and 'blend2d' are.
set(APP_DIR "${CMAKE_CURRENT_LIST_DIR}"
CACHE PATH "Application directory")
set(BLEND2D_DIR "${APP_DIR}/../blend2d"
CACHE PATH "Location of 'blend2d'")
# Enable Blend2D static build.
set(BLEND2D_STATIC TRUE)
include("${BLEND2D_DIR}/CMakeLists.txt")
# Your application target.
add_executable(app app.cpp)
# Add Blend2D dependency to your application. The dependency
# should provide everything needed - include paths, libraries,
# compiler flags, and compiler definitions.
target_link_libraries(app Blend2D::Blend2D) I tried this and it works.. but it creates package("blend2d")
add_deps("cmake")
set_sourcedir(path.join(os.scriptdir(), "libs/blend2d"))
on_install(function (package)
local configs = {}
import("package.tools.cmake").install(package, configs)
end)
package_end()
add_requires("blend2d")
target("learn-blend2d")
set_kind("binary")
add_files("src/*.cpp")
add_packages("blend2d") It seems like I need to set cmake variables to make static linking work... but I don't know how to do that in xmake.lua |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have added blend2d package to xmake-repo. you can run And there is a blend2d example with xmake.lua. |
Beta Was this translation helpful? Give feedback.
I have added blend2d package to xmake-repo. you can run
xrepo update-repo
to update repository and use it directly.And there is a blend2d example with xmake.lua.
see https://github.com/xmake-examples/blend2d-scaffold