Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: allow custom npm path #6

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
build: allow custom npm path
  • Loading branch information
ReenigneArcher committed Aug 23, 2024
commit 37e6aca121b0eabedce2278dda973141ada03286
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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

@@ -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
)