1. wget
wget -nd -r -l 2 -A jpg,jpeg,png,gif http://t.co
-
-nd
: no directories (save all files to the current directory;-P directory
changes the target directory) - --no-directories
- --recursive
-
-r -l 2
: recursive level 2 - --relative --level=1
-
-A
: accepted extensions
wget -nd -H -p -A jpg,jpeg,png,gif -e robots=off example.tumblr.com/page/{1..2}
-
-H
: span hosts (wget doesn't download files from different domains or subdomains by default) - -nH (--no-host-directories)
-
-p
: page requisites (includes resources like images on each page) -
-e robots=off
: execute commandrobotos=off
as if it was part of.wgetrc
file. This turns off the robot exclusion which means you ignore robots.txt and the robot meta tags (you should know the implications this comes with, take care).
wget -r -nH --cut-dirs=2 --user-agent=Mozilla/5.0 --no-parent --reject="index.html*" http://mysite.com/dir1/dir2/data
wget --include downloads/good --mirror http://<host>/downloads/good
2. cmake
Add Arbitrary Compile/Link Flags in CMake
############################################################################################################
# AddCompileLinkFlags.cmake
############################################################################################################
############################################################################################################
# Append str to a string property of a target.
# target: string: target name.
# property: name of target’s property. e.g: COMPILE_FLAGS, or LINK_FLAGS
# str: string: string to be appended to the property
macro(my_append_target_property target property str)
get_target_property(current_property ${target} ${property})
if(NOT current_property) # property non-existent or empty
set_target_properties(${target} PROPERTIES ${property} ${str})
else()
set_target_properties(${target} PROPERTIES ${property} "${current_property} ${str}")
endif()
endmacro(my_append_target_property)
############################################################################################################
# Add/append compile flags to a target.
# target: string: target name.
# flags : string: compile flags to be appended
macro(my_add_compile_flags target flags)
my_append_target_property(${target} COMPILE_FLAGS ${flags})
endmacro(my_add_compile_flags)
############################################################################################################
# Add/append link flags to a target.
# target: string: target name.
# flags : string: link flags to be appended
macro(my_add_link_flags target flags)
my_append_target_property(${target} LINK_FLAGS ${flags})
endmacro(my_add_link_flags)
Now, to turn off Image Has Safe Exception Handlers linker option of my target, I just need to use my_add_link_flags:
include(AddCompileLinkFlags.cmake)
…
add_executable(test_proj test.cpp ${ConfigFiles} ${GeneratedFiles}) # VS project
my_add_link_flags(test_proj "/SAFESEH:NO")