https://github.com/Kitware/CMake
Raw File
Tip revision: f3e9a6ff62f6f58cd661dd447c22a01c50f6f4ad authored by Brad King on 31 May 2019, 13:18:58 UTC
CMake 3.14.5
Tip revision: f3e9a6f
ResultTest.cmake
message(STATUS "Testing configuration ${activeConfig}.")

macro(TestExists exeName)
  set(exeFile "${dir}/${activeConfig}/${exeName}.exe")
  if(${ARGN} EXISTS "${exeFile}")
    message(STATUS "File ${exeFile} was correctly found ${ARGN} to exist.")
  else()
    message(FATAL_ERROR "File ${exeFile} was expected ${ARGN} to exist!")
  endif()
  set(exeFile "${dir}/${activeConfig}/install/${exeName}.exe")
  if(${ARGN} EXISTS "${exeFile}")
    message(STATUS "File ${exeFile} was correctly found ${ARGN} to exist.")
  else()
    message(FATAL_ERROR "File ${exeFile} was expected ${ARGN} to exist!")
  endif()
endmacro()

TestExists(DefaultBuilt)
TestExists(AlwaysBuilt)
TestExists(NeverBuilt NOT)
foreach(config ${allConfigs})
  if(config STREQUAL activeConfig)
    TestExists(BuiltIn${config})
    TestExists(ExcludedIn${config} NOT)
  else()
    TestExists(BuiltIn${config} NOT)
    TestExists(ExcludedIn${config})
  endif()
endforeach()
back to top