~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Tests/ExportImport/Export/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
cmake_minimum_required (VERSION 2.6)
2
 
project(Export C)
3
 
 
4
 
# We need ansi C support.
5
 
if(CMAKE_ANSI_CFLAGS)
6
 
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
7
 
endif(CMAKE_ANSI_CFLAGS)
 
1
cmake_minimum_required (VERSION 2.7.20090711)
 
2
project(Export C CXX)
8
3
 
9
4
# Pretend that RelWithDebInfo should link to debug libraries to test
10
5
# the DEBUG_CONFIGURATIONS property.
36
31
set_property(TARGET testLib3 PROPERTY VERSION 1.2)
37
32
set_property(TARGET testLib3 PROPERTY SOVERSION 3)
38
33
 
 
34
# Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME[_<CONFIG>] properties.
 
35
set_property(TARGET testLib3 PROPERTY RUNTIME_OUTPUT_NAME_DEBUG testLib3dll-d)
 
36
set_property(TARGET testLib3 PROPERTY RUNTIME_OUTPUT_NAME_RELEASE testLib3dll-r)
 
37
set_property(TARGET testLib3 PROPERTY RUNTIME_OUTPUT_NAME testLib3dll)
 
38
set_property(TARGET testLib3 PROPERTY LIBRARY_OUTPUT_NAME_DEBUG testLib3lib-d)
 
39
set_property(TARGET testLib3 PROPERTY LIBRARY_OUTPUT_NAME_RELEASE testLib3lib-r)
 
40
set_property(TARGET testLib3 PROPERTY LIBRARY_OUTPUT_NAME testLib3lib)
 
41
set_property(TARGET testLib3 PROPERTY ARCHIVE_OUTPUT_NAME testLib3import)
 
42
 
39
43
add_library(testLib4 SHARED testLib4.c)
40
44
set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
41
45
 
 
46
add_library(testLib5 SHARED testLib5.c)
 
47
 
 
48
add_library(testLib6 STATIC testLib6.cxx testLib6c.c)
 
49
 
42
50
# Work-around: Visual Studio 6 does not support per-target object files.
43
51
set(VS6)
44
52
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
65
73
add_executable(testExe3 testExe3.c)
66
74
set_property(TARGET testExe3 PROPERTY MACOSX_BUNDLE 1)
67
75
 
 
76
# Test cyclic dependencies.
 
77
add_library(testLibCycleA STATIC
 
78
  testLibCycleA1.c testLibCycleA2.c testLibCycleA3.c)
 
79
add_library(testLibCycleB STATIC
 
80
  testLibCycleB1.c testLibCycleB2.c testLibCycleB3.c)
 
81
target_link_libraries(testLibCycleA testLibCycleB)
 
82
target_link_libraries(testLibCycleB testLibCycleA)
 
83
set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
 
84
 
68
85
# Install and export from install tree.
69
86
install(
70
87
  TARGETS
71
88
  testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3
72
89
  testExe2lib testLib4lib testLib4libdbg testLib4libopt
 
90
  testLib6
 
91
  testLibCycleA testLibCycleB
73
92
  EXPORT exp
74
93
  RUNTIME DESTINATION bin
75
94
  LIBRARY DESTINATION lib NAMELINK_SKIP
85
104
  LIBRARY DESTINATION lib/impl
86
105
  ARCHIVE DESTINATION lib/impl
87
106
  )
 
107
install(
 
108
  TARGETS testLib5
 
109
  EXPORT exp
 
110
  # Leave out RUNTIME DESTINATION to test implib-only export.
 
111
  LIBRARY DESTINATION lib
 
112
  ARCHIVE DESTINATION lib
 
113
  )
88
114
install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
89
115
 
 
116
# Install testLib5.dll outside the export.
 
117
if(WIN32)
 
118
  install(TARGETS testLib5 RUNTIME DESTINATION bin)
 
119
endif(WIN32)
 
120
 
90
121
# Export from build tree.
91
122
export(TARGETS testExe1 testLib1 testLib2 testLib3
92
123
  testExe2libImp testLib3Imp
93
124
  NAMESPACE bld_
94
125
  FILE ExportBuildTree.cmake
95
126
  )
96
 
export(TARGETS testExe2 testLib4 testExe3 testExe2lib
 
127
export(TARGETS testExe2 testLib4 testLib5 testLib6 testExe3 testExe2lib
97
128
  testLib4lib testLib4libdbg testLib4libopt
 
129
  testLibCycleA testLibCycleB
98
130
  NAMESPACE bld_
99
131
  APPEND FILE ExportBuildTree.cmake
100
132
  )