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
4 changes: 2 additions & 2 deletions .github/actions/build-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
run: |
mkdir build_mac_x64_no_mz
cd build_mac_x64_no_mz
cmake .. -DCMAKE_C_FLAGS="-arch x86_64" -DCMAKE_CXX_FLAGS="-arch x86_64" -DDO_NOT_INCLUDE_MINI_ZIP=true -DCMAKE_INSTALL_PREFIX:PATH=libs -DXERCES_INCLUDE_PATH="../xerces-c/_build_mac_x64/include;../xerces/src" -DXERCES_LIB_PATH="../xerces/_build_mac_x64/lib" -DXERCES_ROOT_PATH="../xerces-c/_build_mac_x64"
cmake .. -DLIB_VERSION_MAJOR=1 -DLIB_VERSION_MINOR=2 -DLIB_VERSION_PATCH=3 -DCMAKE_C_FLAGS="-arch x86_64" -DCMAKE_CXX_FLAGS="-arch x86_64" -DDO_NOT_INCLUDE_MINI_ZIP=true -DCMAKE_INSTALL_PREFIX:PATH=libs -DXERCES_INCLUDE_PATH="../xerces-c/_build_mac_x64/include;../xerces/src" -DXERCES_LIB_PATH="../xerces/_build_mac_x64/lib" -DXERCES_ROOT_PATH="../xerces-c/_build_mac_x64"
make -j
make install
echo Combine into single lib file...
Expand All @@ -65,7 +65,7 @@ runs:
run: |
mkdir build_mac_x64
cd build_mac_x64
cmake .. -DCMAKE_C_FLAGS="-arch x86_64" -DCMAKE_CXX_FLAGS="-arch x86_64" -DCMAKE_INSTALL_PREFIX:PATH=libs -DXERCES_INCLUDE_PATH="../xerces-c/_build_mac_x64/include;../xerces/src" -DXERCES_LIB_PATH="../xerces/_build_mac_x64/lib" -DXERCES_ROOT_PATH="../xerces-c/_build_mac_x64"
cmake .. -DLIB_VERSION_MAJOR=1 -DLIB_VERSION_MINOR=2 -DLIB_VERSION_PATCH=3 -DCMAKE_C_FLAGS="-arch x86_64" -DCMAKE_CXX_FLAGS="-arch x86_64" -DCMAKE_INSTALL_PREFIX:PATH=libs -DXERCES_INCLUDE_PATH="../xerces-c/_build_mac_x64/include;../xerces/src" -DXERCES_LIB_PATH="../xerces/_build_mac_x64/lib" -DXERCES_ROOT_PATH="../xerces-c/_build_mac_x64"
make -j
make install
echo Combine into single lib file...
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
run: |
mkdir build
cd build
cmake .. -DUNITTEST=TRUE -DEXTRA_LIBS="curl;icuuc;icudata;icui18n;icuio" -DXERCES_LIB_PATH="$(pwd)/../../xerces-c/_build/lib/libxerces-c.a"
cmake .. -DLIB_VERSION_MAJOR=1 -DLIB_VERSION_MINOR=2 -DLIB_VERSION_PATCH=3 -DUNITTEST=TRUE -DEXTRA_LIBS="curl;icuuc;icudata;icui18n;icuio" -DXERCES_LIB_PATH="$(pwd)/../../xerces-c/_build/lib/libxerces-c.a"
make -j

- name: Prepare package
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/build-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ runs:
run: |
mkdir build_MD_NO_MZ
cd build_MD_NO_MZ
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=libs -T v142,version=14.29 -DWIN_RUNTIME_LIB=-MD -DXERCES_INCLUDE_PATH="..\xerces-c\build\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c" -DDO_NOT_INCLUDE_MINI_ZIP=TRUE
cmake .. -DLIB_VERSION_MAJOR=1 -DLIB_VERSION_MINOR=2 -DLIB_VERSION_PATCH=3 -DCMAKE_INSTALL_PREFIX:PATH=libs -T v142,version=14.29 -DWIN_RUNTIME_LIB=-MD -DXERCES_INCLUDE_PATH="..\xerces-c\build\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c" -DDO_NOT_INCLUDE_MINI_ZIP=TRUE
ren MvrGdtf.vcxproj MvrGdtf_ORG.vcxproj

# libMVRGdtf - build Debug
Expand Down Expand Up @@ -139,7 +139,7 @@ runs:
run: |
mkdir build_MD
cd build_MD
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=libs -T v142,version=14.29 -DWIN_RUNTIME_LIB=-MD -DXERCES_INCLUDE_PATH="..\xerces-c\build\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c\build"
cmake .. -DLIB_VERSION_MAJOR=1 -DLIB_VERSION_MINOR=2 -DLIB_VERSION_PATCH=3 -DCMAKE_INSTALL_PREFIX:PATH=libs -T v142,version=14.29 -DWIN_RUNTIME_LIB=-MD -DXERCES_INCLUDE_PATH="..\xerces-c\build\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c\build"
ren MvrGdtf.vcxproj MvrGdtf_ORG.vcxproj

# libMVRGdtf - build Debug
Expand Down Expand Up @@ -189,7 +189,7 @@ runs:
run: |
mkdir build_MT
cd build_MT
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=libs -T v142,version=14.29 -DWIN_RUNTIME_LIB=-MT -DXERCES_INCLUDE_PATH="..\xerces-c\build_mt\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build_mt\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c\build_mt"
cmake .. -DLIB_VERSION_MAJOR=1 -DLIB_VERSION_MINOR=2 -DLIB_VERSION_PATCH=3 -DCMAKE_INSTALL_PREFIX:PATH=libs -T v142,version=14.29 -DWIN_RUNTIME_LIB=-MT -DXERCES_INCLUDE_PATH="..\xerces-c\build_mt\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build_mt\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c\build_mt"
ren MvrGdtf.vcxproj MvrGdtf_ORG.vcxproj

# libMVRGdtf - build Debug
Expand Down
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if(${BUILD_MVR_XCHANGE_EXAMPLE} AND ${DO_NOT_INCLUDE_MINI_ZIP} AND NOT ${BUILD_M
message( FATAL_ERROR "MVRXChange example must be linked against Mini Zip and boost" )
endif()


set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#################################################
Expand Down Expand Up @@ -61,6 +62,17 @@ project(MvrGdtf)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Require version variables to be set by the user
if(NOT DEFINED LIB_VERSION_MAJOR)
message(FATAL_ERROR "You must define LIB_VERSION_MAJOR when building the library.")
endif()
if(NOT DEFINED LIB_VERSION_MINOR)
message(FATAL_ERROR "You must define LIB_VERSION_MINOR when building the library.")
endif()
if(NOT DEFINED LIB_VERSION_PATCH)
message(FATAL_ERROR "You must define LIB_VERSION_PATCH when building the library.")
endif()



# Set output dir
Expand Down Expand Up @@ -168,10 +180,21 @@ endif(WIN32)
# Add the preprocessors
# Link extra libs
target_compile_definitions(MvrGdtf ${PREPROCESSORS})
target_compile_definitions(MvrGdtf PRIVATE
LIB_VERSION_MAJOR=${LIB_VERSION_MAJOR}
LIB_VERSION_MINOR=${LIB_VERSION_MINOR}
LIB_VERSION_PATCH=${LIB_VERSION_PATCH}
)

target_link_libraries(MvrGdtf ${EXTRA_LIBS})

if(${UNITTEST})
target_compile_definitions(MvrGdtfUnitTest ${PREPROCESSORS})
target_compile_definitions(MvrGdtfUnitTest PRIVATE
LIB_VERSION_MAJOR=${LIB_VERSION_MAJOR}
LIB_VERSION_MINOR=${LIB_VERSION_MINOR}
LIB_VERSION_PATCH=${LIB_VERSION_PATCH}
)
target_link_libraries(MvrGdtfUnitTest ${EXTRA_LIBS})

#Append Runtime
Expand Down
11 changes: 11 additions & 0 deletions src/Implementation/CMediaRessourceVectorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1582,5 +1582,16 @@ VectorworksMVR::VCOMError VectorworksMVR::CMediaRessourceVectorImpl::GetSceneObj
VectorworksMVR::VCOMError VectorworksMVR::CMediaRessourceVectorImpl::GetDuplicatedUuids(bool& outDuplicated)
{
outDuplicated = fExchangeObj.GetDuplicatedUuids();
return kVCOMError_NoError;
}

VectorworksMVR::VCOMError VectorworksMVR::CMediaRessourceVectorImpl::GetLibVersion( MvrString& outVersion )
{
// Get the version from the exchange object
TXString version = fExchangeObj.GetLibVersion();

// Set the out value
outVersion = version.GetCharPtr();

return kVCOMError_NoError;
}
2 changes: 2 additions & 0 deletions src/Implementation/CMediaRessourceVectorImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@ namespace VectorworksMVR
// Check for duplicated uuids
virtual VCOMError VCOM_CALLTYPE GetDuplicatedUuids(bool& outDuplicated);

virtual VCOMError VCOM_CALLTYPE GetLibVersion( MvrString& outVersion );

};
}
3 changes: 3 additions & 0 deletions src/Include/IMediaRessourceVectorInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ namespace VectorworksMVR
//----------------------------------------------------------------------------------------
// methods to write a file
public:

