Skip to content

Commit

Permalink
build: allow custom npm path
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Aug 23, 2024
1 parent 6d145da commit b1c5bcd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ project(doxyconfig VERSION 0.0.0
DESCRIPTION "Doxygen configuration for LizardByte projects"
HOMEPAGE_URL "https://app.lizardbyte.dev")

#
# Options
#

# provide the NPM executable to use instead of searching for it
set(NPM "" CACHE FILEPATH "Path to the NPM executable")

#
# End Options
#

# find doxygen and graphviz
find_package(Doxygen 1.10 REQUIRED dot) # debian and ubuntu left in the dust

Expand Down Expand Up @@ -64,11 +75,14 @@ set(FONT_AWESOME_FILES_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/node_modules/@fortawesome/fontawesome-free/webfonts/"
)

find_program(NPM npm REQUIRED)
if(NPM STREQUAL "")
unset(NPM CACHE)
find_program(NPM npm REQUIRED)
endif()
add_custom_target(_docs_fontawesome_install
COMMENT "Installing node modules"
BYPRODUCTS ${FONT_AWESOME_FILES_DEPENDS}
COMMAND ${NPM} install
COMMAND "${NPM}" install
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
VERBATIM
)
Expand Down

0 comments on commit b1c5bcd

Please sign in to comment.