Skip to content

Commit

Permalink
Fix UNITS_<VAR> def and <var> use mismatch (#287)
Browse files Browse the repository at this point in the history
A few variables prefixed with UNITS_ are defined to control various
build options, but prefix-less versions are checked in the rest of the
file when determining their values. This makes the options effectively
useless.

This commit unifies definition and use so the options actually affect
the build.

Co-authored-by: Alex Wang <ts826848@gmail.com>
  • Loading branch information
ts826848 and Alex Wang authored Sep 26, 2022
1 parent 0ee7eef commit 2b2c063
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ target_include_directories(${PROJECT_NAME}
)

# Remove IOStream from the library (useful for embdedded development)
if(DISABLE_IOSTREAM)
if(UNITS_DISABLE_IOSTREAM)
target_compile_definitions(${PROJECT_NAME} INTERFACE -DUNIT_LIB_DISABLE_IOSTREAM)
endif(DISABLE_IOSTREAM)
endif(UNITS_DISABLE_IOSTREAM)

# unit tests
include(CTest)
Expand All @@ -37,7 +37,7 @@ if(BUILD_TESTING AND UNITS_BUILD_TESTS)
endif()

# add a target to generate API documentation with Doxygen
if(BUILD_DOCS)
if(UNITS_BUILD_DOCS)
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
Expand Down

0 comments on commit 2b2c063

Please sign in to comment.