cmake/Tests/TryCompile/Inner/CMakeLists.txt

16 lines
405 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
cmake_minimum_required(VERSION 2.8.12)
2009-10-04 10:30:41 +03:00
project(TryCompileInner C)
try_compile(SHOULD_PASS
2022-08-04 22:12:04 +02:00
${TryCompileInner_BINARY_DIR}
2009-10-04 10:30:41 +03:00
${TryCompileInner_SOURCE_DIR}/../pass.c
OUTPUT_VARIABLE TRY_OUT
)
if(NOT SHOULD_PASS)
message(FATAL_ERROR "Inner try-compile SHOULD_PASS failed!")
endif()
add_library(innerlib innerlib.c)
add_executable(innerexe innerexe.c)
target_link_libraries(innerexe innerlib)