@@ -60,7 +60,7 @@ IF(NOT IS_ABSOLUTE ${LIBDIR})
6060ENDIF ()
6161MESSAGE (STATUS "LIBDIR: ${LIBDIR} " )
6262
63- set (IFCDIRS "" ) # for *nix rpaths
63+ set (IFCOPENSHELL_LIBARY_DIR "" ) # for *nix rpaths
6464
6565if (BUILD_SHARED_LIBS )
6666 add_definitions (-DBUILD_SHARED_LIBS )
@@ -70,7 +70,7 @@ if (BUILD_SHARED_LIBS)
7070 # There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
7171 add_definitions (-wd4251 )
7272 endif ()
73- set (IFCDIRS "${LIBDIR} " )
73+ set (IFCOPENSHELL_LIBARY_DIR "${LIBDIR} " )
7474endif ()
7575
7676# Create cache entries if absent for environment variables
@@ -432,8 +432,7 @@ if(NOT WIN32)
432432 LINK_DIRECTORIES (${LINK_DIRECTORIES} /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 )
433433endif ()
434434
435- SET (IFCLIBS "" )
436- SET (IFCBINS "" )
435+ SET (IFCOPENSHELL_LIBRARIES IfcParse IfcGeom)
437436
438437# IfcParse
439438file (GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h )
@@ -449,16 +448,7 @@ endforeach()
449448
450449set (IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES} )
451450
452- if (BUILD_SHARED_LIBS )
453- add_library (IfcParse SHARED ${IFCPARSE_FILES} )
454- set (IFCBINS "${IFCBINS} ;IfcParse" )
455- if (MSVC )
456- set (IFCLIBS "${IFCLIBS} ;IfcParse" ) # import lib for the DLL
457- endif ()
458- else ()
459- add_library (IfcParse STATIC ${IFCPARSE_FILES} )
460- set (IFCLIBS "${IFCLIBS} ;IfcParse" )
461- endif ()
451+ add_library (IfcParse ${IFCPARSE_FILES} )
462452set_target_properties (IfcParse PROPERTIES COMPILE_FLAGS -DIfcParse_EXPORTS )
463453
464454IF (UNICODE_SUPPORT)
@@ -470,17 +460,10 @@ file(GLOB IFCGEOM_H_FILES ../src/ifcgeom/*.h)
470460file (GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/*.cpp )
471461set (IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} )
472462IF (BUILD_SHARED_LIBS )
473- if (MSVC )
474- message (WARNING "Building IfcGeom as DLL not currently supported on Windows/MSVC!" )
463+ message (WARNING "Building IfcGeom as shared library not currently supported" )
475464 add_library (IfcGeom STATIC ${IFCGEOM_FILES} )
476- set (IFCLIBS "${IFCLIBS} ;IfcGeom" )
477- else ()
478- add_library (IfcGeom SHARED ${IFCGEOM_FILES} )
479- set (IFCBINS "${IFCBINS} ;IfcGeom" )
480- endif ()
481465ELSE ()
482- ADD_LIBRARY (IfcGeom STATIC ${IFCGEOM_FILES} )
483- set (IFCLIBS "${IFCLIBS} ;IfcGeom" )
466+ add_library (IfcGeom ${IFCGEOM_FILES} )
484467ENDIF ()
485468
486469TARGET_LINK_LIBRARIES (IfcGeom IfcParse )
@@ -493,7 +476,6 @@ ADD_EXECUTABLE(IfcConvert ${IFCCONVERT_FILES})
493476if (IFCCONVERT_DOUBLE_PRECISION)
494477 set_target_properties (IfcConvert PROPERTIES COMPILE_FLAGS -DIFCCONVERT_DOUBLE_PRECISION )
495478endif ()
496- set (IFCBINS "${IFCBINS} ;IfcConvert" )
497479
498480# Make sure cross-referenced symbols between static OCC libraries get
499481# resolved. Also add thread and rt libraries.
@@ -506,21 +488,20 @@ if("${libTKernelExt}" STREQUAL ".a")
506488 set (OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LIB_RT} dl)
507489endif ()
508490
509- TARGET_LINK_LIBRARIES (IfcConvert ${IFCLIBS } ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${ICU_LIBRARIES} )
491+ TARGET_LINK_LIBRARIES (IfcConvert ${IFCOPENSHELL_LIBRARIES } ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${ICU_LIBRARIES} )
510492if (NOT WIN32 )
511- SET_INSTALL_RPATHS (IfcConvert "${IFCDIRS } ;${OCC_LIBRARY_DIR} ;${Boost_LIBRARY_DIRS} ;${OPENCOLLADA_LIBRARY_DIR} ;${ICU_LIBRARY_DIR} " )
493+ SET_INSTALL_RPATHS (IfcConvert "${IFCOPENSHELL_LIBARY_DIR } ;${OCC_LIBRARY_DIR} ;${Boost_LIBRARY_DIRS} ;${OPENCOLLADA_LIBRARY_DIR} ;${ICU_LIBRARY_DIR} " )
512494endif ()
513495
514496# IfcGeomServer
515497file (GLOB CPP_FILES ../src/ifcgeomserver/*.cpp )
516498file (GLOB H_FILES ../src/ifcgeomserver/*.h )
517499set (SOURCE_FILES ${CPP_FILES} ${H_FILES} )
518500ADD_EXECUTABLE (IfcGeomServer ${SOURCE_FILES} )
519- TARGET_LINK_LIBRARIES (IfcGeomServer ${IFCLIBS } ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${ICU_LIBRARIES} )
501+ TARGET_LINK_LIBRARIES (IfcGeomServer ${IFCOPENSHELL_LIBRARIES } ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${ICU_LIBRARIES} )
520502if (NOT WIN32 )
521- SET_INSTALL_RPATHS (IfcGeomServer "${IFCDIRS } ;${OCC_LIBRARY_DIR} ;${Boost_LIBRARY_DIRS} ;${ICU_LIBRARY_DIR} " )
503+ SET_INSTALL_RPATHS (IfcGeomServer "${IFCOPENSHELL_LIBARY_DIR } ;${OCC_LIBRARY_DIR} ;${Boost_LIBRARY_DIRS} ;${ICU_LIBRARY_DIR} " )
522504endif ()
523- set (IFCBINS "${IFCBINS} ;IfcGeomServer" )
524505
525506IF (BUILD_IFCPYTHON)
526507 ADD_SUBDIRECTORY (../src/ifcwrap ifcwrap )
@@ -535,7 +516,16 @@ IF(BUILD_IFCMAX)
535516ENDIF ()
536517
537518# CMake installation targets
538- INSTALL (FILES ${IFCPARSE_H_FILES} DESTINATION ${INCLUDEDIR} /ifcparse)
539- INSTALL (FILES ${IFCGEOM_H_FILES} DESTINATION ${INCLUDEDIR} /ifcgeom)
540- INSTALL (TARGETS ${IFCBINS} RUNTIME DESTINATION ${BINDIR} )
541- INSTALL (TARGETS ${IFCLIBS} ARCHIVE DESTINATION ${LIBDIR} )
519+ INSTALL (FILES ${IFCPARSE_H_FILES}
520+ DESTINATION ${INCLUDEDIR} /ifcparse
521+ )
522+
523+ INSTALL (FILES ${IFCGEOM_H_FILES}
524+ DESTINATION ${INCLUDEDIR} /ifcgeom
525+ )
526+
527+ INSTALL (TARGETS IfcParse IfcGeom IfcConvert IfcGeomServer
528+ ARCHIVE DESTINATION ${LIBDIR}
529+ LIBRARY DESTINATION ${LIBDIR}
530+ RUNTIME DESTINATION ${BINDIR}
531+ )
0 commit comments