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
Fix make cookbook
when certain cookbooks are guarded
#3665
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch.
It is kind of dirty that we would have to blacklist an example twice don't you think?
I would prefer a solution where this only happens in a single place, i.e. the excluded cookbook pages are extracted from the excluded code listings ...
You can also pull out the whole functionality of blacklisting meta examples to a separate function that you then call from both the function that gives you all the excluded ones... I.e. make it more modular (current solution in develop is a hack anyways)
Mmmh, I think you are pretty right. It was more like a "quick fix" than a proper solution. I refactored the code a bit to make it more readable and modular. This new approach should be better. <off_topic> |
Yes, an overwhealming number of good reasons for that :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this much more now. Few changes and it is good to go
cmake/FindMetaExamples.cmake
Outdated
${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg) | ||
IF(NOT HAVE_NLOPT) | ||
LIST(APPEND EXCLUDED_META_EXAMPLES | ||
gaussian_processes/gaussian_process_regression.sg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 this is cleaner!
cmake/FindMetaExamples.cmake
Outdated
FILE(GLOB_RECURSE META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/*.sg) | ||
get_excluded_meta_examples() | ||
|
||
# temporary hacks to exclude certain meta examples that have dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this comment can be removed now, as it is a bit nicer
cmake/FindMetaExamples.cmake
Outdated
SET(META_EXAMPLES ${META_EXAMPLE_LISTINGS} PARENT_SCOPE) | ||
endfunction() | ||
|
||
# Get the cookbook pages we want to exclude from build | ||
function(find_excluded_meta_examples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function should be named differently, as it is about cookbook pages, not meta examples themselves
cmake/FindMetaExamples.cmake
Outdated
# This is made since Sphinx's exclude_patterns option wants | ||
# the list's items separated by commas, but cmake's lists use | ||
# semicolons instead. | ||
# See: https://cmake.org/cmake/help/v3.3/command/list.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to put that comment
doc/cookbook/CMakeLists.txt
Outdated
@@ -1,5 +1,7 @@ | |||
#PROJECT(sphinxdoc) | |||
#cmake_minimum_required(VERSION 2.8.8) | |||
include(FindMetaExamples) | |||
find_excluded_meta_examples() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename as said above
cmake/FindMetaExamples.cmake
Outdated
get_excluded_meta_examples() | ||
|
||
FOREACH(META_EXAMPLE ${EXCLUDED_META_EXAMPLES}) | ||
LIST(APPEND EXCLUDED_COOKBOOK_PAGES examples/${META_EXAMPLE}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing to consider here: Some meta examples do not have cookbook pages. So they do not need to be excluded technically. Not sure whether that causes problems, but it is definitely cleaner to only work on the existing cookbook pages
I made the suggested changes @karlnapf. |
Fine to merge from my side. @vigsterkr ? |
@geektoni IRC hours depend. I am UTC 11am-7pm usually. Others might differ. |
go |
|
Fix `make cookbook` when certain cookbooks are guarded
This should fix issue #3520. These changes fix also
make cookbook_sphinx_linkcheck
.The command
make cookbook
still gives me warnings, though, but I don't understand if they are caused by my changes or if they were already there.See warnings here: http://pastebin.com/chxfGvaq