virtual VCOMError VCOM_CALLTYPE GetLibVersion( MvrString& outVersion ) = 0;

// Call this at the start of generating a MVR file
virtual VCOMError VCOM_CALLTYPE OpenForWrite(MvrString fullPath) = 0;
virtual VCOMError VCOM_CALLTYPE AddGdtfFolderLocation(MvrString fullPathToFolder) = 0;
Expand Down
10 changes: 10 additions & 0 deletions src/Prefix/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
#pragma warning( disable : 4800)
#endif // _WINDOWS

#ifndef LIB_VERSION_MAJOR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about it? From my point of view, this version should be defined in library source code and not over build system. We sharing source code and for example at MA we use our own scripts for building library.

In the end of the day source code of library should define a version and not a build system, otherwise you can have different implementation with same version,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AndriiVoitenko,
I think you are right also, but I think building the lib using the Github action is much more easier and cleaner. Something that we can to is to add a documentation how to build the lib easy manual. This is something that we can discuss more.

Copy link
Collaborator

@AndriiVoitenko AndriiVoitenko Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adragnevVW,

you understand, that currently you defined same information in 3 different places. With this changes, if you need to change version, you need to change 3 yaml files. And semantic version rules are applied to the source code and are independent from build system.

You are right, building library with a yml file is pretty simple, if you build only library, but if you need to integrate it into a product and build this library over the product tool chain, then it will be not so easy.

By the way, check your ubuntu yml file:
image

and xerces is not needed at least for linux implementation.

#error "LIB_VERSION_MAJOR must be defined by the build system"
#endif
#ifndef LIB_VERSION_MINOR
#error "LIB_VERSION_MINOR must be defined by the build system"
#endif
#ifndef LIB_VERSION_PATCH
#error "LIB_VERSION_PATCH must be defined by the build system"
#endif

#include "GSTypes.h"
#include "CommonPrefix.h"
#include "Include/VectorworksMVR.h"
Expand Down
12 changes: 12 additions & 0 deletions src/SceneDataExchange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4131,4 +4131,16 @@ bool SceneDataExchange::GetDuplicatedUuids() const
return fDuplicatedUuids;
}

MvrString SceneDataExchange::GetLibVersion() const
{
size_t majorVersion = LIB_VERSION_MAJOR;
size_t minorVersion = LIB_VERSION_MINOR;
size_t patchVersion = LIB_VERSION_PATCH;

TXString version = TXString(std::to_string(majorVersion).c_str()) + "." + TXString(std::to_string(minorVersion).c_str()) + "." + TXString(std::to_string(patchVersion).c_str());

MvrString libVersion = version.GetCharPtr();

return libVersion;
}

5 changes: 4 additions & 1 deletion src/SceneDataExchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,10 @@ namespace SceneData
void ReadChildObjs(const IXMLFileNodePtr & node, SceneDataGroupObjPtr addToContainer);
SceneDataGroupObjPtr ProcessGroup(const IXMLFileNodePtr& node, SceneDataGroupObjPtr addToContainer);


// ---------------------------------------------------------------------------------------------------------------------
// Lib Version
public:
MvrString GetLibVersion() const;

};

Expand Down
Loading