1 cmake_minimum_required (VERSION 2.6)
4 # We need ansi C support.
6 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
7 endif(CMAKE_ANSI_CFLAGS)
9 # Import targets from the exported build tree.
10 include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake)
12 # Import targets from the exported install tree.
13 include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake)
15 # Try referencing an executable imported from the install tree.
17 OUTPUT ${Import_BINARY_DIR}/exp_generated.c
18 COMMAND exp_testExe1 ${Import_BINARY_DIR}/exp_generated.c
22 OUTPUT ${Import_BINARY_DIR}/exp_generated3.c
23 COMMAND exp_testExe3 ${Import_BINARY_DIR}/exp_generated3.c
27 add_executable(imp_testExe1
29 ${Import_BINARY_DIR}/exp_generated.c
30 ${Import_BINARY_DIR}/exp_generated3.c
33 # Try linking to a library imported from the install tree.
34 target_link_libraries(imp_testExe1 exp_testLib2 exp_testLib3 exp_testLib4)
36 # Try building a plugin to an executable imported from the install tree.
37 add_library(imp_mod1 MODULE imp_mod1.c)
38 target_link_libraries(imp_mod1 exp_testExe2)
40 # Try referencing an executable imported from the build tree.
42 OUTPUT ${Import_BINARY_DIR}/bld_generated.c
43 COMMAND bld_testExe1 ${Import_BINARY_DIR}/bld_generated.c
47 OUTPUT ${Import_BINARY_DIR}/bld_generated3.c
48 COMMAND bld_testExe3 ${Import_BINARY_DIR}/bld_generated3.c
52 add_executable(imp_testExe1b
54 ${Import_BINARY_DIR}/bld_generated.c
55 ${Import_BINARY_DIR}/bld_generated3.c
58 # Try linking to a library imported from the build tree.
59 target_link_libraries(imp_testExe1b bld_testLib2 bld_testLib3 bld_testLib4)
61 # Try building a plugin to an executable imported from the build tree.
62 add_library(imp_mod1b MODULE imp_mod1.c)
63 target_link_libraries(imp_mod1b bld_testExe2)
65 # Export/CMakeLists.txt pretends the RelWithDebInfo (as well as Debug)
66 # configuration should link to debug libs.
67 foreach(c DEBUG RELWITHDEBINFO)
68 set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
69 set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)