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

include_directories(${ANN_INCLUDE_PATH}
        ${BOOST.FILESYSTEM_INCLUDE_PATH}
        ${BOOST.PROGRAMOPTIONS_INCLUDE_PATH}
        ${BOOST.RANDOM_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.SYSTEM_LINK_PATH}
        ${CGAL_LINK_PATH}
        ${GPERFTOOLS_LINK_PATH}
        ${TCMALLOC_HEAPCHECKER_LINK_PATH}
        ${TCMALLOC_HEAPPROFILER_LINK_PATH})
add_definitions("-DIMP_EXECUTABLE")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORE_CXX_FLAGS}")


File(GLOB runtimepytests "${CMAKE_BINARY_DIR}/test/core/test_*.py")

math(EXPR short_timeout "${IMP_TIMEOUT_FACTOR} * 5")
math(EXPR medium_timeout "${IMP_TIMEOUT_FACTOR} * 15")
math(EXPR expensive_timeout "${IMP_TIMEOUT_FACTOR} * 120")

# should make into function
foreach (test ${runtimepytests} ${CMAKE_SOURCE_DIR}/modules/core/test/test_angle.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_blame.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_box.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_centroid.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_cg_optimizer.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_children.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_close_pairs_ps.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_connectivity.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_cosine.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_cover.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_cover_refiner.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_destroy_rigid_body.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_diameter.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_dihedral.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_display_deriv.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_distance.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_ev.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_geom_alignment.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_harmonic.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_hierarchy.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_incremenal_scoring.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_linear.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_mccg.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_ms_connectivity.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_neighbors_table.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_nested_rigid_bodies.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_non_rigid.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_normal_mover.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_refined_pairs_ps.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_restraints_scoring_function.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_rigid_bodies.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_rigid_distance.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_score_log.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_sd_optimizer.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_set_internal_coordinates.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_splines.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_table.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_to_from_refined.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_transform.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_transform_particles.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_truncated_harmonic.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_typed_pair_score.py
${CMAKE_SOURCE_DIR}/modules/core/test/test_xyzr.py)
  GET_FILENAME_COMPONENT(name ${test} NAME)
  add_test("IMP.core-${name}" ${IMP_TEST_SETUP} python ${test})
  set_tests_properties("IMP.core-${name}" PROPERTIES LABELS "IMP.core;test;length_short")
  set_tests_properties("IMP.core-${name}" PROPERTIES TIMEOUT ${short_timeout})
  set_tests_properties("IMP.core-${name}" PROPERTIES COST 1)
endforeach(test)

foreach (test ${CMAKE_SOURCE_DIR}/modules/core/test/medium_test_close_pair_finders.py
${CMAKE_SOURCE_DIR}/modules/core/test/medium_test_incremental_mc.py)
  GET_FILENAME_COMPONENT(name ${test} NAME)
  add_test("IMP.core-${name}" ${IMP_TEST_SETUP} python ${test})
  set_tests_properties("IMP.core-${name}" PROPERTIES LABELS "IMP.core;test;length_medium")
  set_tests_properties("IMP.core-${name}" PROPERTIES TIMEOUT ${medium_timeout})
  set_tests_properties("IMP.core-${name}" PROPERTIES COST 2)
endforeach(test)

foreach (test ${CMAKE_SOURCE_DIR}/modules/core/test/expensive_test_ev_restraint.py
${CMAKE_SOURCE_DIR}/modules/core/test/expensive_test_mc.py
${CMAKE_SOURCE_DIR}/modules/core/test/expensive_test_mc_rigid.py
${CMAKE_SOURCE_DIR}/modules/core/test/expensive_test_volume.py)
  GET_FILENAME_COMPONENT(name ${test} NAME)
  add_test("IMP.core-${name}" ${IMP_TEST_SETUP} python ${test})
  set_tests_properties("IMP.core-${name}" PROPERTIES LABELS "IMP.core;test;length_expensive")
  set_tests_properties("IMP.core-${name}" PROPERTIES TIMEOUT ${expensive_timeout})
  set_tests_properties("IMP.core-${name}" PROPERTIES COST 3)
endforeach(test)

set(cpp_tests ${CMAKE_SOURCE_DIR}/modules/core/test/test_generic.cpp
${CMAKE_SOURCE_DIR}/modules/core/test/test_non_rigid.cpp
${CMAKE_SOURCE_DIR}/modules/core/test/test_soft_sphere.cpp)

