~ubuntu-branches/ubuntu/jaunty/cmake/jaunty-security

« back to all changes in this revision

Viewing changes to Tests/BundleTest/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2006-06-18 16:34:11 UTC
  • mfrom: (1.4.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060618163411-pi234s3v6jwlcmof
Tags: 2.4.2-1
* New upstream release (Closes: #338324)
* Put cmake .vim files into /usr/share/vim/addons/plugin/
  where they can be used. (Closes: #366663)
* Install cmake-mode.el so it can be used. (Closes: #366664)
* Ensure cmake FindKDE locates KDE libraries on Debian
  based distributions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
PROJECT(BundleTest)
2
2
SET(MACOSX_BUNDLE_INFO_STRING "bundle_info_string")
3
 
ADD_EXECUTABLE(BundleTest MACOSX_BUNDLE BundleTest.cxx)
4
 
 
 
3
SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
 
4
 
 
5
ADD_CUSTOM_COMMAND(
 
6
  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
 
7
  COMMAND /bin/cp
 
8
  ARGS "${CMAKE_CURRENT_SOURCE_DIR}/randomResourceFile.plist.in"
 
9
  "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist")
 
10
 
 
11
SET_SOURCE_FILES_PROPERTIES(
 
12
  "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
 
13
  PROPERTIES
 
14
  MACOSX_PACKAGE_LOCATION Resources
 
15
  )
 
16
 
 
17
SET_SOURCE_FILES_PROPERTIES(
 
18
  SomeRandomFile.txt
 
19
  PROPERTIES
 
20
  MACOSX_PACKAGE_LOCATION MacOS
 
21
  )
 
22
 
 
23
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
 
24
 
 
25
# Test building a bundle linking to a shared library.
 
26
ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
 
27
ADD_EXECUTABLE(BundleTest
 
28
  MACOSX_BUNDLE
 
29
  BundleTest.cxx
 
30
  SomeRandomFile.txt
 
31
  "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
 
32
  )
 
33
 
 
34
TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
 
35
 
 
36
# Test bundle installation.
 
37
INSTALL(TARGETS BundleTestLib DESTINATION Application/BundleTestExe.app/Contents/Plugins)
 
38
INSTALL(TARGETS BundleTest DESTINATION Application)
 
39
 
 
40
# Test whether bundles respect the output name.  Since the library is
 
41
# installed into a location that uses this output name this will fail if the
 
42
# bundle does not respect the name.  Also the executable will not be found by
 
43
# the test driver if this does not work.
 
44
SET_TARGET_PROPERTIES(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
 
45
 
 
46
# Test executable versioning if it is supported.
 
47
IF(NOT XCODE)
 
48
  SET_TARGET_PROPERTIES(BundleTest PROPERTIES VERSION 1)
 
49
ENDIF(NOT XCODE)
 
50
 
 
51
# Make sure the executable can find its installed library.
 
52
SET_TARGET_PROPERTIES(BundleTestLib PROPERTIES
 
53
  INSTALL_NAME_DIR "@executable_path/../Plugins")
 
54
 
 
55
INCLUDE(CPack)
 
56
 
 
57
# test the framework find stuff
 
58
IF(EXISTS /usr/lib/libtcl.dylib
 
59
    AND EXISTS /System/Library/Frameworks/tcl.framework)
 
60
  SET(TCL NOTFOUND)
 
61
  FIND_LIBRARY(TCL tcl)
 
62
  MESSAGE("frame: ${TCL}")
 
63
  IF(NOT "${TCL}" MATCHES .framework)
 
64
    MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
 
65
  ENDIF(NOT "${TCL}" MATCHES .framework)
 
66
  SET(TCL NOTFOUND)
 
67
  SET(CMAKE_FIND_FRAMEWORK LAST)
 
68
  FIND_LIBRARY(TCL tcl)
 
69
  IF("${TCL}" MATCHES .framework)
 
70
    MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
 
71
  ENDIF("${TCL}" MATCHES .framework)
 
72
  SET(TCL NOTFOUND)
 
73
  SET(CMAKE_FIND_FRAMEWORK NEVER)
 
74
  FIND_LIBRARY(TCL tcl)
 
75
  IF("${TCL}" MATCHES .framework)
 
76
    MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
 
77
  ENDIF("${TCL}" MATCHES .framework)
 
78
  MESSAGE("not frame: ${TCL}")
 
79
  SET(TCL NOTFOUND)
 
80
  SET(CMAKE_FIND_FRAMEWORK FIRST)
 
81
  FIND_LIBRARY(TCL tcl)
 
82
  IF(NOT "${TCL}" MATCHES .framework)
 
83
    MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
 
84
  ENDIF(NOT "${TCL}" MATCHES .framework)
 
85
  MESSAGE("frame: ${TCL}")
 
86
ENDIF(EXISTS /usr/lib/libtcl.dylib
 
87
  AND EXISTS /System/Library/Frameworks/tcl.framework)