Merge pull request #97 from aothms/dynamic_lib_fixes_2

Dynamic lib fixes
This commit is contained in:
Thomas Krijnen
2016-06-22 14:57:16 +02:00
committed by GitHub
3 changed files with 17 additions and 8 deletions
+13 -5
View File
@@ -432,7 +432,11 @@ if(NOT WIN32)
LINK_DIRECTORIES(${LINK_DIRECTORIES} /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64) LINK_DIRECTORIES(${LINK_DIRECTORIES} /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
endif() endif()
SET(IFCOPENSHELL_LIBRARIES IfcParse IfcGeom) if(BUILD_SHARED_LIBS)
SET(IFCOPENSHELL_LIBRARIES IfcGeom)
else()
SET(IFCOPENSHELL_LIBRARIES IfcParse IfcGeom)
endif()
# IfcParse # IfcParse
file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h) file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h)
@@ -459,13 +463,17 @@ ENDIF()
file(GLOB IFCGEOM_H_FILES ../src/ifcgeom/*.h) file(GLOB IFCGEOM_H_FILES ../src/ifcgeom/*.h)
file(GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/*.cpp) file(GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/*.cpp)
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES}) set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES})
IF(BUILD_SHARED_LIBS) IF(BUILD_SHARED_LIBS)
message(WARNING "Building IfcGeom as shared library not currently supported") message(WARNING "Building IfcGeom as shared library currently not supported depending on platform and compiler options")
add_library(IfcGeom STATIC ${IFCGEOM_FILES})
ELSE()
add_library(IfcGeom ${IFCGEOM_FILES})
ENDIF() ENDIF()
if(WIN32)
add_library(IfcGeom STATIC ${IFCGEOM_FILES})
else()
add_library(IfcGeom ${IFCGEOM_FILES})
endif()
TARGET_LINK_LIBRARIES(IfcGeom IfcParse) TARGET_LINK_LIBRARIES(IfcGeom IfcParse)
# IfcConvert # IfcConvert
+2 -1
View File
@@ -28,7 +28,8 @@ LINK_DIRECTORIES(${LINK_DIRECTORIES} ${IfcOpenShell_BINARY_DIR} ${OCC_LIBRARY_DI
ADD_LIBRARY(IfcMax SHARED IfcMax.h IfcMax.cpp) ADD_LIBRARY(IfcMax SHARED IfcMax.h IfcMax.cpp)
TARGET_LINK_LIBRARIES(IfcMax ${IFCLIBS} Comctl32.lib zlibdll.lib bmm.lib core.lib CustDlg.lib edmodel.lib expr.lib # TODO: find the minimal subset of 3dsmax libraries to reference
TARGET_LINK_LIBRARIES(IfcMax ${IFCOPENSHELL_LIBRARIES} Comctl32.lib zlibdll.lib bmm.lib core.lib CustDlg.lib edmodel.lib expr.lib
flt.lib geom.lib gfx.lib gup.lib imageViewers.lib ManipSys.lib maxnet.lib Maxscrpt.lib flt.lib geom.lib gfx.lib gup.lib imageViewers.lib ManipSys.lib maxnet.lib Maxscrpt.lib
maxutil.lib MenuMan.lib menus.lib mesh.lib MNMath.lib Paramblk2.lib particle.lib Poly.lib RenderUtil.lib maxutil.lib MenuMan.lib menus.lib mesh.lib MNMath.lib Paramblk2.lib particle.lib Poly.lib RenderUtil.lib
tessint.lib viewfile.lib ${OPENCASCADE_LIBRARIES} tessint.lib viewfile.lib ${OPENCASCADE_LIBRARIES}
+2 -2
View File
@@ -560,9 +560,9 @@ double TokenFunc::asFloat(const Token& t) {
const std::string &TokenFunc::asStringRef(const Token& t) { const std::string &TokenFunc::asStringRef(const Token& t) {
std::string &str = t.lexer->GetTempString(); std::string &str = t.lexer->GetTempString();
t.lexer->TokenString(t.startPos, str); t.lexer->TokenString(t.startPos, str);
if (isString(t) || isEnumeration(t) || isBinary(t)) { if ((isString(t) || isEnumeration(t) || isBinary(t)) && !str.empty()) {
//remove start+end characters in-place //remove start+end characters in-place
str.pop_back(); str.erase(str.end()-1);
str.erase(str.begin()); str.erase(str.begin());
} }
return str; return str;