[CMake] Setting test environment on windows

Petr Kmoch petr.kmoch at gmail.com
Wed Oct 10 08:40:06 EDT 2012


Hi Jakub.

I would try adding quotes around the dereference of THIRD_PARTY_LIBS. That
is:
set_properties(... PATH="${THIRD_PARTY_LIBS}" ...)

Petr

On Wed, Oct 10, 2012 at 2:13 PM, Jakub Zakrzewski <jzakrzewski at e2e.ch>wrote:

> Hi All.
>
> Could someone explain to me, how properly set environment for CTest from
> CMakeLists.txt?
>
> Ihave something like:
>
> set(THIRD_PARTY_LIBS "${THIRD_PARTY_LIBS};${JAVA_JVM_LIBRARY_PATH}");
> set_properties(TEST myTest PROPERTY ENVIRONMENT
>   BRIDGESERVER_BIN=${PROJECT_SOURCE_DIR}/src/AddOns/PersistentState
>   PATH=${THIRD_PARTY_LIBS}
>   INSTANCES_HOME=${CMAKE_BINARY_DIR}
>   INSTANCE_HOME=${CMAKE_BINARY_DIR}
> )
>
> This gets expanded to:
> SET_TESTS_PROPERTIES(ut PROPERTIES  ENVIRONMENT
> "BRIDGESERVER_BIN=D:/Projects/e2e_bridge/server/head/src/AddOns/PersistentState;PATH=D:/Projects/e2e_bridge/server/head/bin/win64-debug;C:/Program
> Files/Java/jdk1.6.0_30/lib/../jre/bin/server;INSTANCES_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug;INSTANCE_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug")
>
> Which is wrong (note the semicolon). Below are my trials and their results:
>
>
> #1st
> set(THIRD_PARTY_LIBS "${THIRD_PARTY_LIBS}\;${JAVA_JVM_LIBRARY_PATH}");
>
> SET_TESTS_PROPERTIES(ut PROPERTIES  ENVIRONMENT
> "BRIDGESERVER_BIN=D:/Projects/e2e_bridge/server/head/src/AddOns/PersistentState;PATH=D:/Projects/e2e_bridge/server/head/bin/win64-debug;C:/Program
> Files/Java/jdk1.6.0_30/lib/../jre/bin/server;INSTANCES_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug;INSTANCE_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug")
>
> #2nd
> set(THIRD_PARTY_LIBS "${THIRD_PARTY_LIBS}\\;${JAVA_JVM_LIBRARY_PATH}");
>
> SET_TESTS_PROPERTIES(ut PROPERTIES  ENVIRONMENT
> "BRIDGESERVER_BIN=D:/Projects/e2e_bridge/server/head/src/AddOns/PersistentState;PATH=D:/Projects/e2e_bridge/server/head/bin/win64-debug;C:/Program
> Files/Java/jdk1.6.0_30/lib/../jre/bin/server;INSTANCES_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug;INSTANCE_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug")
>
> #3rd
> set(THIRD_PARTY_LIBS "${THIRD_PARTY_LIBS}\\\;${JAVA_JVM_LIBRARY_PATH}");
>
> SET_TESTS_PROPERTIES(ut PROPERTIES  ENVIRONMENT
> "BRIDGESERVER_BIN=D:/Projects/e2e_bridge/server/head/src/AddOns/PersistentState;PATH=D:/Projects/e2e_bridge/server/head/bin/win64-debug\\\\;C:/Program
> Files/Java/jdk1.6.0_30/lib/../jre/bin/server;INSTANCES_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug;INSTANCE_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug")
>
> #4th
> set(THIRD_PARTY_LIBS "${THIRD_PARTY_LIBS}\\\\;${JAVA_JVM_LIBRARY_PATH}");
>
> SET_TESTS_PROPERTIES(ut PROPERTIES  ENVIRONMENT
> "BRIDGESERVER_BIN=D:/Projects/e2e_bridge/server/head/src/AddOns/PersistentState;PATH=D:/Projects/e2e_bridge/server/head/bin/win64-debug\\\\;C:/Program
> Files/Java/jdk1.6.0_30/lib/../jre/bin/server;INSTANCES_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug;INSTANCE_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug")
>
> #5th
> set(THIRD_PARTY_LIBS "${THIRD_PARTY_LIBS}\\\\\;${JAVA_JVM_LIBRARY_PATH}");
>
> SET_TESTS_PROPERTIES(ut PROPERTIES  ENVIRONMENT
> "BRIDGESERVER_BIN=D:/Projects/e2e_bridge/server/head/src/AddOns/PersistentState;PATH=D:/Projects/e2e_bridge/server/head/bin/win64-debug\\\\;C:/Program
> Files/Java/jdk1.6.0_30/lib/../jre/bin/server;INSTANCES_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug;INSTANCE_HOME=D:/Projects/e2e_bridge/server/head/build/win64-debug")
>
> I don't understand, the logic of escaping here.
> --
> Gruesse,
> Jakub
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121010/f57b38d5/attachment.htm>


More information about the CMake mailing list