Pull TESTDIR out of the global includes if tests are being built.

This commit is contained in:
Joseph Lenox 2018-11-25 10:36:44 -06:00 committed by Joseph Lenox
parent 181ef8e221
commit e4fd0e3200

View File

@ -445,8 +445,10 @@ IF(wxWidgets_FOUND AND OPENGL_FOUND AND Enable_GUI)
endif()
add_executable(gui_test ${UI_TEST_SOURCES})
add_test(NAME TestGUI COMMAND gui_test)
configure_file("${TESTDIR}/test_options.hpp.in" "${TESTDIR}/test_options.hpp")
target_link_libraries(gui_test PUBLIC slic3r_gui libslic3r Catch ${wxWidgets_LIBRARIES} ${LIBSLIC3R_DEPENDS} ${OPENGL_LIBRARIES})
target_include_directories(gui_test PUBLIC cxx_std_14 ${SLIC3R_GUI_INCLUDES} )
target_include_directories(gui_test PUBLIC ${TESTDIR})
endif()
if (WIN32)
target_link_libraries(slic3r uxtheme)
@ -524,12 +526,12 @@ if (SLIC3R_BUILD_TESTS)
target_include_directories(Catch INTERFACE ${CMAKE_BINARY_DIR}/external/Catch/include)
target_compile_definitions(Catch INTERFACE $<$<CXX_COMPILER_ID:MSVC>:_SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING>)
endif()
include_directories(${TESTDIR})
configure_file("${TESTDIR}/test_options.hpp.in" "${TESTDIR}/test_options.hpp")
add_executable(slic3r_test ${SLIC3R_TEST_SOURCES})
add_test(NAME TestSlic3r COMMAND slic3r_test)
target_compile_features(slic3r_test PUBLIC cxx_std_14)
target_include_directories(slic3r_test PUBLIC cxx_std_14 ${SLIC3R_INCLUDES})
target_include_directories(slic3r_test PUBLIC ${TESTDIR})
target_link_libraries(slic3r_test PUBLIC libslic3r Catch ${LIBSLIC3R_DEPENDS})
endif()