-
Notifications
You must be signed in to change notification settings - Fork 2k
Restructure directories add 2.3.4 #8561
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
Changes from 2 commits
c28fca5
88cd408
993e4cc
9df42ac
83c2f67
adcf538
6f95d42
4eb083d
569d01a
94b78b5
10df994
cb98c69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ class FastDDSConan(ConanFile): | |
} | ||
generators = "cmake", "cmake_find_package" | ||
_cmake = None | ||
exports_sources = ["patches/**", "CMakeLists.txt"] | ||
|
||
@property | ||
def _pkg_share(self): | ||
|
@@ -93,6 +94,12 @@ def _patch_sources(self): | |
for patch in self.conan_data["patches"][self.version]: | ||
tools.patch(**patch) | ||
|
||
def validate(self): | ||
# FIXME: Foonathan dependency currently not proper working with cross compile | ||
# see https://github.com/conan-io/conan-center-index/pull/7632#discussion_r730445887 | ||
if hasattr(self, "settings_build") and tools.cross_building(self): | ||
raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome.") | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
|
@@ -118,12 +125,7 @@ def requirements(self): | |
self.requires("foonathan-memory/0.7.0") | ||
self.requires("boost/1.73.0") | ||
if self.options.with_ssl: | ||
self.requires("openssl/1.1.1m") | ||
|
||
def export_sources(self): | ||
self.copy("CMakeLists.txt") | ||
for patch in self.conan_data.get("patches", {}).get(self.version, []): | ||
self.copy(patch["patch_file"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why it it removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clicked wrong button .... sorry for that will soon add again |
||
self.requires("openssl/1.1.1k") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this downgrade? |
||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], strip_root=True, | ||
|
@@ -176,10 +178,10 @@ def package(self): | |
|
||
def package_info(self): | ||
self.cpp_info.names["cmake_find_package"] = "fastdds" | ||
self.cpp_info.names["cmake_find_package_multi"] = "fastdds" | ||
self.cpp_info.names["cmake_find_multi_package"] = "fastdds" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no |
||
# component fastrtps | ||
self.cpp_info.components["fastrtps"].names["cmake_find_package"] = "fastrtps" | ||
self.cpp_info.components["fastrtps"].names["cmake_find_package_multi"] = "fastrtps" | ||
self.cpp_info.components["fastrtps"].names["cmake_find_multi_package"] = "fastrtps" | ||
self.cpp_info.components["fastrtps"].libs = tools.collect_libs(self) | ||
self.cpp_info.components["fastrtps"].requires = [ | ||
"fast-cdr::fast-cdr", | ||
|
@@ -203,14 +205,14 @@ def package_info(self): | |
self.cpp_info.components["fastrtps"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] | ||
# component fast-discovery | ||
self.cpp_info.components["fast-discovery-server"].names["cmake_find_package"] = "fast-discovery-server" | ||
self.cpp_info.components["fast-discovery-server"].names["cmake_find_package_multi"] = "fast-discovery-server" | ||
self.cpp_info.components["fast-discovery-server"].names["cmake_find_multi_package"] = "fast-discovery-server" | ||
self.cpp_info.components["fast-discovery-server"].bindirs = ["bin"] | ||
bin_path = os.path.join(self.package_folder, "bin") | ||
self.output.info("Appending PATH env var for fast-dds::fast-discovery-server with : {}".format(bin_path)), | ||
self.env_info.PATH.append(bin_path) | ||
# component tools | ||
self.cpp_info.components["tools"].names["cmake_find_package"] = "tools" | ||
self.cpp_info.components["tools"].names["cmake_find_package_multi"] = "tools" | ||
self.cpp_info.components["tools"].names["cmake_find_multi_package"] = "tools" | ||
self.cpp_info.components["tools"].bindirs = [os.path.join("bin","tools")] | ||
bin_path = os.path.join(self._pkg_bin, "tools") | ||
self.output.info("Appending PATH env var for fast-dds::tools with : {}".format(bin_path)), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8a9cb0209..400c681e7 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -225,8 +225,8 @@ if(NOT BUILD_SHARED_LIBS) | ||
endif() | ||
|
||
eprosima_find_package(fastcdr REQUIRED) | ||
-eprosima_find_thirdparty(Asio asio VERSION 1.10.8) | ||
-eprosima_find_thirdparty(TinyXML2 tinyxml2) | ||
+eprosima_find_thirdparty(asio REQUIRED) | ||
+eprosima_find_thirdparty(tinyxml2 REQUIRED) | ||
|
||
find_package(foonathan_memory REQUIRED) | ||
message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") | ||
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt | ||
index d26915242..f00e36ea6 100644 | ||
--- a/src/cpp/CMakeLists.txt | ||
+++ b/src/cpp/CMakeLists.txt | ||
@@ -456,7 +456,7 @@ elseif(NOT EPROSIMA_INSTALLER) | ||
# Link library to external libraries. | ||
target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory | ||
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} | ||
- ${TINYXML2_LIBRARY} | ||
+ tinyxml2::tinyxml2 | ||
$<$<BOOL:${LINK_SSL}>:OpenSSL::SSL$<SEMICOLON>OpenSSL::Crypto$<$<BOOL:${WIN32}>:$<SEMICOLON>crypt32.lib>> | ||
$<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi> | ||
${THIRDPARTY_BOOST_LINK_LIBS} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(HelloWorldExample) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
find_package(fastdds REQUIRED) | ||
|
||
include_directories(msg) | ||
|
||
add_executable(test_pub | ||
HelloWorld_pub.cpp | ||
msg/HelloWorld.cxx | ||
msg/HelloWorldPublisher.cpp | ||
msg/HelloWorldPubSubTypes.cxx | ||
msg/HelloWorldSubscriber.cpp | ||
) | ||
|
||
add_executable(test_sub | ||
HelloWorld_sub.cpp | ||
msg/HelloWorld.cxx | ||
msg/HelloWorldPublisher.cpp | ||
msg/HelloWorldPubSubTypes.cxx | ||
msg/HelloWorldSubscriber.cpp | ||
) | ||
|
||
set_property(TARGET test_sub PROPERTY CXX_STANDARD 11) | ||
set_property(TARGET test_pub PROPERTY CXX_STANDARD 11) | ||
|
||
target_link_libraries(test_sub | ||
fastrtps | ||
) | ||
|
||
target_link_libraries(test_pub | ||
fastrtps | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file HelloWorld_main.cpp | ||
* | ||
*/ | ||
|
||
#include "HelloWorldPublisher.h" | ||
#include "HelloWorldSubscriber.h" | ||
|
||
#include <fastrtps/Domain.h> | ||
#include <fastrtps/log/Log.h> | ||
|
||
using namespace eprosima; | ||
using namespace fastrtps; | ||
using namespace rtps; | ||
int main(int argc, char** argv) | ||
{ | ||
std::cout << "Starting "<< std::endl; | ||
|
||
int count = 5; | ||
long sleep = 100; | ||
|
||
HelloWorldPublisher mypub; | ||
if(mypub.init()) | ||
{ | ||
mypub.run(count, sleep); | ||
} | ||
else | ||
{ | ||
std::cout << "problems ... init didnt work" << std::endl; | ||
} | ||
Domain::stopAll(); | ||
Log::Reset(); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file HelloWorld_main.cpp | ||
* | ||
*/ | ||
|
||
#include "HelloWorldPublisher.h" | ||
#include "HelloWorldSubscriber.h" | ||
|
||
#include <fastrtps/Domain.h> | ||
#include <fastrtps/log/Log.h> | ||
|
||
using namespace eprosima; | ||
using namespace fastrtps; | ||
using namespace rtps; | ||
int main(int argc, char** argv) | ||
{ | ||
std::cout << "Starting "<< std::endl; | ||
|
||
int count = 5; | ||
long sleep = 100; | ||
|
||
HelloWorldSubscriber mysub; | ||
if(mysub.init()) | ||
{ | ||
mysub.run(count); | ||
} | ||
else | ||
{ | ||
std::cout << "problems ... init didnt work" << std::endl; | ||
} | ||
Domain::stopAll(); | ||
Log::Reset(); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import subprocess | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
from subprocess import Popen | ||
|
||
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.settings): | ||
bin_sub_cmd = os.path.join("bin", "test_sub") | ||
bin_pub_cmd = os.path.join("bin", "test_pub") | ||
sub_process = Popen([bin_sub_cmd],stdout=subprocess.PIPE) | ||
pub_process = Popen([bin_pub_cmd],stdout=subprocess.PIPE) | ||
sub_process.wait(5) | ||
pub_process.wait(5) | ||
msg_send = 'Message: HelloWorld with index: 5 SENT' in str(pub_process.stdout.read()) | ||
msg_received = 'HelloWorld 5 RECEIVED' in str(sub_process.stdout.read()) | ||
assert msg_send | ||
assert msg_received | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to remove, there is already a validate() method. It seems you have reverted all the fixes of another PR, correct?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - adapted and try again