You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/apps/openmw_tests/CMakeLists.txt

59 lines
1.3 KiB
CMake

include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
file(GLOB UNITTEST_SRC_FILES
main.cpp
options.cpp
mwworld/test_store.cpp
mwworld/testduration.cpp
mwworld/testtimestamp.cpp
mwdialogue/test_keywordsearch.cpp
mwscript/test_scripts.cpp
)
source_group(apps\\openmw-tests FILES ${UNITTEST_SRC_FILES})
openmw_add_executable(openmw-tests ${UNITTEST_SRC_FILES})
target_link_libraries(openmw-tests
GTest::GTest
GMock::GMock
openmw-lib
)
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
target_link_libraries(openmw-tests ${CMAKE_THREAD_LIBS_INIT})
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-tests PRIVATE --coverage)
target_link_libraries(openmw-tests gcov)
endif()
target_compile_definitions(openmw-tests
PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data"
OPENMW_PROJECT_SOURCE_DIR=u8"${PROJECT_SOURCE_DIR}")
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
target_precompile_headers(openmw-tests PRIVATE
<boost/program_options/options_description.hpp>
<gtest/gtest.h>
<sol/sol.hpp>
<algorithm>
<filesystem>
<fstream>
<functional>
<memory>
<string>
<vector>
)
endif()