Skip to content
Closed
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
5 changes: 4 additions & 1 deletion recipes/gsoap/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def _build_subfolder(self):
'with_cookies': True,
'with_c_locale': True}


def source(self):
tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)

Expand All @@ -49,6 +48,8 @@ def build_requirements(self):
else:
self.build_requires("bison/3.5.3")
self.build_requires("flex/2.6.4")
if hasattr(self, "settings_build") and tools.cross_building(self):
self.build_requires("gsoap/{}".format(self.version))

def requirements(self):
if self.options.with_openssl:
Expand All @@ -59,8 +60,10 @@ def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)

self._cmake.definitions["GSOAP_PATH"] = self._source_subfolder
self._cmake.definitions["BUILD_TOOLS"] = True
# not self._cross_building()
self._cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl
self._cmake.definitions["WITH_IPV6"] = self.options.with_ipv6
self._cmake.definitions["WITH_COOKIES"] = self.options.with_cookies
Expand Down
8 changes: 6 additions & 2 deletions recipes/gsoap/all/src/soapcpp2.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# Generate project for soapcpp2 executable


set(STDCPP2_PATH ${CMAKE_SOURCE_DIR}/${GSOAP_PATH}/gsoap/src)

set(SRC_CPP
Expand Down Expand Up @@ -33,15 +34,18 @@ if(WIN32)
)

else()
find_program(_Flex_EXECUTABLE flex PATHS ENV PATH NO_DEFAULT_PATH)
find_program(_Yacc_EXECUTABLE yacc PATHS ENV PATH NO_DEFAULT_PATH)

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_EXECUTABLE} -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_EXECUTABLE} -o ${CMAKE_BINARY_DIR}/generated/lex.yy.c ${STDCPP2_PATH}/soapcpp2_lex.l
COMMENT "Run FLEX on soapcpp2"
)
endif()
Expand Down
7 changes: 6 additions & 1 deletion recipes/gsoap/all/src/wsdl2h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ endif()
set_source_files_properties(${SRC_CPP} PROPERTIES LANGUAGE CXX)
set_source_files_properties(${CMAKE_BINARY_DIR}/generated/wsdlC.cpp PROPERTIES GENERATED TRUE)

if (CMAKE_CROSSCOMPILING)
find_program(_soapCPP2_EXECUTABLE soapcpp2 PATHS ENV PATH NO_DEFAULT_PATH)
else()
set(_soapCPP2_EXECUTABLE $<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_EXECUTABLE} -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 Down
4 changes: 4 additions & 0 deletions recipes/gsoap/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ class TestGsoapConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def build_requirements(self):
if hasattr(self, "settings_build") and tools.cross_building(self):
self.build_requires(str(self.requires['gsoap']))

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)
Expand Down