1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-07-06 13:41:36 +00:00
openmw/apps/openmw_tests/CMakeLists.txt
elsid 0166b07ad5
Move coverage build out of CMake config
It is too repetitive, redundant and GCC specific.

Configure with CMAKE_CXX_FLAGS_DEBUG and CMAKE_EXE_LINKER_FLAGS instead.
2025-04-26 13:18:09 +02:00

54 lines
1.2 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
mwworld/testptr.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()
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()