diff options
Diffstat (limited to 'Tests/LoadCommand/CMakeLists.txt')
-rw-r--r-- | Tests/LoadCommand/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index 24f9859..c6706f9 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -22,10 +22,17 @@ CONFIGURE_FILE(${LoadedCommand_SOURCE_DIR}/LoadedCommand.h.in INCLUDE_DIRECTORIES(${LoadedCommand_BINARY_DIR}) # try to compile the command -TRY_COMPILE(COMPILE_OK +# make sure it is not already loaded +IF(COMMAND CMAKE_TEST_COMMAND) +ELSE(COMMAND CMAKE_TEST_COMMAND) + TRY_COMPILE(COMPILE_OK ${LoadedCommand_BINARY_DIR}/CMakeCommands ${LoadedCommand_SOURCE_DIR}/CMakeCommands - CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO) + CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO + OUTPUT_VARIABLE OUTPUT ) +ENDIF(COMMAND CMAKE_TEST_COMMAND) + +MESSAGE("Output from try compile: ${OUTPUT}") # if the compile was OK, try loading the command IF (COMPILE_OK) |