include(ExternalProject)
ExternalProject_Add(
  Nana
  GIT_REPOSITORY https://github.com/cnjinhao/nana.git
  GIT_TAG v1.6.2
  CMAKE_CACHE_ARGS "-DNANA_CMAKE_SHARED_LIB:BOOL=TRUE"
  INSTALL_COMMAND "")

# ExternalProject_Get_Property(Nana NANA_INCLUDE_DIR)
ExternalProject_Get_Property(Nana SOURCE_DIR BINARY_DIR)
add_executable(test_nana main.cpp)
target_include_directories(test_nana PRIVATE ${SOURCE_DIR}/include)
add_dependencies(test_nana Nana)
target_link_libraries(
  test_nana
  PRIVATE project_warnings
          project_options
          ${BINARY_DIR}/libnana.so
          ${NANA_LINKS})

include(ExternalProject)
ExternalProject_Add(
  Nana
  GIT_REPOSITORY https://github.com/cnjinhao/nana.git
  GIT_TAG v1.6.2
  CMAKE_CACHE_ARGS "-DNANA_CMAKE_SHARED_LIB:BOOL=TRUE"
  INSTALL_COMMAND "")

# ExternalProject_Get_Property(Nana NANA_INCLUDE_DIR)
ExternalProject_Get_Property(Nana SOURCE_DIR BINARY_DIR)
add_executable(test_nana main.cpp)
target_include_directories(test_nana SYSTEM PRIVATE ${SOURCE_DIR}/include)
add_dependencies(test_nana Nana)
target_link_libraries(
  test_nana
  PRIVATE project_warnings
          project_options
          ${BINARY_DIR}/libnana.so
          ${NANA_LINKS})

Fix compilation failure for Nana example
Fix compilation failure for Nana example

What:
Currently, the Nana example does not compile when `WARNINGS_AS_ERRORS`
is turned on. This is because there are shadowed variable names in the
Nana header file, which triggers the `-Wshadow` warning. This change
convinces the compiler not to trigger warnings on any of the Nana
headers. With this fix applied, you can use `WARNINGS_AS_ERRORS` on
your own code, without getting errors from the Nana headers.

How:
This change adds the `SYSTEM` keyword to the
`target_include_directories` call that adds the Nana headers. This will
convince the compiler that the Nana headers are system headers, and
should not be affected by warnings. See `target_include_directories`
docs at: https://cmake.org/cmake/help/v3.0/command/target_include_directories.html