foreach (test ${cpp_tests})
   GET_FILENAME_COMPONENT(name ${test} NAME)
   GET_FILENAME_COMPONENT(name_we ${test} NAME_WE)
   add_executable("IMP.core-${name}" ${test})
   target_link_libraries("IMP.core-${name}"     IMP.core-lib
    ${IMP_base_LIBRARY};${IMP_cgal_LIBRARY};${IMP_algebra_LIBRARY};${IMP_kernel_LIBRARY};${IMP_display_LIBRARY};${IMP_score_functor_LIBRARY}
    ${BOOST.FILESYSTEM_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.core-${name}" PROPERTIES
                         RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/test/core/"
                         OUTPUT_NAME ${name_we})
   set_property(TARGET "IMP.core-${name}" PROPERTY FOLDER "IMP.core")

   add_test("IMP.core-${name}" ${IMP_TEST_SETUP}
            "${CMAKE_BINARY_DIR}/test/core/${name_we}${CMAKE_EXECUTABLE_SUFFIX}")
   set_tests_properties("IMP.core-${name}" PROPERTIES LABELS "IMP.core;test;length_short")
   set_tests_properties("IMP.core-${name}" PROPERTIES TIMEOUT ${short_timeout})
   set_tests_properties("IMP.core-${name}" PROPERTIES COST 1)
   set(executables ${executables} "IMP.core-${name}")
endforeach(test)


set(mdcpp_tests )

foreach (test ${mdcpp_tests})
   GET_FILENAME_COMPONENT(name ${test} NAME)
   GET_FILENAME_COMPONENT(name_we ${test} NAME_WE)
   add_executable("IMP.core-${name}" ${test})
   target_link_libraries("IMP.core-${name}"     IMP.core-lib
    ${IMP_base_LIBRARY};${IMP_cgal_LIBRARY};${IMP_algebra_LIBRARY};${IMP_kernel_LIBRARY};${IMP_display_LIBRARY};${IMP_score_functor_LIBRARY}
    ${BOOST.FILESYSTEM_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.core-${name}" PROPERTIES
                         RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/test/core/"
                         OUTPUT_NAME ${name_we})
   set_property(TARGET "IMP.core-${name}" PROPERTY FOLDER "IMP.core")

   add_test("IMP.core-${name}" ${IMP_TEST_SETUP}
            "${CMAKE_BINARY_DIR}/test/core/${name_we}${CMAKE_EXECUTABLE_SUFFIX}")
   set_tests_properties("IMP.core-${name}" PROPERTIES LABELS "IMP.core;test;length_medium")
   set_tests_properties("IMP.core-${name}" PROPERTIES TIMEOUT ${medium_timeout})
   set_tests_properties("IMP.core-${name}" PROPERTIES COST 1)
   set(executables ${executables} "IMP.core-${name}")
endforeach(test)

set(excpp_tests )

foreach (test ${excpp_tests})
   GET_FILENAME_COMPONENT(name ${test} NAME)
   GET_FILENAME_COMPONENT(name_we ${test} NAME_WE)
   add_executable("IMP.core-${name}" ${test})
   target_link_libraries("IMP.core-${name}"     IMP.core-lib
    ${IMP_base_LIBRARY};${IMP_cgal_LIBRARY};${IMP_algebra_LIBRARY};${IMP_kernel_LIBRARY};${IMP_display_LIBRARY};${IMP_score_functor_LIBRARY}
    ${BOOST.FILESYSTEM_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.core-${name}" PROPERTIES
                         RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/test/core/"
                         OUTPUT_NAME ${name_we})
   set_property(TARGET "IMP.core-${name}" PROPERTY FOLDER "IMP.core")

   add_test("IMP.core-${name}" ${IMP_TEST_SETUP}
            "${CMAKE_BINARY_DIR}/test/core/${name_we}${CMAKE_EXECUTABLE_SUFFIX}")
   set_tests_properties("IMP.core-${name}" PROPERTIES LABELS "IMP.core;test;length_expensive")
   set_tests_properties("IMP.core-${name}" PROPERTIES TIMEOUT ${expensive_timeout})
   set_tests_properties("IMP.core-${name}" PROPERTIES COST 1)
   set(executables ${executables} "IMP.core-${name}")
endforeach(test)

set(IMP_core_TESTS ${executables} CACHE INTERNAL "" FORCE)
