Files
MapLibreParticleLab/cmake/test.cmake
Thiago Marcos P. Santos 69960afb8d [build] Add build system for submodules
Vendorize the submodules and a simple CMake build
system for all them. The dependencies will inherit
compilation options for core.

The goal is to make Mapbox GL Core completely self
contained with a simple offline build.
2018-10-31 18:19:28 +02:00

53 lines
1.3 KiB
CMake

add_vendor_target(gtest STATIC)
# Modify cmake/test-files.txt to change the source files for this target.
load_sources_list(MBGL_TEST_FILES cmake/test-files.txt)
if (MBGL_TEST_TARGET_TYPE STREQUAL "library")
add_library(mbgl-test SHARED ${MBGL_TEST_FILES})
else()
add_executable(mbgl-test ${MBGL_TEST_FILES})
endif()
if(NOT WITH_NODEJS)
target_compile_definitions(mbgl-test PRIVATE "-DTEST_HAS_SERVER=0")
endif()
set_source_files_properties(test/src/mbgl/test/util.cpp PROPERTIES COMPILE_FLAGS -DNODE_EXECUTABLE="${NodeJS_EXECUTABLE}")
target_include_directories(mbgl-test
PRIVATE src
PRIVATE test/include
PRIVATE test/src
PRIVATE platform/default
)
target_link_libraries(mbgl-test PRIVATE
gtest
mbgl-core
shelf-pack-cpp
unique_resource
)
target_add_mason_package(mbgl-test PRIVATE pixelmatch)
target_add_mason_package(mbgl-test PRIVATE boost)
mbgl_platform_test()
create_source_groups(mbgl-test)
initialize_xcode_cxx_build_settings(mbgl-test)
set_target_properties(mbgl-test PROPERTIES FOLDER "Executables")
xcode_create_scheme(
TARGET mbgl-test
OPTIONAL_ARGS
"--gtest_filter=Category.*"
"--gtest_repeat=0"
"--gtest_shuffle=0"
"--gtest_break_on_failure=0"
"--gtest_throw_on_failure=0"
"--gtest_catch_exceptions=0"
)