Formatting code for DXFLib


show source only

For researching DXF import possibilities I started with DXFLib.

To get started:

1) download DXFLib from [[http://www.ribbonsoft.de/dxflib_downloads.html Ribbonsoft]]
1) create the following directories ##dxflib, dxflib\src, dxflib\build##
1) unpack the downloaded archive into ##dxflib\src##
1) DXFLib comes with support for the standard UNIX toolchain. You can use the following CMakeFiles:
1) 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)
%%
1) 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)
%%
1) 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)
%%
1) Configure in CCMake and build
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