[Cmake-commits] [cmake-commits] hoffman committed BundleLib.cxx 1.3 1.3.10.1 BundleTest.cxx 1.3 1.3.12.1 CMakeLists.txt 1.8.2.1 1.8.2.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Sep 3 09:43:24 EDT 2008
Update of /cvsroot/CMake/CMake/Tests/BundleTest
In directory public:/mounts/ram/cvs-serv18450/Tests/BundleTest
Modified Files:
Tag: CMake-2-6
BundleLib.cxx BundleTest.cxx CMakeLists.txt
Log Message:
ENH: 2.6.2 rc 2 merge from main tree
Index: BundleTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BundleTest/BundleTest.cxx,v
retrieving revision 1.3
retrieving revision 1.3.12.1
diff -C 2 -d -r1.3 -r1.3.12.1
*** BundleTest.cxx 28 Mar 2006 18:23:10 -0000 1.3
--- BundleTest.cxx 3 Sep 2008 13:43:21 -0000 1.3.12.1
***************
*** 1,4 ****
--- 1,6 ----
#include <stdio.h>
+ #include <Carbon/Carbon.h>
+
extern int foo(char* exec);
***************
*** 6,9 ****
--- 8,20 ----
{
printf("Started with: %d arguments\n", argc);
+
+ // Call a "Carbon" function... but pull in the link dependency on "-framework
+ // Carbon" via CMake's dependency chaining mechanism. This code exists to
+ // verify that the chaining mechanism works with "-framework blah" style
+ // link dependencies.
+ //
+ CFBundleRef br = CFBundleGetMainBundle();
+ (void) br;
+
return foo(argv[0]);
}
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BundleTest/CMakeLists.txt,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -C 2 -d -r1.8.2.1 -r1.8.2.2
*** CMakeLists.txt 25 Mar 2008 23:58:59 -0000 1.8.2.1
--- CMakeLists.txt 3 Sep 2008 13:43:22 -0000 1.8.2.2
***************
*** 18,22 ****
SET_SOURCE_FILES_PROPERTIES(
SomeRandomFile.txt
! "${CMake_SOURCE_DIR}/ChangeLog.txt"
PROPERTIES
MACOSX_PACKAGE_LOCATION MacOS
--- 18,22 ----
SET_SOURCE_FILES_PROPERTIES(
SomeRandomFile.txt
! "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt"
PROPERTIES
MACOSX_PACKAGE_LOCATION MacOS
***************
*** 25,39 ****
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
! # Test building a bundle linking to a shared library.
ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
ADD_EXECUTABLE(BundleTest
MACOSX_BUNDLE
BundleTest.cxx
SomeRandomFile.txt
! "${CMake_SOURCE_DIR}/ChangeLog.txt"
"${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
)
-
TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
# Test bundle installation.
--- 25,50 ----
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
! # Test building a bundle linking to a shared library where the
! # shared library links to Carbon, but the executable does not
! # explicitly link to Carbon, but the executable does *depend*
! # on Carbon. There should be a link failure for the executable
! # if CMake's dependency chaining for libraries with "-framework
! # blah" style dependencies gets broken...
! #
ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
+ TARGET_LINK_LIBRARIES(BundleTestLib "-framework Carbon")
+
ADD_EXECUTABLE(BundleTest
MACOSX_BUNDLE
BundleTest.cxx
SomeRandomFile.txt
! "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt"
"${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
)
TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
+ #
+ # DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework Carbon")
+ # (see above comments about Carbon)
+ #
# Test bundle installation.
Index: BundleLib.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BundleTest/BundleLib.cxx,v
retrieving revision 1.3
retrieving revision 1.3.10.1
diff -C 2 -d -r1.3 -r1.3.10.1
*** BundleLib.cxx 5 Jul 2006 20:27:44 -0000 1.3
--- BundleLib.cxx 3 Sep 2008 13:43:19 -0000 1.3.10.1
***************
*** 4,7 ****
--- 4,9 ----
#include <unistd.h>
+ #include <Carbon/Carbon.h>
+
int fileExists(char* filename)
{
***************
*** 50,53 ****
--- 52,60 ----
int foo(char *exec)
{
+ // Call a "Carbon" function...
+ //
+ CFBundleRef br = CFBundleGetMainBundle();
+ (void) br;
+
int res1 = findBundleFile(exec, "Resources/randomResourceFile.plist");
int res2 = findBundleFile(exec, "MacOS/SomeRandomFile.txt");
More information about the Cmake-commits
mailing list