summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/dlllist.cmake
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-17 15:50:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-17 15:59:15 -0800
commitc7278cd9ed2450d9137cd432f77a135a3730dec4 (patch)
treef8b2393f573785c30d3387d5518d6a72142c955f /cmake/Modules/dlllist.cmake
parent63290e31551329d27846b2fb06010b802cbb8264 (diff)
downloadsubsurface-c7278cd9ed2450d9137cd432f77a135a3730dec4.tar.gz
Cmake: adjust dlllist.cmake to no longer be created on the fly
Because of this a bunch of variables need to be passed in and the quoting changes in rather subtle ways. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'cmake/Modules/dlllist.cmake')
-rw-r--r--cmake/Modules/dlllist.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmake/Modules/dlllist.cmake b/cmake/Modules/dlllist.cmake
index 0bf621a8a..bfe50b137 100644
--- a/cmake/Modules/dlllist.cmake
+++ b/cmake/Modules/dlllist.cmake
@@ -9,10 +9,11 @@ execute_process(
# figure out where we should search for libraries
execute_process(
COMMAND ${CMAKE_C_COMPILER} -print-search-dirs
- COMMAND sed -nE "/^libraries: =/{s///;s,/lib/?\\\(:|\\\$\\\$\\\),/bin\\\\1,g;p;q;}"
+ COMMAND sed -nE "/^libraries: =/{s///;s,/lib/?\(:|\$\$\),/bin\\1,g;p;q;}"
OUTPUT_VARIABLE ADDPATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
+message(STATUS "addpath is ${ADDPATH}")
# since cmake doesn't appear to give us a variable with
# all libraries we link against, grab the link.txt script
# instead and drop the command name from it (before the
@@ -20,20 +21,20 @@ execute_process(
# linker used contains a space...
execute_process(
COMMAND tail -1 CMakeFiles/subsurface.dir/link.txt
- COMMAND cut -d\\ -f 2-
+ COMMAND cut -d\ -f 2-
OUTPUT_VARIABLE LINKER_LINE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# finally run our win-ldd.pl script against that to
# collect all the required dlls
execute_process(
- COMMAND sh -c "OBJDUMP=${OBJDUMP}-objdump PATH=$ENV{PATH}:${ADDPATH} perl ${CMAKE_SOURCE_DIR}/scripts/win-ldd.pl ${SUBSURFACE_TARGET}.exe ${LINKER_LINE}"
+ COMMAND sh -c "OBJDUMP=${OBJDUMP}-objdump PATH=$ENV{PATH}:${ADDPATH} perl ${SUBSURFACE_SOURCE}/scripts/win-ldd.pl ${SUBSURFACE_TARGET}.exe ${LINKER_LINE}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_VARIABLE DLLS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# replace newlines with semicolons so this is a cmake list
-string(REPLACE "\\n" ";" DLLLIST ${DLLS})
+string(REPLACE "\n" ";" DLLLIST ${DLLS})
# executing 'install' as a command seems hacky, but you
# can't use the install() cmake function in a script
foreach(DLL ${DLLLIST})