# Autogenerated file, run tools/build/setup_cmake.py to regenerate

project(IMP.example_app)

imp_get_process_exit_code("setup_application example_app" status ${CMAKE_BINARY_DIR}
                          COMMAND ${CMAKE_SOURCE_DIR}/tools/build/setup_application.py
                          --name=example_app
                          --datapath=${IMP_DATAPATH}
                           --source=${CMAKE_SOURCE_DIR})
if(${status} EQUAL 0)
include_directories(${ANN_INCLUDE_PATH}
        ${BOOST.FILESYSTEM_INCLUDE_PATH}
        ${BOOST.PROGRAMOPTIONS_INCLUDE_PATH}
        ${BOOST.RANDOM_INCLUDE_PATH}
        ${BOOST.REGEX_INCLUDE_PATH}
        ${BOOST.SYSTEM_INCLUDE_PATH}
        ${CGAL_INCLUDE_PATH}
        ${GPERFTOOLS_INCLUDE_PATH}
        ${TCMALLOC_HEAPCHECKER_INCLUDE_PATH}
        ${TCMALLOC_HEAPPROFILER_INCLUDE_PATH} )
link_directories(${ANN_LINK_PATH}
        ${BOOST.FILESYSTEM_LINK_PATH}
        ${BOOST.PROGRAMOPTIONS_LINK_PATH}
        ${BOOST.RANDOM_LINK_PATH}
        ${BOOST.REGEX_LINK_PATH}
        ${BOOST.SYSTEM_LINK_PATH}
        ${CGAL_LINK_PATH}
        ${GPERFTOOLS_LINK_PATH}
        ${TCMALLOC_HEAPCHECKER_LINK_PATH}
        ${TCMALLOC_HEAPPROFILER_LINK_PATH})
add_definitions("-DIMP_EXECUTABLE")


   add_executable("IMP.example_app-imp_example_app" ${CMAKE_SOURCE_DIR}/applications/example_app/imp_example_app.cpp)
   target_link_libraries(IMP.example_app-imp_example_app
    ${IMP_atom_LIBRARY}
${IMP_container_LIBRARY}
${IMP_base_LIBRARY}
${IMP_cgal_LIBRARY}
${IMP_algebra_LIBRARY}
${IMP_kernel_LIBRARY}
${IMP_display_LIBRARY}
${IMP_score_functor_LIBRARY}
${IMP_core_LIBRARY}
${IMP_container_LIBRARY}
    ${BOOST.FILESYSTEM_LIBRARIES}
${BOOST.REGEX_LIBRARIES}
${BOOST.PROGRAMOPTIONS_LIBRARIES}
${BOOST.SYSTEM_LIBRARIES}
${GPERFTOOLS_LIBRARIES}
${TCMALLOC_HEAPPROFILER_LIBRARIES}
${TCMALLOC_HEAPCHECKER_LIBRARIES}
${BOOST.RANDOM_LIBRARIES}
${CGAL_LIBRARIES}
${ANN_LIBRARIES})
   set_target_properties(IMP.example_app-imp_example_app PROPERTIES OUTPUT_NAME imp_example_app RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
   set_property(TARGET "IMP.example_app-imp_example_app" PROPERTY FOLDER "IMP.example_app")
   install(TARGETS IMP.example_app-imp_example_app DESTINATION ${CMAKE_INSTALL_BINDIR})
   set(bins ${bins} IMP.example_app-imp_example_app)


set(pybins )
foreach (pybin ${pybins})
  install(PROGRAMS ${pybin} DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach(pybin)

math(EXPR expensive_timeout "${IMP_TIMEOUT_FACTOR} * 120")

set(pytests ${CMAKE_SOURCE_DIR}/applications/example_app/test/test_example.py)
foreach (test ${pytests})
  GET_FILENAME_COMPONENT(name ${test} NAME)
  add_test("IMP.example_app-${name}" ${IMP_TEST_SETUP} python ${test})
  set_tests_properties("IMP.example_app-${name}" PROPERTIES LABELS "IMP.example_app;test")
  set_tests_properties("IMP.example_app-${name}" PROPERTIES TIMEOUT ${expensive_timeout})
  set_tests_properties("IMP.example_app-${name}" PROPERTIES COST 3)
endforeach(test)

if(IMP_DOXYGEN_FOUND)
# documentation

file(GLOB docs ${CMAKE_SOURCE_DIR}/applications/example_app/*.dox
               ${CMAKE_SOURCE_DIR}/applications/example_app/*.md)

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/doxygen/example_app/tags ${CMAKE_BINARY_DIR}/doc/html/example_app/index.html
   COMMAND mkdir -p doc/html
   COMMAND ${IMP_DOXYGEN_EXECUTABLE} ../../doxygen/example_app/Doxyfile
   COMMAND ${CMAKE_SOURCE_DIR}/tools/build/doxygen_patch_tags.py --module=example_app --file=../../doxygen/example_app/tags
   COMMAND ${CMAKE_SOURCE_DIR}/tools/build/doxygen_show_warnings.py --warn=../../doxygen/example_app/warnings.txt
   DEPENDS ${IMP_atom_DOC}
${IMP_container_DOC}
${IMP_base_DOC}
${IMP_cgal_DOC}
${IMP_algebra_DOC}
${IMP_kernel_DOC}
${IMP_display_DOC}
${IMP_score_functor_DOC}
${IMP_core_DOC}
${IMP_container_DOC} ${docs}
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doxygen/example_app/
   COMMENT "Running doxygen on example_app")

add_custom_target("IMP.example_app-doc" ALL DEPENDS ${CMAKE_BINARY_DIR}/doxygen/example_app/tags)
set_property(TARGET "IMP.example_app-doc" PROPERTY FOLDER "IMP.example_app")

set(IMP_example_app_DOC "IMP.example_app-doc" CACHE INTERNAL "" FORCE)

set(IMP_DOC_DEPENDS ${IMP_DOC_DEPENDS} ${IMP_example_app_DOC} CACHE INTERNAL "" FORCE)
endif(IMP_DOXYGEN_FOUND)

add_custom_target(IMP.example_app DEPENDS
  ${IMP_atom}
${IMP_container}
${IMP_base}
${IMP_cgal}
${IMP_algebra}
${IMP_kernel}
${IMP_display}
${IMP_score_functor}
${IMP_core}
${IMP_container}
  ${bins})
set_property(TARGET "IMP.example_app" PROPERTY FOLDER "IMP.example_app")

elseif(${status} EQUAL 1)
message("Application example_app disabled")
else()
message(FATAL_ERROR "setup_application failed ${status}")
endif()
