Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Tests / Dependency / Two / CMakeLists.txt
blob587c848f754039e6623ca2e3ed3a11f0d43fc39c
1 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
2 ADD_LIBRARY( Two TwoSrc.c )
3 TARGET_LINK_LIBRARIES( Two Three )
5 # Setup a target to cause failure if Two does not depend on it or if
6 # Two actually links to it.  This will test that a utility dependency
7 # on a library target works properly.
8 ADD_CUSTOM_COMMAND(
9   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/two-test.h
10   COMMAND ${CMAKE_COMMAND} -E copy_if_different
11   ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in
12   ${CMAKE_CURRENT_BINARY_DIR}/two-test.h
13   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in
14   )
15 ADD_LIBRARY( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h)
16 SET_TARGET_PROPERTIES(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1)
17 TARGET_LINK_LIBRARIES(TwoCustom Three)
19 # Add a utility dependency to make sure it works without linking.
20 ADD_DEPENDENCIES(Two TwoCustom)