Notes |
|
(0036358)
|
Brad King
|
2014-07-14 08:49
|
|
It was simply never implemented. We almost never use try_run in practice anymore because it does not work for cross-compiling.
Besides, the whole-project signature of try_compile leaves the build tree around instead of using a temporary directory and then deleting it. That means the binary will be available to try running with execute_process. |
|
|
(0037191)
|
Andrew Aladjev
|
2014-11-12 06:00
|
|
Ok. This works good
cmake_minimum_required (VERSION "2.8")
project ("check" "C")
set (CMAKE_TRY_RUN false CACHE BOOL "try run targets after build")
add_executable (
"main"
"${CMAKE_CURRENT_SOURCE_DIR}/main.c"
)
if (${CMAKE_TRY_RUN})
add_custom_command(
TARGET "main"
POST_BUILD
COMMAND "./main"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Running main"
)
endif () |
|
|
(0042585)
|
Kitware Robot
|
2016-06-10 14:29
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|