Skip to content

Commit

Permalink
Merge pull request #66 from drpeterfranz/master
Browse files Browse the repository at this point in the history
CMake building of doc and dwg2dxf optional
  • Loading branch information
Florian Roméo authored Oct 13, 2022
2 parents 81c9319 + 4b8fe52 commit 34b65b0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
cmake_policy(SET CMP0048 NEW)
project(DXFRW VERSION 1.0.1)

# set preferred cache variables
set(LIBDXFRW_BUILD_DOC TRUE CACHE BOOL "Build the documentation")
set(LIBDXFRW_BUILD_DWG2DXF TRUE CACHE BOOL "Build the dwg2dxf application")


# set compiler warnings
if (MSVC)
add_compile_options(/W4 /WX)
Expand Down Expand Up @@ -90,15 +95,19 @@ target_include_directories(dxfrw
$<INSTALL_INTERFACE:${LIBDXFRW_INSTALL_INCLUDEDIR}>
)

add_custom_command(OUTPUT doc/html/index.html
COMMAND doxygen ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libdxfrw.dox
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/libdxfrw.dox
VERBATIM)
if(LIBDXFRW_BUILD_DOC)
add_custom_command(OUTPUT doc/html/index.html
COMMAND doxygen ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libdxfrw.dox
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/libdxfrw.dox
VERBATIM)

add_custom_target(doc
DEPENDS doc/html/index.html)
add_custom_target(doc
DEPENDS doc/html/index.html)
endif()

add_subdirectory(dwg2dxf)
if(LIBDXFRW_BUILD_DWG2DXF)
add_subdirectory(dwg2dxf)
endif()

# INSTALLATION
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/libdxfrw)
Expand Down

0 comments on commit 34b65b0

Please sign in to comment.