CMake/Tests/TryCompile/Inner/CMakeLists.txt
Brad King 80c947b397 No /fast targets in try_compile project mode
The try_compile command builds the cmTryCompileExec executable using the
cmTryCompileExec/fast target with Makefile generators in order to save
time since dependencies are not needed.  However, in project mode the
command builds an entire source tree that may have dependencies.
Therefore we can use the /fast target approach only in one-source mode.
2009-08-04 14:37:46 -04:00

16 lines
435 B
CMake

cmake_minimum_required(VERSION 2.6)
project(TryCompileInner C)
try_compile(SHOULD_PASS
${TryCompileInner_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
${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)