From d853c982cb05005bc02f4a167d05b7f443380b29 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 9 Feb 2024 13:14:13 -0400 Subject: [PATCH] Simplify website CMake steps Signed-off-by: Juan Cruz Viotti --- .github/workflows/website-build.yml | 1 - .github/workflows/website-deploy.yml | 1 - CMakeLists.txt | 35 ++++++++-------------------- Makefile | 1 - 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.github/workflows/website-build.yml b/.github/workflows/website-build.yml index f9b81c67..e767a67e 100644 --- a/.github/workflows/website-build.yml +++ b/.github/workflows/website-build.yml @@ -24,7 +24,6 @@ jobs: -DJSONBINPACK_COMPILER:BOOL=ON -DJSONBINPACK_TESTS:BOOL=OFF -DJSONBINPACK_WEBSITE:BOOL=ON - - run: cmake --build ./build --config Release --target bundler # Jekyll is often flaky on GitHub Actions - run: ./scripts/retry.sh cmake --build ./build --config Release --target jekyll - run: cmake --build ./build --config Release --target doxygen diff --git a/.github/workflows/website-deploy.yml b/.github/workflows/website-deploy.yml index c2c59814..27fe1258 100644 --- a/.github/workflows/website-deploy.yml +++ b/.github/workflows/website-deploy.yml @@ -33,7 +33,6 @@ jobs: -DJSONBINPACK_TESTS:BOOL=OFF -DJSONBINPACK_WEBSITE:BOOL=ON - - run: cmake --build ./build --config Release --target bundler # Jekyll is often flaky on GitHub Actions - run: ./scripts/retry.sh cmake --build ./build --config Release --target jekyll - run: cmake --build ./build --config Release --target doxygen diff --git a/CMakeLists.txt b/CMakeLists.txt index 64ee601f..80218127 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,32 +39,17 @@ endif() # TODO: Get rid of Jekyll if(JSONBINPACK_WEBSITE) string(TOLOWER ${CMAKE_BUILD_TYPE} JSONBINPACK_BUILD_TYPE) + set(JSONBINPACK_WEBSITE_OUT "${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www") noa_target_doxygen(CONFIG "${PROJECT_SOURCE_DIR}/doxygen/Doxyfile.in" - OUTPUT "${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www/api") - set(JSONBINPACK_WEBSITE_OUT ${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www) - set(JSONBINPACK_WEBSITE_SRC ${PROJECT_SOURCE_DIR}/www) - find_program(BUNDLE_BIN NAMES bundle) - set(JSONBINPACK_BUNDLER_PATH "${PROJECT_SOURCE_DIR}/build/bundler") - if(BUNDLE_BIN) - add_custom_target(bundler - WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" - VERBATIM - COMMAND "${BUNDLE_BIN}" install --path "${JSONBINPACK_BUNDLER_PATH}") - else() - message(WARNING "Could not find `bundler` in the system") - endif() - find_program(BUNDLE_BIN NAMES bundle) - if(BUNDLE_BIN) - add_custom_target(jekyll - WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" - VERBATIM - COMMAND "${BUNDLE_BIN}" exec jekyll build - --source "${JSONBINPACK_WEBSITE_SRC}" --destination "${JSONBINPACK_WEBSITE_OUT}") - set_target_properties(jekyll - PROPERTIES FOLDER "Website") - else() - message(WARNING "Could not find `jekyll` in the system") - endif() + OUTPUT "${JSONBINPACK_WEBSITE_OUT}/api") + find_program(BUNDLE_BIN NAMES bundle REQUIRED) + add_custom_target(jekyll + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + VERBATIM + COMMAND "${BUNDLE_BIN}" install --path "${PROJECT_SOURCE_DIR}/build/bundler" + COMMAND "${BUNDLE_BIN}" exec jekyll build + --source "${PROJECT_SOURCE_DIR}/www" --destination "${JSONBINPACK_WEBSITE_OUT}") + set_target_properties(jekyll PROPERTIES FOLDER "JSON BinPack/Website") endif() if(PROJECT_IS_TOP_LEVEL) diff --git a/Makefile b/Makefile index 8baecd75..a640d60c 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,6 @@ test: .always --output-on-failure --progress --parallel website: .always - $(CMAKE) --build ./build --config $(PRESET) --target bundler $(CMAKE) --build ./build --config $(PRESET) --target jekyll $(CMAKE) --build ./build --config $(PRESET) --target doxygen