[DO-981] qt package (!15)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15
This commit is contained in:
31
recipes/opengl/all/test_cmake_module_package/CMakeLists.txt
Normal file
31
recipes/opengl/all/test_cmake_module_package/CMakeLists.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(test_package)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
set(SOURCES ../test_package/test_package.cpp)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND SOURCES ../test_package/win.cpp)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND SOURCES ../test_package/osx.mm)
|
||||
set_source_files_properties(../test_package/osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++")
|
||||
|
||||
list(APPEND PLATFORM_LIBS "objc")
|
||||
|
||||
find_library(APPKIT_LIBRARY AppKit)
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
|
||||
if(APPKIT_LIBRARY)
|
||||
list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(FOUNDATION_LIBRARY)
|
||||
list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL ${PLATFORM_LIBS})
|
||||
26
recipes/opengl/all/test_cmake_module_package/conanfile.py
Normal file
26
recipes/opengl/all/test_cmake_module_package/conanfile.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import cmake_layout, CMake
|
||||
import os
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def test(self):
|
||||
if can_run(self):
|
||||
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
|
||||
self.run(bin_path, env="conanrun")
|
||||
Reference in New Issue
Block a user