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

Simplify website CMake steps #723

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .github/workflows/website-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 10 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading