Skip to content

Commit

Permalink
Simplify website CMake steps
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Feb 9, 2024
1 parent 960fd37 commit d853c98
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
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

0 comments on commit d853c98

Please sign in to comment.