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
2 changes: 1 addition & 1 deletion recipes/gsoap/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
else()
include(conanbuildinfo.cmake)
endif()
conan_basic_setup()
conan_basic_setup(TARGETS)

message("Generate gSOAP from sources at ${GSOAP_PATH}")

Expand Down
8 changes: 4 additions & 4 deletions recipes/gsoap/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
sources:
"2.8.103":
sha256: "7ddafb1aa016bf5cedde689267b4149f68a48ee848f712bbda92947cecf6d6c4"
url: "https://github.com/conan-io/cci-sources-backup/raw/main/gsoap/gsoap2-code-r186.zip"
url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap2-code-r186.zip"
"2.8.104":
sha256: "2ed385f2aeb753f0a17007f0e6fdb08770185ad7cd2f531ae051cc322411abcc"
url: "https://github.com/conan-io/cci-sources-backup/raw/main/gsoap/gsoap2-code-r187.zip"
url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap2-code-r187.zip"
"2.8.105":
sha256: "c60b973a1c23574ca673da86f018bd36b38fc810f1fa23b0fae2430889c9be4c"
url: "https://github.com/conan-io/cci-sources-backup/raw/main/gsoap/gsoap2-code-r188.zip"
url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap2-code-r188.zip"
"2.8.106":
sha256: "be001b765be9ad2ad0a560d64d84ae10a30a961a2904bfe86f9f57f49a5555d7"
url: "https://github.com/conan-io/cci-sources-backup/raw/main/gsoap/gsoap2-code-r189.zip"
url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap2-code-r189.zip"
13 changes: 8 additions & 5 deletions recipes/gsoap/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ConanFileDefault(ConanFile):
homepage = "https://sourceforge.net/projects/gsoap2"
license = ("gSOAP-1.3b", "GPL-2.0-or-later")
exports_sources = ["CMakeLists.txt", "src/*.cmake", "src/*.txt"]
generators = "cmake"
generators = "cmake", "cmake_find_package"
short_paths = True

_cmake = None
Expand Down Expand Up @@ -44,15 +44,18 @@ def build(self):
cmake.build()

def build_requirements(self):
if tools.os_info.is_windows:
self.build_requires("winflexbison/2.5.22")
if tools.cross_building(self, skip_x64_x86=True) and hasattr(self, 'settings_build'):
self.build_requires("gsoap/{}".format(self.version))

if hasattr(self, "settings_build") and self.settings_build.os == "Windows":
self.build_requires("winflexbison/2.5.24")
else:
self.build_requires("bison/3.5.3")
self.build_requires("bison/3.7.6")
self.build_requires("flex/2.6.4")

def requirements(self):
if self.options.with_openssl:
self.requires("openssl/1.1.1h")
self.requires("openssl/1.1.1l")
self.requires("zlib/1.2.11")

def _configure_cmake(self):
Expand Down
5 changes: 3 additions & 2 deletions recipes/gsoap/all/src/gsoap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ install(TARGETS gsoap++

# Add SSL if requested
if(${WITH_OPENSSL})
find_package(OpenSSL REQUIRED)

target_include_directories(gsoap PRIVATE ${GSOAP_PATH}/gsoap/plugin)
target_compile_definitions(gsoap PUBLIC WITH_OPENSSL WITH_GZIP)
set_target_properties(gsoap PROPERTIES OUTPUT_NAME gsoapssl)
target_link_libraries(gsoap ${CONAN_LIBS})
target_link_libraries(gsoap PUBLIC OpenSSL::OpenSSL)

target_include_directories(gsoap++ PRIVATE ${GSOAP_PATH}/gsoap/plugin)
target_compile_definitions(gsoap++ PUBLIC WITH_OPENSSL WITH_GZIP)
set_target_properties(gsoap++ PROPERTIES OUTPUT_NAME gsoapssl++)
target_link_libraries(gsoap++ ${CONAN_LIBS})
target_link_libraries(gsoap++ PUBLIC OpenSSL::OpenSSL)
endif()
if(${WITH_IPV6})
target_compile_definitions(gsoap PUBLIC WITH_IPV6)
Expand Down
12 changes: 8 additions & 4 deletions recipes/gsoap/all/src/soapcpp2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ add_custom_target(create-generated-folder ALL
if(WIN32)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c
COMMAND ${CONAN_WINFLEXBISON_ROOT}/bin/win_bison.exe -d -v -o ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c ${STDCPP2_PATH}/soapcpp2_yacc.y
COMMAND win_bison.exe -d -v -o ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c ${STDCPP2_PATH}/soapcpp2_yacc.y
COMMENT "Run BISON on soapcpp2"
)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/generated/lex.yy.c
COMMAND ${CONAN_WINFLEXBISON_ROOT}/bin/win_flex.exe -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l
COMMAND win_flex.exe -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l
COMMENT "Run FLEX on soapcpp2"
)

else()
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c
COMMAND ${CONAN_BISON_ROOT}/bin/yacc -d -v -o ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c ${STDCPP2_PATH}/soapcpp2_yacc.y
COMMAND yacc -d -v -o ${CMAKE_BINARY_DIR}/generated/soapcpp2_yacc.tab.c ${STDCPP2_PATH}/soapcpp2_yacc.y
COMMENT "Run YACC on soapcpp2"
)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/generated/lex.yy.c
COMMAND ${CONAN_FLEX_ROOT}/bin/flex -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l
COMMAND flex -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l
COMMENT "Run FLEX on soapcpp2"
)
endif()
Expand All @@ -55,6 +55,10 @@ add_custom_target(FLEXBISON_GENERATORS
add_dependencies(FLEXBISON_GENERATORS create-generated-folder)

add_executable(soapcpp2 ${SRC_CPP})
if(${WITH_OPENSSL})
target_compile_definitions(soapcpp2 PUBLIC WITH_OPENSSL WITH_GZIP)
target_link_libraries(soapcpp2 PUBLIC OpenSSL::OpenSSL)
endif()
target_include_directories(soapcpp2 PRIVATE ${STDCPP2_PATH})
set_source_files_properties(${SRC_CPP} PROPERTIES LANGUAGE C)
add_dependencies(soapcpp2 FLEXBISON_GENERATORS)
Expand Down
13 changes: 11 additions & 2 deletions recipes/gsoap/all/src/wsdl2h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,17 @@ endif()
set_source_files_properties(${SRC_CPP} PROPERTIES LANGUAGE CXX)
set_source_files_properties(${CMAKE_BINARY_DIR}/generated/wsdlC.cpp PROPERTIES GENERATED TRUE)

# Search for soapcpp2 executable
if(CMAKE_CROSSCOMPILING)
find_program(SOAPCPP2_PROGRAM soapcpp2 PATHS ENV PATH NO_DEFAULT_PATH)
endif()
if(NOT SOAPCPP2_PROGRAM)
set(SOAPCPP2_PROGRAM $<TARGET_FILE:soapcpp2>)
endif()

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/generated/wsdlC.cpp
COMMAND $<TARGET_FILE:soapcpp2> -I${GSOAP_PATH}/gsoap/import -SC -pwsdl -d${CMAKE_BINARY_DIR}/generated ${WSDL2H_PATH}/wsdl.h
COMMAND ${SOAPCPP2_PROGRAM} -I${GSOAP_PATH}/gsoap/import -SC -pwsdl -d${CMAKE_BINARY_DIR}/generated ${WSDL2H_PATH}/wsdl.h
COMMENT "Parsing WSDL and Schema definitions"
WORKING_DIRECTORY ${WSDL2H_PATH}
)
Expand All @@ -47,9 +55,10 @@ target_include_directories(wsdl2h
PRIVATE ${WSDL2H_PATH})
add_dependencies(wsdl2h WSDL2H_GENERATORS)
if(${WITH_OPENSSL})
find_package(ZLIB REQUIRED)
target_include_directories(wsdl2h PRIVATE ${GSOAP_PATH}/gsoap/plugin)
target_compile_definitions(wsdl2h PRIVATE WITH_OPENSSL WITH_GZIP)
target_link_libraries(wsdl2h ${CONAN_LIBS})
target_link_libraries(wsdl2h OpenSSL::OpenSSL ZLIB::ZLIB)
endif()

install(TARGETS wsdl2h RUNTIME DESTINATION bin)
15 changes: 8 additions & 7 deletions recipes/gsoap/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ project(gsoap_example CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

add_executable(${PROJECT_NAME}
example.cpp
${CMAKE_BINARY_DIR}/soapC.cpp
${CMAKE_BINARY_DIR}/soapcalcProxy.cpp)

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR} ${GSOAP_INCLUDE_DIR})
find_package(gsoap REQUIRED)

target_link_libraries(${PROJECT_NAME} CONAN_PKG::gsoap)
add_executable(${PROJECT_NAME}
example.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} gsoap::gsoap)
20 changes: 12 additions & 8 deletions recipes/gsoap/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@

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

def build(self):
calc_wsdl = os.path.join(os.path.dirname(__file__), '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)
# TODO: Add some test for the cross-building scenario

cmake = CMake(self)
cmake.configure()
cmake.build()
if not tools.cross_building(self):
calc_wsdl = os.path.join(os.path.dirname(__file__), '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.settings, skip_x64_x86=True):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "gsoap_example")
self.run(bin_path, run_environment=True)
1 change: 1 addition & 0 deletions recipes/gsoap/all/test_package/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ int main()
}
else
{
std::cout << "Cannot sum" << std::endl;
calc.soap_stream_fault(std::cerr);
}
calc.destroy(); // same as: soap_destroy(calc.soap); soap_end(calc.soap);
Expand Down