webui icon indicating copy to clipboard operation
webui copied to clipboard

conan: experimental package support

Open Juff-Ma opened this issue 8 months ago • 0 comments

So, this adds the talked about package support for conan and in theory this should work. However, when I tried using the package it spit out linker errors (tried with tls=True and shared=True, it couldn't find the used functions). I'm not an expert in conan packaging so maybe the package itself is fine and I did something wrong.

I tried it using the following commands (files below):

  1. conan create . (in webui repo, everything else in the test folder)
  2. conan install . --build="webui/2.5.0-beta.4" -of conan
  3. cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake
  4. cmake --build build

main.c:

#include <webui.h>

int main() {

	size_t my_window = webui_new_window();
	webui_show(my_window, "<html><head><script src=\"webui.js\"></script></head> Hello World ! </html>");
	webui_wait();
	return 0;
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.15)

project(Test)

add_executable(Test
    main.c)

find_package(webui REQUIRED)

include_directories(${webui_INCLUDE_DIRS})

target_link_libraries(Test
    PUBLIC webui::webui)

install(TARGETS Test)

conanfile.txt:

[requires]
webui/2.5.0-beta.4

[generators]
CMakeToolchain
CMakeDeps

[options]
webui/*:shared=True
webui/*:tls=True

Juff-Ma avatar Apr 17 '25 13:04 Juff-Ma