Skip to content

Commit

Permalink
Merge pull request #42 from DeerSoftDevelopment/master
Browse files Browse the repository at this point in the history
Allow to build without boost
  • Loading branch information
moritzstaffel authored Jan 22, 2024
2 parents 2dd79d9 + 0d32c1e commit be85429
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
26 changes: 21 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ set(WIN_RUNTIME_LIB "-MD" CACHE STRING "Set '-MD' or '-MT' for windows build")
set(DO_NOT_INCLUDE_MINI_ZIP FALSE CACHE BOOL "Set whether or not we include the minzip lib")
set(BUILD_MVR_XCHANGE_EXAMPLE FALSE CACHE BOOL "Whether to or not to build the MVRXChange example. Mutually exclusive with DO_NOT_INCLUDE_MINI_ZIP")
set(DONT_USE_XERCES_AS_XMLLIB FALSE CACHE BOOL "Set whether or we use Xerces or tinyXML as xml lib")
set(BUILD_MVR_XCHANGE TRUE CACHE BOOL "Set whether to include MVR_XChange in the build (requires boost)")

set(XERCES_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../xerces-c CACHE STRING "Set the build path where you called cmake.")
set(XERCES_INCLUDE_PATH ${XERCES_ROOT_PATH}/src ${XERCES_ROOT_PATH}/build/src CACHE STRING "Set the include path")

if (${BUILD_MVR_XCHANGE} OR DEFINED ENV{BUILD_MVR_XCHANGE})
add_compile_definitions(BUILD_MVR_XCHANGE)
endif()

if (${DONT_USE_XERCES_AS_XMLLIB} OR DEFINED ENV{DONT_USE_XERCES_AS_XMLLIB})
add_compile_definitions(DONT_USE_XERCES_AS_XMLLIB)
else()
Expand All @@ -21,8 +26,8 @@ else()
endif(WIN32)
endif()

if(${BUILD_MVR_XCHANGE_EXAMPLE} AND ${DO_NOT_INCLUDE_MINI_ZIP})
message( FATAL_ERROR "MVRXChange example must be linked against Mini Zip" )
if(${BUILD_MVR_XCHANGE_EXAMPLE} AND ${DO_NOT_INCLUDE_MINI_ZIP} AND NOT ${BUILD_MVR_XCHANGE})
message( FATAL_ERROR "MVRXChange example must be linked against Mini Zip and boost" )
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down Expand Up @@ -65,10 +70,13 @@ if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/../boost/
${CMAKE_CURRENT_SOURCE_DIR}/mdns_cpp/include/
${XERCES_INCLUDE_PATH})

if(BUILD_MVR_XCHANGE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../boost/
${CMAKE_CURRENT_SOURCE_DIR}/mdns_cpp/include/)
endif()

# default values
# those can be removed probably
set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
Expand All @@ -82,13 +90,21 @@ set(SRC_TESTDIR ${CMAKE_CURRENT_SOURCE_DIR}/unittest)
#################################################
# Add libMvrGdtf lib
file(GLOB_RECURSE libSourceFiles ${SRCDIR}/*.cpp)

if(NOT ${BUILD_MVR_XCHANGE})
list(FILTER libSourceFiles EXCLUDE REGEX ".*/mvrxchange/.*")
endif()

add_library(MvrGdtf STATIC ${libSourceFiles})

if (NOT ${DONT_USE_XERCES_AS_XMLLIB} AND NOT DEFINED ENV{DONT_USE_XERCES_AS_XMLLIB})
target_link_libraries(MvrGdtf ${XERCES_LIB_PATH})
endif()

target_link_libraries(MvrGdtf mdns_cpp)

if(${BUILD_MVR_XCHANGE})
target_link_libraries(MvrGdtf mdns_cpp)
endif()
#################################################


Expand Down
4 changes: 3 additions & 1 deletion src/Include/IMediaRessourceVectorInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,8 @@ class DYNAMIC_ATTRIBUTE IGdtfMacro : public IVWUnknown
}
};

#ifdef BUILD_MVR_XCHANGE

class DYNAMIC_ATTRIBUTE IMVRxchangeService : public IVWUnknown
{
public:
Expand Down Expand Up @@ -1996,5 +1998,5 @@ class DYNAMIC_ATTRIBUTE IGdtfMacro : public IVWUnknown
typedef VCOMPtr<IMVRxchangeService> IMVRxchangeServicePtr;
const VWIID IID_IMVRxchangeService = { 0x706cb180, 0xcd45, 0x4a9a, {0xac, 0xfc, 0x62, 0xab, 0x5f, 0xfe, 0x37, 0x6b}};


#endif // BUILD_MVR_XCHANGE
}
8 changes: 6 additions & 2 deletions src/ModuleMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@
#include "Implementation/CGdtfPinPatch.h"
#include "Implementation/CGdtfSubPhysicalUnit.h"
#include "Implementation/CGdtfGamut.h"
#include "Implementation/CMVRxchangeService.h"

#ifdef BUILD_MVR_XCHANGE
// not in Implementation folder, so it can be switched off easily
#include "mvrxchange/CMVRxchangeService.h"
#endif

// XML
#include "XMLLib/XMLFileNodeImpl.h"
Expand Down Expand Up @@ -228,9 +231,10 @@ extern "C" VectorworksMVR::VCOMError VWQueryInterface(const VectorworksMVR::VWII
resultInterface = new CGdtfPinPatchImpl();
else if (iid == VectorworksMVR::IID_GdtfSubPhysicalUnit)
resultInterface = new CGdtfSubPhysicalUnitImpl();
#ifdef BUILD_MVR_XCHANGE
else if (iid == VectorworksMVR::IID_IMVRxchangeService)
resultInterface = new CMVRxchangeServiceImpl();

#endif
// determine the result values
VCOMError result = kVCOMError_Failed;
if ( outInterface == nullptr )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//-----------------------------------------------------------------------------
//----- Copyright deersoft 2015 - 2017 www.deersoft.de
//-----------------------------------------------------------------------------
#include "Prefix/StdAfx.h"
#include "../Prefix/StdAfx.h"
#include "CMVRxchangeService.h"
#include "../mvrxchange/mvrxchange_prefix.h"
#include "../mvrxchange/mvrxchange_client.h"
#include "XmlFileHelper.h"
#include "../XmlFileHelper.h"
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <unordered_map>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/mvrxchange/mvrxchange_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//-----------------------------------------------------------------------------

#include "mvrxchange_client.h"
#include "Implementation/CMVRxchangeService.h"
#include "CMVRxchangeService.h"

using namespace MVRxchangeNetwork;

Expand Down
2 changes: 1 addition & 1 deletion src/mvrxchange/mvrxchange_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "mvrxchange_prefix.h"
#include "mvrxchange_session.h"
#include "Implementation/CMVRxchangeService.h"
#include "CMVRxchangeService.h"


using namespace MVRxchangeNetwork;
Expand Down

0 comments on commit be85429

Please sign in to comment.