Debian Codegraph @

ogr/ogrsf_frmts/dwg/CMakeLists.txt

raw
1 set(SOURCE
2 ogrdgnv8datasource.cpp
3 ogrdgnv8driver.cpp
4 ogrdgnv8layer.cpp
5 ogrdwg_blockmap.cpp
6 ogrdwg_dimension.cpp
7 ogrdwg_hatch.cpp
8 ogrdwgblockslayer.cpp
9 ogrdwgdatasource.cpp
10 ogrdwgdriver.cpp
11 ogrdwglayer.cpp
12 ogrteigha.cpp)
13 add_gdal_driver(TARGET ogr_DWG_DGNV8
14 SOURCES ${SOURCE}
15 CORE_SOURCES
16 ogrdgnv8drivercore.cpp
17 ogrdwgdrivercore.cpp
18 DRIVER_NAME_OPTION DWG
19 SKIP_GDAL_PRIV_HEADER # because of issue with _REENTRANT
20 PLUGIN_CAPABLE
21 NO_SHARED_SYMBOL_WITH_CORE
22 NO_CXX_WFLAGS_EFFCXX
23 NO_WFLAG_OLD_STYLE_CAST
24 )
25 if(NOT TARGET ogr_DWG_DGNV8)
26 return()
27 endif()
28
29 if (OGR_ENABLE_DRIVER_DWG_PLUGIN)
30 # a bit ugly but we need those symbols from the DXF driver Note: we need to use target_sources() to add them, and not
31 # edit the SOURCE variable, as the OGR_ENABLE_DRIVER_DWG_PLUGIN variable is automatically created only after
32 # add_gdal_driver()
33 target_sources(ogr_DWG_DGNV8 PRIVATE ../dxf/ogr_autocad_services.cpp ../dxf/ogrdxf_polyline_smooth.cpp
34 ../dxf/intronurbs.cpp)
35 else ()
36 # Another hack for the non-plugin use case
37 target_compile_definitions(ogrsf_frmts PRIVATE -DDGNV8_ENABLED)
38 endif ()
39
40 gdal_standard_includes(ogr_DWG_DGNV8)
41 target_include_directories(ogr_DWG_DGNV8 PRIVATE $<TARGET_PROPERTY:ogr_DXF,SOURCE_DIR>)
42 gdal_target_link_libraries(ogr_DWG_DGNV8 PRIVATE TEIGHA::TEIGHA)
43 if (Threads_FOUND)
44 gdal_target_link_libraries(ogr_DWG_DGNV8 PRIVATE Threads::Threads)
45 endif ()
46
47 option(BUILD_CREATEDGNV8TESTFILE "Build test program createdgnv8testfile" ON)
48 mark_as_advanced(BUILD_CREATEDGNV8TESTFILE)
49 if (BUILD_CREATEDGNV8TESTFILE)
50 add_executable(createdgnv8testfile createdgnv8testfile.cpp)
51 target_link_libraries(createdgnv8testfile PRIVATE TEIGHA::TEIGHA)
52 endif ()