-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial attempt at libui for CCI. * Update recipes/libui/all/conanfile.py Co-authored-by: Anonymous Maarten <[email protected]> * Update recipes/libui/all/test_package/conanfile.py Co-authored-by: Anonymous Maarten <[email protected]> * Update recipes/libui/all/test_package/conanfile.py Co-authored-by: Anonymous Maarten <[email protected]> * Update recipes/libui/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * Update recipes/libui/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * Fix syntax error. Co-authored-by: Anonymous Maarten <[email protected]> Co-authored-by: Chris Mc <[email protected]>
- Loading branch information
1 parent
8a3a758
commit d5786a0
Showing
7 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(cmake_wrapper) | ||
|
||
include(conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_subdirectory("source_subfolder") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"0.4.1": | ||
url: "https://github.com/andlabs/libui/archive/refs/tags/alpha4.1.tar.gz" | ||
sha256: "f51a9e20e9f9a4c0bce1571ee37f203f42de33e3ac7359a6aac87a54798e8716" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
from conans import ConanFile, CMake, tools | ||
from conans.tools import os_info | ||
import os | ||
|
||
|
||
class libuiConan(ConanFile): | ||
name = "libui" | ||
description = "Simple and portable GUI library in C that uses the native GUI technologies of each platform it supports." | ||
topics = ("conan", "libui", "ui", "gui") | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://github.com/andlabs/libui" | ||
license = "MIT" | ||
exports_sources = ["CMakeLists.txt"] | ||
generators = "cmake", "pkg_config" | ||
settings = "os", "arch", "compiler", "build_type" | ||
options = {"shared": [True, False], "fPIC": [True, False]} | ||
default_options = {"shared": False, "fPIC": True} | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
@property | ||
def _build_subfolder(self): | ||
return "build_subfolder" | ||
|
||
def config_options(self): | ||
if self.settings.os == 'Windows': | ||
del self.options.fPIC | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) | ||
|
||
def requirements(self): | ||
self.requires("gtk/3.24.24") | ||
|
||
def _configure_cmake(self): | ||
cmake = CMake(self) | ||
cmake.configure(build_folder=self._build_subfolder) | ||
return cmake | ||
|
||
def build(self): | ||
cmake = self._configure_cmake() | ||
cmake.build() | ||
|
||
def package(self): | ||
self.copy(pattern="LICENSE", dst="licenses", | ||
src=self._source_subfolder) | ||
self.copy(pattern="*.h", dst="include", src=self._source_subfolder) | ||
self.copy(pattern="*.dll", dst="bin", keep_path=False) | ||
self.copy(pattern="*.lib", dst="lib", keep_path=False) | ||
self.copy(pattern="*.a", dst="lib", keep_path=False) | ||
self.copy(pattern="*.so*", dst="lib", keep_path=False) | ||
self.copy(pattern="*.dylib", dst="lib", keep_path=False) | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = tools.collect_libs(self) | ||
if self.settings.os == "Windows": | ||
self.cpp_info.system_libs.extend( | ||
[ | ||
"user32", | ||
"kernel32", | ||
"gdi32", | ||
"comctl32", | ||
"msimg32", | ||
"comdlg32", | ||
"d2d1", | ||
"dwrite", | ||
"ole32", | ||
"oleaut32", | ||
"oleacc", | ||
"uuid", | ||
"windowscodecs", | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package C) | ||
|
||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_executable(${PROJECT_NAME} test_package.c) | ||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "ui.h" | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
uiInitOptions o; | ||
|
||
const char *err; | ||
o.Size = 0; | ||
err = uiInit(&o); | ||
if (err != NULL) | ||
{ | ||
fprintf(stderr, "error initializing ui: %s\n", err); | ||
uiFreeInitError(err); | ||
return 0; | ||
} | ||
|
||
uiMain(); | ||
uiUninit(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"0.4.1": | ||
folder: "all" |