summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Jeremie Guichard <djebrest@gmail.com>2017-02-24 13:52:07 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-24 01:10:22 -0800
commit1e2580c3fd73d5b1ca06ecc870f38c43dfc4abe8 (patch)
tree393fe706bb12c962915726ee624fdf1718e48789 /CMakeLists.txt
parent5b8bde8e1e97ea597c28e52e88fbc9475e6ea294 (diff)
downloadsubsurface-1e2580c3fd73d5b1ca06ecc870f38c43dfc4abe8.tar.gz
Use SUBSURFACE_TEST_DATA definition to point to test data dir
Update tests with a (compile time) option SUBSURFACE_TEST_DATA, pointing to test data base path. It is needed for cross compilation cases. SUBSURFACE_TEST_DATA is set to SUBSURFACE_SOURCE by default, or configurable via cmake option -DSUBSURFACE_TEST_DATA="...". Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 078de5c7c..9a9e144ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,9 @@ if (${_index} EQUAL -1)
Example: -DSUBSURFACE_TARGET_EXECUTABLE=DesktopExecutable")
endif()
-add_definitions(-DSUBSURFACE_SOURCE="${CMAKE_SOURCE_DIR}")
+# SUBSURFACE_SOURCE may be used in subdirectories (tests)
+set(SUBSURFACE_SOURCE ${CMAKE_SOURCE_DIR})
+add_definitions(-DSUBSURFACE_SOURCE="${SUBSURFACE_SOURCE}")
#evenrything's correct, moving on.
set(CMAKE_MODULE_PATH
@@ -421,7 +423,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# the script we created above is now added as a command to run at
# install time - so this ensures that subsurface.exe has been
# built before this is run
- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DSUBSURFACE_TARGET=${SUBSURFACE_TARGET} -DSUBSURFACE_SOURCE=${CMAKE_SOURCE_DIR} -DSTAGING=${WINDOWSSTAGING} -P ${CMAKE_SOURCE_DIR}/cmake/Modules/dlllist.cmake)")
+ install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DSUBSURFACE_TARGET=${SUBSURFACE_TARGET} -DSUBSURFACE_SOURCE=${SUBSURFACE_SOURCE} -DSTAGING=${WINDOWSSTAGING} -P ${CMAKE_SOURCE_DIR}/cmake/Modules/dlllist.cmake)")
# create the subsurface-x.y.z.exe installer - this needs to depend
# on the install target but cmake doesn't allow that, so we depend