Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CMakeLists.txt « tests « libnest2d « src « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bfe32bfeb0132b4c9e956f94b00e33b5c5fac298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

# Try to find existing GTest installation
find_package(GTest QUIET)

if(NOT GTEST_FOUND)
    # Go and download google test framework, integrate it with the build
    set(GTEST_LIBRARIES gtest gmock)

    if (CMAKE_VERSION VERSION_LESS 3.2)
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
    else()
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
    endif()

    include(DownloadProject)
    download_project(PROJ                googletest
                     GIT_REPOSITORY      https://github.com/google/googletest.git
                     GIT_TAG             release-1.8.0
                     ${UPDATE_DISCONNECTED_IF_AVAILABLE}
    )

    # Prevent GoogleTest from overriding our compiler/linker options
    # when building with Visual Studio
    set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

    add_subdirectory(${googletest_SOURCE_DIR}
                     ${googletest_BINARY_DIR}
                     )

else()
    include_directories(${GTEST_INCLUDE_DIRS} )
endif()

include_directories(BEFORE ${LIBNEST2D_HEADERS})
add_executable(bp2d_tests test.cpp printer_parts.h printer_parts.cpp)
target_link_libraries(bp2d_tests libnest2d
    ${GTEST_LIBRARIES}
)

if(DEFINED LIBNEST2D_TEST_LIBRARIES)
    target_link_libraries(bp2d_tests ${LIBNEST2D_TEST_LIBRARIES})
endif()

add_test(gtests bp2d_tests)

add_executable(main EXCLUDE_FROM_ALL main.cpp printer_parts.cpp printer_parts.h)
target_link_libraries(main libnest2d)
target_include_directories(main PUBLIC ${CMAKE_SOURCE_DIR})