Re: [CMake] Accessing ${SITE} in CTestConfig.cmake
On Mon, 2018-12-31 at 13:50 -0500, Donald MacQueen [|] wrote: > Thanks very much Kyle. I guess I am not real clear about when vars > should be used as var versus ${var}. Generally speaking, you use var when setting a variable, and ${var} when reading its value. It's a lot like how shell variables are used in bash: foo=bar echo $foo if() and while() break this convention because they were written very early in CMake's history, before there was a concept of variable expansion. However, because of CMP0054, you can put ${var} in quotes: if("${foo}" STREQUAL "bar") and it will have the same effect as: if(foo STREQUAL "bar") See https://cmake.org/cmake/help/latest/policy/CMP0054.html for details. Kyle -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
Re: [CMake] Accessing ${SITE} in CTestConfig.cmake
Thanks very much Kyle. I guess I am not real clear about when vars should be used as var versus ${var}. On 12/31/2018 10:08 AM, Kyle Edwards wrote: On Sat, 2018-12-29 at 09:01 -0500, Donald MacQueen [|] wrote: My machine shows up as M6800 under Site in my remote dashboard. I want to use my local dashboard, so I did this in CTestConfigCTestConfig.cmake: IF (${SITE} STREQUAL "M6800") set(CTEST_DROP_SITE "192.168.49.128") # <--- -- local dashboard ELSE() set(CTEST_DROP_SITE "192.168.10.150") ENDIF() I also tried IF (${CTEST_SITE} STREQUAL "M6800") with no luck. Any ideas? Thanks. -- Donald [|] A bad day in [] is better than a good day in {}. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus Donald, Try this instead: if(CTEST_SITE STREQUAL "M6800") # ... See the documentation for the if() command to understand how to use it: https://cmake.org/cmake/help/latest/command/if.html Kyle -- Donald [|] A bad day in [] is better than a good day in {}. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
Re: [CMake] Accessing ${SITE} in CTestConfig.cmake
On Sat, 2018-12-29 at 09:01 -0500, Donald MacQueen [|] wrote: > My machine shows up as M6800 under Site in my remote dashboard. > > I want to use my local dashboard, so I did this in > CTestConfigCTestConfig.cmake: > > IF (${SITE} STREQUAL "M6800") > set(CTEST_DROP_SITE "192.168.49.128") # <--- > -- > local dashboard > ELSE() > set(CTEST_DROP_SITE "192.168.10.150") > ENDIF() > > I also tried IF (${CTEST_SITE} STREQUAL "M6800") with no luck. > > Any ideas? > > Thanks. > > -- > Donald [|] > A bad day in [] is better than a good day in {}. > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > Donald, Try this instead: if(CTEST_SITE STREQUAL "M6800") # ... See the documentation for the if() command to understand how to use it: https://cmake.org/cmake/help/latest/command/if.html Kyle -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
[CMake] Accessing ${SITE} in CTestConfig.cmake
My machine shows up as M6800 under Site in my remote dashboard. I want to use my local dashboard, so I did this in CTestConfigCTestConfig.cmake: IF (${SITE} STREQUAL "M6800") set(CTEST_DROP_SITE "192.168.49.128") # <- local dashboard ELSE() set(CTEST_DROP_SITE "192.168.10.150") ENDIF() I also tried IF (${CTEST_SITE} STREQUAL "M6800") with no luck. Any ideas? Thanks. -- Donald [|] A bad day in [] is better than a good day in {}. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake