Skip to content

Commit

Permalink
Make ROOT work
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Oct 9, 2024
1 parent 5c53c31 commit e2df2df
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
5 changes: 4 additions & 1 deletion yard-cpp/xmake-xp/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ prep-conda:
xmake require --info {{NAME}}

@fetch NAME:
xmake require --fetch {{NAME}}
xmake require --fetch {{NAME}}

@list:
xmake require --list
15 changes: 14 additions & 1 deletion yard-cpp/xmake-xp/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#define SOKOL_IMPL
#include "sokol_time.h"
#include "raylib.h"
// #include "TMath.h"
#include "Math/GenVector/Quaternion.h"
#include <vector>

using std::vector;

int main(int argc, char** argv) {
// use sokol_time
Expand All @@ -28,6 +31,16 @@ int main(int argc, char** argv) {
boost::math::quaternion<double> q3 = q1 * q2;
std::cout << q3 << std::endl;

{
using ROOT::Math::Quaternion;

Quaternion q4(1, 2, 3, 4);
Quaternion q5(5, 6, 7, 8);
Quaternion q6 = q4 * q5;
std::cout << q6.I() << ", " << q6.J() << ", " << q6.K() << ", " << q6.U() << std::endl;

}

InitWindow(800, 450, "raylib [core] example - basic window");

while (!WindowShouldClose())
Expand Down
20 changes: 19 additions & 1 deletion yard-cpp/xmake-xp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ add_rules("mode.debug") -- , "mode.release")
-- https://xmake.io/#/guide/project_examples?id=integrating-the-c-modules-package
set_languages("c++20")

-- https://root.cern/install/#build-from-source
-- https://xmake.io/#/package/remote_package?id=using-self-built-private-package-repository

package("root")
-- set_urls("https://github.com/root-project/root.git")
set_urls("https://github.com/root-project/root/archive/refs/tags/$(version).tar.gz")

add_versions("v6-32-06", "01a98aa656c33898690f0d7b1bc667ebdd7a5f74b34c237b59ea49eca367c9ea")

on_install("macosx", "linux", function (package)
local configs = {}
table.insert(configs, "-Dbuiltin_glew=ON")
import("package.tools.cmake").install(package, configs)
end)
package_end()

add_requires("root")

add_requires("stb")
add_requires("boost")
add_requires("sokol")
Expand All @@ -15,7 +33,7 @@ target("xmake-xp")
add_packages("boost")
add_packages("sokol")
add_packages("raylib")
-- add_packages("root")
add_packages("root")

--
-- If you want to known more usage about xmake, please see https://xmake.io
Expand Down

0 comments on commit e2df2df

Please sign in to comment.