-
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.
(#12197) gsoap: add fPIC option + add test_v1_package + few improvements
* add test_v1_package * some improvements: - conan >=1.46.0 is required - use GNUInstallDirs in custom CMakeLists - isolate source code under src folder - move custom cmake files under cmake folder instead of src folder - install imports directly under bin folder instead of moving it after installation - add VirtualBuildEnv since there are tool_requires - reorder methos by order of execution * add shared & fPIC options * no need for CMAKE_SOURCE_DIR * explicit cpp_info.requires due to conan-io/conan#11789 fixed by conan-io/conan#11790 * remove shared option * winflexbison for msvc only * check compiler from build profile
- Loading branch information
Showing
9 changed files
with
119 additions
and
64 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
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
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
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
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
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
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
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,15 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package LANGUAGES CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(gsoap REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} | ||
../test_package/test_package.cpp | ||
${CMAKE_BINARY_DIR}/soapC.cpp | ||
${CMAKE_BINARY_DIR}/soapcalcProxy.cpp | ||
) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE gsoap::gsoap) |
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,26 @@ | ||
# pylint: skip-file | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
# TODO: Add some test for the cross-building scenario | ||
|
||
if not tools.cross_building(self): | ||
calc_wsdl = os.path.join(self.source_folder, os.pardir, "test_package", "calc.wsdl") | ||
self.output.info("Generating code from WSDL '{}'".format(calc_wsdl)) | ||
self.run("wsdl2h -o calc.h {}".format(calc_wsdl), run_environment=True) | ||
self.run("soapcpp2 -j -CL -I{} calc.h".format(os.path.join(self.deps_cpp_info["gsoap"].rootpath, 'bin', 'import')), run_environment=True) | ||
|
||
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) |