Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 6 deletions Sandbox/conan-recipe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
cmake_minimum_required(VERSION 3.17)
project(cmake_wrapper)

if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
else()
# for out-of-source builds
include(conanbuildinfo.cmake)
endif()
include(conanbuildinfo.cmake)
conan_basic_setup()

# conanfile.py source() method extracts to source_subfolder
Expand Down
2 changes: 0 additions & 2 deletions Sandbox/conan-recipe/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ sources:
url: "https://github.com/sony/nmos-cpp/archive/<last-commit-id-on-YYYYMMDD>.tar.gz"
"sony.master":
url: "https://github.com/sony/nmos-cpp/archive/master.tar.gz"
"garethsb.library-cmake":
url: "https://github.com/garethsb/nmos-cpp/archive/library-cmake.tar.gz"
17 changes: 10 additions & 7 deletions Sandbox/conan-recipe/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class NmosCppConan(ConanFile):
license = "Apache-2.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/sony/nmos-cpp"
topics = ("NMOS")
topics = ("amwa", "nmos", "is-04", "is-05", "is-07", "is-08", "is-09", "broadcasting", "network", "media")

settings = "os", "compiler", "build_type", "arch"
# for now, no "shared" option support
Expand All @@ -31,8 +31,13 @@ class NmosCppConan(ConanFile):
_cmake = None

# for out-of-source build, cf. wrapper CMakeLists.txt
_source_subfolder = "source_subfolder"
_build_subfolder = "build_subfolder"
@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":
Expand All @@ -43,7 +48,7 @@ def requirements(self):
self.requires("boost/1.76.0")
self.requires("cpprestsdk/2.10.18")
self.requires("websocketpp/0.8.2")
self.requires("openssl/1.1.1k")
self.requires("openssl/1.1.1l")
self.requires("json-schema-validator/2.1.0")

def build_requirements(self):
Expand Down Expand Up @@ -90,9 +95,7 @@ def package(self):
def _create_components_file_from_cmake_target_file(self, target_file_path):
components = {}

target_file = open(target_file_path, "r")
target_content = target_file.read()
target_file.close()
target_content = tools.load(target_file_path)

cmake_functions = re.findall(r"(?P<func>add_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P<args>[^)]*)\)", target_content)
for (cmake_function_name, cmake_function_args) in cmake_functions:
Expand Down
2 changes: 1 addition & 1 deletion Sandbox/conan-recipe/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1)
project(NmosCppTestPackage CXX)

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

find_package(nmos-cpp REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions Sandbox/conan-recipe/test_package/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ int main(int argc, char* argv[])
nmos::server_guard node_server_guard(node_server);
std::this_thread::sleep_for(std::chrono::milliseconds(how_long(node_model.settings)));
}
catch (const web::http::http_exception& e)
catch (const std::exception& e)
{
slog::log<slog::severities::error>(gate, SLOG_FLF) << "HTTP error: " << e.what() << " [" << e.error_code() << "]";
slog::log<slog::severities::error>(gate, SLOG_FLF) << "Exception: " << e.what();
}
return 0;
}