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 37e6aca
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 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_EXECUTABLE "" 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,15 @@ set(FONT_AWESOME_FILES_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/node_modules/@fortawesome/fontawesome-free/webfonts/"
)

find_program(NPM npm REQUIRED)
if(NPM_EXECUTABLE STREQUAL "")
find_program(NPM npm REQUIRED)
else()
set(NPM ${NPM_EXECUTABLE})
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 37e6aca

Please sign in to comment.