diff --git a/.gitignore b/.gitignore index e69de29..3bb6715 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,13 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store/ + +# CMake +CMakeLists.txt +cmake-build-*/ + +# Idea +.idea/ \ No newline at end of file diff --git a/source/hpr/container.cpp b/source/hpr/container.cpp new file mode 100644 index 0000000..aa966c8 --- /dev/null +++ b/source/hpr/container.cpp @@ -0,0 +1,2 @@ + +#include diff --git a/source/hpr/container.hpp b/source/hpr/container.hpp new file mode 100644 index 0000000..106210c --- /dev/null +++ b/source/hpr/container.hpp @@ -0,0 +1,4 @@ +#pragma once + +#include + diff --git a/source/hpr/main.cpp b/source/hpr/main.cpp new file mode 100644 index 0000000..db5efd2 --- /dev/null +++ b/source/hpr/main.cpp @@ -0,0 +1,9 @@ +#include + +using namespace std; + +int main(int argc, char** argv) +{ + cout << "hello xmake!" << endl; + return 0; +} diff --git a/source/hpr/xmake.lua b/source/hpr/xmake.lua new file mode 100644 index 0000000..c3e2cab --- /dev/null +++ b/source/hpr/xmake.lua @@ -0,0 +1,33 @@ +target("hpr") + set_kind("shared") + set_languages("c++20") + + set_policy("build.c++.modules", false) + + + add_includedirs("..", { public = true }) + + add_headerfiles("../(hpr/*.hpp)") + + add_files("container.cpp") + + -- export all symbols for windows/dll + if is_plat("windows") and is_kind("shared") then + if is_mode("release") then + set_optimize("fastest") + end + add_rules("utils.symbols.export_all") + end + + -- install importfiles for pkg-config/cmake + add_rules("utils.install.cmake_importfiles") + add_rules("utils.install.pkgconfig_importfiles") + + -- add packages + for _, name in ipairs({"imgui", "implot", "glfw", "opencascade"}) do + add_packages(name) + if has_package(name) then + set_configvar("HPR_HAVE_PACKAGE_" .. name:upper(), 1) + end + end +target_end() \ No newline at end of file diff --git a/source/xmake.lua b/source/xmake.lua new file mode 100644 index 0000000..4285366 --- /dev/null +++ b/source/xmake.lua @@ -0,0 +1,34 @@ + +-- options: general +option("creator") + set_category("option") + set_default(false) + set_showmenu(true) + set_description("Enable creator application") +option_end() + +-- options: modules +for _, name in ipairs({"csg", "mesh"}) do + option(name) + set_category("module") + set_default(true) + set_showmenu(true) + set_description(format("Module %s", name)) + set_configvar("HPR_HAVE_MODULE_" .. name:upper(), 1) + option_end() +end + +-- packages +add_requires("imgui v1.90-docking") +add_requires("implot v0.15") +add_requires("glfw 3.3.8") + +if has_config("csg") then + add_requires("conan::opencascade/7.6.2") +end + +-- includes project dirs +includes("hpr") +if has_config("creator") then + includes("creator") +end \ No newline at end of file diff --git a/xmake.lua b/xmake.lua new file mode 100644 index 0000000..1673467 --- /dev/null +++ b/xmake.lua @@ -0,0 +1,17 @@ +set_project("hpr") + +set_version("0.0.1") + +add_rules("mode.debug", "mode.release") + +if is_mode("debug") then + add_defines("HPR_DEBUG") +end + +if is_plat("linux") and is_mode("debug") then + add_ldflags("-rdynamic") +end + +set_optimize("fastest") + +includes("source") \ No newline at end of file