Skip to content

Commit

Permalink
Add xerces (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Aug 24, 2021
1 parent 4b1ee3b commit f58927f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
2 changes: 1 addition & 1 deletion 3rdParty
Submodule 3rdParty updated 893 files
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif

# use cmake from above if is set, otherwise cmake
ifeq ($(CMAKE),)
CMAKE=CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" cmake
CMAKE=cmake
endif

# Should we install everything into the OMBUILDDIR?
Expand All @@ -97,9 +97,7 @@ ifeq ($(detected_OS),Darwin)
EXTRA_CMAKE=-DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="`pwd`/$(TOP_INSTALL_DIR)/lib/$(HOST_SHORT_OMC)"
endif

ifeq ($(CROSS_TRIPLE),)
CMAKE=cmake $(CMAKE_TARGET)
else
ifneq ($(CROSS_TRIPLE),)
LUA_EXTRA_FLAGS=CC=$(CC) CXX=$(CXX) RANLIB=$(CROSS_TRIPLE)-ranlib detected_OS=$(detected_OS)
OMTLM := OFF
LIBXML2 := OFF
Expand All @@ -108,7 +106,6 @@ else
FMIL_FLAGS ?=
AR ?= $(CROSS_TRIPLE)-ar
RANLIB ?= $(CROSS_TRIPLE)-ranlib
CMAKE=cmake $(CMAKE_TARGET)
ifeq (MINGW,$(findstring MINGW,$(detected_OS)))
CMAKE_TARGET=-G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=$(CROSS_TRIPLE)-windres
endif
Expand All @@ -123,7 +120,7 @@ else
CMAKE_BOOST_ROOT="-DBOOST_ROOT=$(BOOST_ROOT)"
endif

.PHONY: OMSimulator OMSimulatorCore config-OMSimulator config-fmil config-lua config-minizip config-cvode config-kinsol config-3rdParty distclean testsuite doc doc-html doc-doxygen OMTLMSimulator OMTLMSimulatorClean RegEx pip
.PHONY: OMSimulator OMSimulatorCore config-OMSimulator config-fmil config-lua config-minizip config-cvode config-kinsol config-xerces config-3rdParty distclean testsuite doc doc-html doc-doxygen OMTLMSimulator OMTLMSimulatorClean RegEx pip

OMSimulator:
@echo OS: $(detected_OS)
Expand Down Expand Up @@ -195,7 +192,7 @@ RegEx: 3rdParty/RegEx/OMSRegEx$(EEXT)
@echo "Please checkout the 3rdParty submodule, e.g. using \"git submodule update --init 3rdParty\", and try again."
@false

config-3rdParty: 3rdParty/README.md config-fmil config-lua config-minizip config-cvode config-kinsol config-libxml2
config-3rdParty: 3rdParty/README.md config-fmil config-lua config-minizip config-cvode config-kinsol config-libxml2 config-xerces

config-OMSimulator: $(BUILD_DIR)/Makefile
$(BUILD_DIR)/Makefile: RegEx CMakeLists.txt
Expand Down Expand Up @@ -254,6 +251,16 @@ config-kinsol: 3rdParty/kinsol/$(INSTALL_DIR)/lib/libsundials_kinsol.a
$(MKDIR) 3rdParty/kinsol/$(BUILD_DIR)
cd 3rdParty/kinsol/$(BUILD_DIR) && $(CMAKE) $(CMAKE_TARGET) ../.. -DCMAKE_INSTALL_PREFIX=../../$(INSTALL_DIR) -DEXAMPLES_ENABLE:BOOL=0 -DBUILD_SHARED_LIBS:BOOL=0 $(CMAKE_FPIC)

config-xerces: 3rdParty/xerces/$(INSTALL_DIR)/lib/libxerces-c.a
3rdParty/xerces/$(INSTALL_DIR)/lib/libxerces-c.a: 3rdParty/xerces/$(BUILD_DIR)/Makefile
$(MAKE) -C 3rdParty/xerces/$(BUILD_DIR)/ install
3rdParty/xerces/$(BUILD_DIR)/Makefile: 3rdParty/xerces/CMakeLists.txt
@echo
@echo "# config xerces"
@echo
$(MKDIR) 3rdParty/xerces/$(BUILD_DIR)
cd 3rdParty/xerces/$(BUILD_DIR) && $(CMAKE) $(CMAKE_TARGET) ../.. -DCMAKE_INSTALL_PREFIX=../../$(INSTALL_DIR) -DBUILD_SHARED_LIBS:BOOL=OFF

ifeq ($(LIBXML2),OFF)
config-libxml2:
@echo
Expand Down Expand Up @@ -286,6 +293,8 @@ distclean:
$(RM) 3rdParty/cvode/$(INSTALL_DIR)
$(RM) 3rdParty/kinsol/$(BUILD_DIR)
$(RM) 3rdParty/kinsol/$(INSTALL_DIR)
$(RM) 3rdParty/xerces/$(BUILD_DIR)
$(RM) 3rdParty/xerces/$(INSTALL_DIR)

testsuite:
@echo
Expand Down
20 changes: 20 additions & 0 deletions configWinVS.bat
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ IF ["%TARGET%"]==["lua"] GOTO lua
IF ["%TARGET%"]==["minizip"] GOTO minizip
IF ["%TARGET%"]==["cvode"] GOTO cvode
IF ["%TARGET%"]==["kinsol"] GOTO kinsol
IF ["%TARGET%"]==["xerces"] GOTO xerces
IF ["%TARGET%"]==["pthread"] GOTO pthread
IF ["%TARGET%"]==["libxml2"] GOTO libxml2
IF ["%TARGET%"]==["boost"] GOTO boost
Expand Down Expand Up @@ -168,6 +169,23 @@ EXIT /B 0
:: -- config kinsol -------------------


:: -- config xerces -------------------
:xerces
ECHO # config xerces
IF EXIST "3rdParty\xerces\build\win\" RMDIR /S /Q 3rdParty\xerces\build\win
IF EXIST "3rdParty\xerces\install\win\" RMDIR /S /Q 3rdParty\xerces\install\win
MKDIR 3rdParty\xerces\build\win
CD 3rdParty\xerces\build\win
cmake.exe -G %OMS_VS_VERSION% ..\.. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX=..\..\install\win -DBUILD_SHARED_LIBS:BOOL=OFF
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
CD ..\..\..\..
ECHO # build xerces
msbuild.exe "3rdParty\xerces\build\win\INSTALL.vcxproj" /t:Build /p:configuration=Release /maxcpucount
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
EXIT /B 0
:: -- config xerces -------------------


:: -- pthread -------------------------
:pthread
ECHO # config pthread
Expand Down Expand Up @@ -242,6 +260,8 @@ START /B /WAIT CMD /C "%~0 %OMS_VS_TARGET% cvode"
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
START /B /WAIT CMD /C "%~0 %OMS_VS_TARGET% kinsol"
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
START /B /WAIT CMD /C "%~0 %OMS_VS_TARGET% xerces"
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
START /B /WAIT CMD /C "%~0 %OMS_VS_TARGET% pthread"
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
START /B /WAIT CMD /C "%~0 %OMS_VS_TARGET% libxml2"
Expand Down

0 comments on commit f58927f

Please sign in to comment.