For researching DXF import possibilities I started with DXFLib.

To get started:

  1. download DXFLib from Ribbonsoft
  2. create the following directories dxflib, dxflib\src, dxflib\build
  3. unpack the downloaded archive into dxflib\src
  4. DXFLib comes with support for the standard UNIX toolchain. You can use the following CMakeFiles:
  5. For the base directory
    # build the dxflib project
    
    PROJECT(DXFLib)
    CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
    
    IF(WIN32)
    	SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi  /Ob0 /Od /RTC1" CACHE 
    	    STRING "Flags used by the compiler during debug builds" FORCE)
    	SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG" CACHE 
    	    STRING "Flags used by the compiler during release minumum size builds" FORCE)
    	SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG" CACHE 
    	    STRING "Flags used by the compiler during release builds" FORCE)
    	SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG" CACHE 
    	    STRING "Flags used by the compiler during release with debug info builds" FORCE)
    
    	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
    ENDIF(WIN32)
    
    # build the library
    ADD_SUBDIRECTORY(src)
    
    # build the test program
    ADD_SUBDIRECTORY(test)

  6. For the src directory
    # build dxflib
    
    FILE(GLOB HEADERS *.h)
    
    SET(SRCS 
    	dl_dxf.cpp 
    	dl_writer_ascii.cpp 
    	)
    
    ADD_LIBRARY(dxflib ${HEADERS} ${SRCS} )
    SET_TARGET_PROPERTIES(dxflib PROPERTIES LINKER_LANGUAGE CXX)

  7. and for the test directory
    # build the test program
    
    ADD_EXECUTABLE(main main.cpp test_creationclass.cpp)
    
    INCLUDE_DIRECTORIES( ../src )
    ADD_DEPENDENCIES( main dxflib )
    	
    TARGET_LINK_LIBRARIES(main dxflib)

  8. Configure in CCMake and build

There are no comments on this page. [Add comment]

Get XTrkCAD Model RR Track Planner at SourceForge.net. Fast, secure and Free Open Source software downloads
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki