006b8b89803621fd6dfcf5c8f62c16acbe62e058
[platform/upstream/cmake.git] / Tests / RunCMake / try_compile / TargetTypeStatic.cmake
1 enable_language(C)
2 set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
3 try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
4   SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/other.c
5   OUTPUT_VARIABLE out
6   COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/copy
7   COPY_FILE_ERROR copy_err
8   )
9 if(NOT result)
10   message(FATAL_ERROR "try_compile failed:\n${out}")
11 endif()
12 if(copy_err)
13   message(FATAL_ERROR "try_compile COPY_FILE failed:\n${copy_err}")
14 endif()