set (PROJECT_EXAMPLE "example")
set (PROJECT_EXAMPLE_STATIC "example_static")

set (SOURCES_EXAMPLE
  main.c
  modules.c)

configure_file ("config.h.in" "config.h")

include_directories (${INCLUDE_DIR})

add_executable (${PROJECT_EXAMPLE}
  ${SOURCES_EXAMPLE}
  ${HEADERS_EXTERN})
set_target_properties (${PROJECT_EXAMPLE}
  PROPERTIES
  RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR})
target_link_libraries (${PROJECT_EXAMPLE} ${PROJECT})

add_executable (${PROJECT_EXAMPLE_STATIC}
  ${SOURCES_EXAMPLE}
  ${HEADERS_EXTERN})
set_target_properties (${PROJECT_EXAMPLE_STATIC}
  PROPERTIES
  RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR})
target_link_libraries (${PROJECT_EXAMPLE_STATIC} ${PROJECT}.a)

set (PROJECT_EXAMPLE_DYNAMIC "example")
set (PROJECT_EXAMPLE_STATIC "example_static")

set (SOURCES_EXAMPLE
  main.c
  modules.c)

configure_file ("config.h.in" "config.h")

include_directories (${INCLUDE_DIR})
add_executable (${PROJECT_EXAMPLE_DYNAMIC}
  ${SOURCES_EXAMPLE}
  ${HEADERS_EXTERN})
set_target_properties (${PROJECT_EXAMPLE_DYNAMIC}
  PROPERTIES
  RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR})
target_link_libraries (${PROJECT_EXAMPLE_DYNAMIC} ${BUILD_DIR}/libextopts.so)

add_executable (${PROJECT_EXAMPLE_STATIC}
  ${SOURCES_EXAMPLE}
  ${HEADERS_EXTERN})
set_target_properties (${PROJECT_EXAMPLE_STATIC}
  PROPERTIES
  RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR})
target_link_libraries (${PROJECT_EXAMPLE_STATIC} ${BUILD_DIR}/libextopts.a)

Make example dependent on local library build, not on system one
Make example dependent on local library build, not on system one
