Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[magnum] Add recipe #7095

Merged
merged 31 commits into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d2c3864
[magnum] Add recipe
jgsogo Aug 28, 2021
39b2f2c
remove non-ascii char
jgsogo Aug 28, 2021
44aeff9
use build-module to populate some CMake variables
jgsogo Aug 28, 2021
539e094
add suffix for debug libraries
jgsogo Aug 30, 2021
6d2ed9d
gcc 4.9 is not supported
jgsogo Aug 31, 2021
f5f543c
Update recipes/magnum/all/conanfile.py
jgsogo Aug 31, 2021
0c0ff43
add with_gl_info option
jgsogo Aug 31, 2021
2a5560d
add glfw application
jgsogo Aug 31, 2021
297eb11
let Conan manage the options
jgsogo Sep 1, 2021
f18d289
egl (running Linux)
jgsogo Sep 1, 2021
b7d0aaa
CGL context
jgsogo Sep 4, 2021
dcc2af5
add glx and wgl contexts
jgsogo Sep 4, 2021
39ee5ff
added applications (macos perspective)
jgsogo Sep 4, 2021
00db2b8
add executables
jgsogo Sep 4, 2021
d5a690a
test executables (Macos)
jgsogo Sep 4, 2021
9827651
testing in Linux (gcc10)
jgsogo Sep 4, 2021
1f5aadb
work on Windows, thanks @sse4
jgsogo Sep 6, 2021
70d6ecb
use windowless application to test
jgsogo Sep 6, 2021
10b3155
use naive test for linux
jgsogo Sep 7, 2021
5ae7933
use c++11
jgsogo Sep 7, 2021
c6263f3
use naive testing
jgsogo Sep 7, 2021
f500dc4
Apply suggestions from code review
jgsogo Sep 8, 2021
2cef46b
add audio and al-info (tested in Linux)
jgsogo Sep 8, 2021
4b97b3e
rename 'with_xxxx' options to 'xxxx'
jgsogo Sep 8, 2021
70960ea
refactor 'target_gl' option, make it a choice one
jgsogo Sep 8, 2021
f049884
use snake_case for option names
jgsogo Sep 8, 2021
c3b2133
use snake_case for options for executables
jgsogo Sep 8, 2021
5b73cad
enable audio importers
jgsogo Sep 8, 2021
e701009
Apply suggestions from code review
jgsogo Sep 9, 2021
a4fe05f
capture proper exception
jgsogo Sep 9, 2021
83a5751
improve test_pkg comment
jgsogo Sep 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/magnum/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.1)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory("source_subfolder")
25 changes: 25 additions & 0 deletions recipes/magnum/all/cmake/conan-magnum-vars.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Here we are reproducing the variables and call performed by the FindMagnum.cmake provided by the library

# Read flags from configuration
file(READ "${CMAKE_CURRENT_LIST_DIR}/../../include/Magnum/configure.h" _magnumConfigure)
string(REGEX REPLACE ";" "\\\\;" _magnumConfigure "${_magnumConfigure}")
string(REGEX REPLACE "\n" ";" _magnumConfigure "${_magnumConfigure}")
set(_magnumFlags
BUILD_DEPRECATED
BUILD_STATIC
BUILD_STATIC_UNIQUE_GLOBALS
TARGET_GL
TARGET_GLES
TARGET_GLES2
TARGET_GLES3
TARGET_DESKTOP_GLES
TARGET_WEBGL
TARGET_HEADLESS
TARGET_VK)
foreach(_magnumFlag ${_magnumFlags})
list(FIND _magnumConfigure "#define MAGNUM_${_magnumFlag}" _magnum_${_magnumFlag})
if(NOT _magnum_${_magnumFlag} EQUAL -1)
set(MAGNUM_${_magnumFlag} 1)
endif()
endforeach()
4 changes: 4 additions & 0 deletions recipes/magnum/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"2020.06":
url: "https://github.com/mosra/magnum/archive/refs/tags/v2020.06.tar.gz"
sha256: "98dfe802e56614e4e6bf750d9b693de46a5ed0c6eb479b0268f1a20bf34268bf"
389 changes: 389 additions & 0 deletions recipes/magnum/all/conanfile.py

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions recipes/magnum/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)
jgsogo marked this conversation as resolved.
Show resolved Hide resolved

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(Magnum REQUIRED)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} Magnum::Magnum)

set_target_properties(${PROJECT_NAME}
PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
17 changes: 17 additions & 0 deletions recipes/magnum/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
jgsogo marked this conversation as resolved.
Show resolved Hide resolved
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
18 changes: 18 additions & 0 deletions recipes/magnum/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
#include "Magnum/Math/Vector.h"
#include "Magnum/Math/StrictWeakOrdering.h"


// TODO: We should test here using Windowless applications

int main() {
const Magnum::Math::Vector<2, Magnum::Float> v2a{1.0f, 2.0f};
const Magnum::Math::Vector<2, Magnum::Float> v2b{2.0f, 3.0f};
const Magnum::Math::Vector<2, Magnum::Float> v2c{1.0f, 3.0f};

Magnum::Math::StrictWeakOrdering o;
if (o(v2a, v2b)) {
std::cout << "Magnum working\n";
}
return 0;
}
3 changes: 3 additions & 0 deletions recipes/magnum/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"2020.06":
folder: all