build: pass testmaps directory to testqbsp

This commit is contained in:
Eric Wasylishen 2022-04-15 18:03:23 -06:00
parent ed8c758486
commit 67f7d7ec8b
4 changed files with 10 additions and 2 deletions

View File

@ -88,6 +88,11 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
find_package(TBB REQUIRED)
# just creates testmaps.hh with absolute path to the testmaps source directory.
# include it as #include <testmaps.hh>
configure_file(testmaps.hh.in testmaps.hh @ONLY)
include_directories(${CMAKE_BINARY_DIR})
add_subdirectory(3rdparty)
add_subdirectory(common)
add_subdirectory(bspinfo)

View File

@ -45,9 +45,10 @@ add_custom_command(TARGET qbsp POST_BUILD
enable_testing()
set(QBSP_TEST_SOURCE
set(QBSP_TEST_SOURCE
test.cc
test_qbsp.cc)
test_qbsp.cc
${CMAKE_BINARY_DIR}/testmaps.hh)
add_executable(testqbsp ${QBSP_TEST_SOURCE})
target_link_libraries (testqbsp libqbsp common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb gtest fmt::fmt)

View File

@ -2,6 +2,7 @@
#include <qbsp/qbsp.hh>
#include <qbsp/map.hh>
#include <testmaps.hh>
#include <cstring>

1
testmaps.hh.in Normal file
View File

@ -0,0 +1 @@
const char *testmaps_dir = "@CMAKE_SOURCE_DIR@/testmaps";