summaryrefslogtreecommitdiffstats
path: root/Tests/TryCompile/Inner/CMakeLists.txt
blob: 262662dbe04ba4fc3c19acbe3262573fe0298e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cmake_minimum_required(VERSION 3.5)
project(TryCompileInner C)

try_compile(SHOULD_PASS
    ${TryCompileInner_BINARY_DIR}
    ${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)