Re: [cmake-developers] Support for imported targets in CMAKE_REQUIRED_LIBRARIES
On 1/18/2012 4:24 PM, Alexander Neundorf wrote: On Wednesday 18 January 2012, Alexander Neundorf wrote: Hi, the variable CMAKE_REQUIRED_LIBRARIES is used by several of the check-modules for listing additional libraries which should be linked. It is common to use variables set by Find-modules for this, e.g. set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES} ) Now, if the module did not simply set JPEG_LIBRARIES to the full path, but instead created an imported target, e.g. FindJPEG::libjpeg, this leads to a problem. The check-modules will simply append this to the linker command, so there will be -lFindJPEG::libjpeg, which will not work. This actually happened in KDE the first time more than 2 years ago. On cmake stage there is now a branch HandleTargetsInCMakeRequiredLibraries, where I ported the solution from KDE to CMake and applied it to all places where CMAKE_REQUIRED_LIBRARIES is used. I did not test it yet (but it should work, since it is exactly the same as in KDE). Please have a look at it. It's here: http://cmake.org/gitweb?p=stage/cmake.git;a=log;h=refs/heads/HandleTargetsInCMakeRequiredLibraries When inspecting the IMPORTED_CONFIGURATIONS, rather than choosing the first one might you honor CMAKE_TRY_COMPILE_CONFIGURATION? Does it handle link-interface libraries recursively? I think a full solution to this will end up duplicating a lot of the logic that CMake already has in its C++ code for link dependency analysis. I wonder if instead you could modify the signature of try_compile to accept the LINK_LIBRARIES as a formal argument. Then teach the C++ code to resolve the imported targets and take care of the link interfaces. -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] [CMake 0012887]: FindBoost: ${Boost_LIBRARIES} contains extra 'optimized' and 'debug' key words making impossible install
The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=12887 == Reported By:sutasu Assigned To: == Project:CMake Issue ID: 12887 Category: Modules Reproducibility:always Severity: major Priority: normal Status: new == Date Submitted: 2012-01-19 16:37 WAST Last Modified: 2012-01-19 16:37 WAST == Summary:FindBoost: ${Boost_LIBRARIES} contains extra 'optimized' and 'debug' key words making impossible install Description: The same issue was reported in bug http://public.kitware.com/Bug/view.php?id=12188 but fixed on unix only. Please refer to mention bug for details. == Issue History Date ModifiedUsername FieldChange == 2012-01-19 16:37 sutasu New Issue == -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] FindPythonInterp.cmake an different major versions
On 1/18/2012 12:31 PM, Rolf Eike Beer wrote: Brad King wrote: Therefore I would expect find_package(PythonInterp 2) to find a python interpreter compatible with version 2, which does not include version 3. You just can't use the normal version check from the standard find helper module. Ok, built it that way. It is. I've pushed an implementation to topic python-version on stage. If noone objects I'll merge it to next at the end of the week. I just read through the implementation. The approach looks good to me. I didn't test it in-depth though. Thanks! -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] [CMake 0012900]: Sequence of pathes for Qt
The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=12900 == Reported By:Oleg Assigned To: == Project:CMake Issue ID: 12900 Category: Modules Reproducibility:always Severity: minor Priority: normal Status: new == Date Submitted: 2012-01-20 01:57 EST Last Modified: 2012-01-20 01:57 EST == Summary:Sequence of pathes for Qt Description: First of all Path to Qt searches in register which brings some problerms with sevral Qt verstion. I think, that it will be very good if first of all Qt path searches in QTDIR and only then in register and others == Issue History Date ModifiedUsername FieldChange == 2012-01-20 01:57 Oleg New Issue == -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] valgrind errors
Bill Hoffman wrote: We seems to have some valgrind errors on the dashboard: http://www.cdash.org/CDash/viewDynamicAnalysisFile.php?id=2554459 Seems to have started with this day: http://www.cdash.org/CDash/viewChanges.php?project=CMakedate=2011-11-12 http://www.cdash.org/CDash/viewUpdate.php?buildid=1717708 I think it might be this find module change that has exposed the issue: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f30f9a500c5e5aeb053c41307 dab9987735570dd Looks like the status is somehow not getting set for a call to message. While the reason for this occurrence has been long fixed, I just pushed the topic uninitialized-var-in-if into next that fixed the underlying problem. This introduced a new directory Tests/Syntax and a first tests there. It does if (NOT foo bar STREQUAL foo bar) and triggers this error, which now does not use an unitinialized variable anymore. Since it's a clear syntax error I set it to be a FATAL_ERROR. I think we should put more such tests in there, would easily allow us to increase coverage as e.g. in cmIfCommand many error branches are currently not part of the coverage. Eike -- signature.asc Description: This is a digitally signed message part. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] Install an executable with his libraries
Thank you Eric for this link, but I don't really understand how to use RPATH with CMake. Could you provide me piece of advice for my case? 2012/1/18 Eric Noulard eric.noul...@gmail.com 2012/1/18 Anthony Todisco todisco.anthony...@gmail.com: Thank you very much, it works fine now :D. I've missed this step :/ On Unix you can configure RPATH in order to avoid the LD_LIBRARY_PATH update and/or tolerate more easily multiple version of the same lib for different executable. Have a look at: http://www.cmake.org/Wiki/CMake_RPATH_handling -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Install an executable with his libraries
2012/1/19 Anthony Todisco todisco.anthony...@gmail.com: Thank you Eric for this link, but I don't really understand how to use RPATH with CMake. The RPATH usage control with CMake is done using 4 variables: CMAKE_SKIP_BUILD_RPATH CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_INSTALL_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH you can get the document of each of those vars with cmake --help-variable VarName Could you provide me piece of advice for my case? RPATH is a Unix way to put inside a binary executable an explicit link to the libraries on which this executable depends. In your case the Manager executable depends on the BaseLib, ComposeLib and phtread as stated by your target_link_libraries( Manager BaseLib ComposeLib pthread ) when you run Manager the system thus need to load the BaseLib, ComposeLib and phtread libs. phtread is [probably] found automatically because it is installed system-wide and I won't explain that. BaseLib and ComposeLib are built in your project. CMake knows all of this, then: in the build tree it uses RPATH in order to make Manager run easily without fiddling with LD_LIBRARY_PATH. At the install location (/usr/local/... in your case) CMake does not setup RPATH inside the **installed** executable unless you tell him to do so, by specifying the install rpath: SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) from http://www.cmake.org/Wiki/CMake_RPATH_handling; you can read when installing all executables and shared libraries will be relinked, so they will find all libraries they need by the way you should NOT do that: #Define link libraries folder link_directories(../../Bin/${BUILD_PATH}) this should not be necessary, see: cmake --help-command link_directories -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Debian source package build/install
Hi all, For uploading to launchpad/PPA, I'm making a source-package with a cmake-script I found by googling: https://github.com/aewallin/opencamlib/blob/master/src/DebSourcePPA.cmake (please do let me know if there is a better way to build a debian source package with cmake!) It seems to work, and the build completes, but the install fails: https://launchpadlibrarian.net/90444102/buildlog_ubuntu-oneiric-i386.opencamlib_11.10.13-ubuntu1~oneiric1_FAILEDTOBUILD.txt.gz (the error is at the very end of this file) This error is reproducible on my local machine with pbuilder. The debian rules call cmake_install.cmake like this: cmake -DCOMPONENT=Unspecified -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr -P cmake_install.cmake and line 44 of cmake_install.cmake that gives an error is FILE(INSTALL DESTINATION /usr/lib/python2.7/dist-packages TYPE MODULE FILES /tmp/buildd/opencamlib-11.10.13/build_dir/ocl.so) the whole cmake_install.cmake file is here http://pastebin.com/NS6wmHxa I don't see how it uses CMAKE_INSTALL_PREFIX at all? cmake_install.cmake is produced from my CMakeLists.txt like this: execute_process( COMMAND python -c from distutils.sysconfig import get_python_lib; print get_python_lib() OUTPUT_VARIABLE Python_site_packages OUTPUT_STRIP_TRAILING_WHITESPACE # on Ubuntu 11.10 this outputs: /usr/lib/python2.7/dist-packages ) install( TARGETS ocl LIBRARY DESTINATION ${Python_site_packages} ) All of this works fine on a normal Ubuntu install, the install-failure only shows up on launchpad and locally with pbuilder. Any ideas on how to resolve this? thanks, Anders -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Debian source package build/install
On 19.01.12 19:39:09, Anders Wallin wrote: Hi all, For uploading to launchpad/PPA, I'm making a source-package with a cmake-script I found by googling: https://github.com/aewallin/opencamlib/blob/master/src/DebSourcePPA.cmake (please do let me know if there is a better way to build a debian source package with cmake!) It seems to work, and the build completes, but the install fails: https://launchpadlibrarian.net/90444102/buildlog_ubuntu-oneiric-i386.opencamlib_11.10.13-ubuntu1~oneiric1_FAILEDTOBUILD.txt.gz (the error is at the very end of this file) This error is reproducible on my local machine with pbuilder. The debian rules call cmake_install.cmake like this: cmake -DCOMPONENT=Unspecified -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr -P cmake_install.cmake and line 44 of cmake_install.cmake that gives an error is FILE(INSTALL DESTINATION /usr/lib/python2.7/dist-packages TYPE MODULE FILES /tmp/buildd/opencamlib-11.10.13/build_dir/ocl.so) the whole cmake_install.cmake file is here http://pastebin.com/NS6wmHxa I don't see how it uses CMAKE_INSTALL_PREFIX at all? Of course not, because you're giving CMake an absolute path, thats your error. cmake_install.cmake is produced from my CMakeLists.txt like this: execute_process( COMMAND python -c from distutils.sysconfig import get_python_lib; print get_python_lib() OUTPUT_VARIABLE Python_site_packages OUTPUT_STRIP_TRAILING_WHITESPACE # on Ubuntu 11.10 this outputs: /usr/lib/python2.7/dist-packages ) install( TARGETS ocl LIBRARY DESTINATION ${Python_site_packages} ) See the manual for install, the problem is that you're setting an absolute path here, this path will be used by CMake then for installation. What you probably really want is a path relative to whatever the 'prefix' was when python was installed (in this case /usr, but maybe there's a way to query python for that, dunno). If you then use a relative path here, it'll respect CMAKE_INSTALL_PREFIX (and DESTDIR during the make-call). Andreas -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Compile multiple-sources at a time?
I realize not every build environment supports the option, but is there a way to get CMake to generate Makefiles which aggregate source files, e.g. $ g++ -pipe -o library.a lib1.cpp lib2.cpp lib3.cpp $ g++ -pipe -o exeutable file1.cpp file2.cpp file3.cpp library.a - Oliver -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Compile multiple-sources at a time?
2012/1/19 Oliver kfsone Smith osm...@playnet.com: I realize not every build environment supports the option, but is there a way to get CMake to generate Makefiles which aggregate source files, e.g. $ g++ -pipe -o library.a lib1.cpp lib2.cpp lib3.cpp $ g++ -pipe -o exeutable file1.cpp file2.cpp file3.cpp library.a I don't think so. Why do you want to do that? Are you seeking for performance? Thus the -pipe option? CMake generates makefiles that handle the -j option of make quite nicely? -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Cmake / NSIS: escape parenthesis
Hello, I would like to add the following statements in my nsis installer: list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${If} ${RunningX64} DetailPrint 'DEBUG: Windows 64 bits: RunningX64 = ${RunningX64}' ${Else} DetailPrint 'DEBUG: Windows 32 bits: RunningX64 = ${RunningX64}' ${EndIf} ) This would be written verbatim in the nsis code. But cmake interprets ${If} as getting the value of If. Now, in my nsis code, I've got: DetailPrint 'DEBUG: Windows 64 bits: RunningX64 = ' DetailPrint 'DEBUG: Windows 32 bits: RunningX64 = ' Which is not correct. So, my question is: how do I protect the { and } characters ? Best regards, YC -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Cmake / NSIS: escape parenthesis
Argh ! Answer to my own question: list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS !include LogicLib.nsh !include x64.nsh \\\${If} \\\${RunningX64} DetailPrint 'DEBUG: Windows 64 bits: RunningX64 = ${RunningX64}' \\\${Else} DetailPrint 'DEBUG: Windows 32 bits: RunningX64 = ${RunningX64}' \\\${EndIf} ) Best regards, YC - Mail original - De: ycollette nospam ycollette.nos...@free.fr À: cmake cmake@cmake.org Envoyé: Vendredi 20 Janvier 2012 08:31:42 Objet: [CMake] Cmake / NSIS: escape parenthesis Hello, I would like to add the following statements in my nsis installer: list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${If} ${RunningX64} DetailPrint 'DEBUG: Windows 64 bits: RunningX64 = ${RunningX64}' ${Else} DetailPrint 'DEBUG: Windows 32 bits: RunningX64 = ${RunningX64}' ${EndIf} ) This would be written verbatim in the nsis code. But cmake interprets ${If} as getting the value of If. Now, in my nsis code, I've got: DetailPrint 'DEBUG: Windows 64 bits: RunningX64 = ' DetailPrint 'DEBUG: Windows 32 bits: RunningX64 = ' Which is not correct. So, my question is: how do I protect the { and } characters ? Best regards, YC -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[Cmake-commits] CMake beginner question
I want to build VTK for IOS, how can I adjust the CMake files to do that, any suggestions ideas will be highly appreciated Best regards ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2158-g9d9a838
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 9d9a838b2e83b29953f787ca1b0148e38874287a (commit) via 880139a6421649b9b3ff8048418cd556e7ddf2c1 (commit) from 72161887ffaca3b13fb253887b7d99935f437a58 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d9a838b2e83b29953f787ca1b0148e38874287a commit 9d9a838b2e83b29953f787ca1b0148e38874287a Merge: 7216188 880139a Author: Clinton Stimpson clin...@elemtech.com AuthorDate: Thu Jan 19 20:10:59 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Jan 19 20:10:59 2012 -0500 Merge topic 'GetPrerequisites-rpath-OSX' into next 880139a GetPrerequisites: Add support for @rpath on Mac OS X. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=880139a6421649b9b3ff8048418cd556e7ddf2c1 commit 880139a6421649b9b3ff8048418cd556e7ddf2c1 Author: Clinton Stimpson clin...@elemtech.com AuthorDate: Thu Jan 19 18:10:01 2012 -0700 Commit: Clinton Stimpson clin...@elemtech.com CommitDate: Thu Jan 19 18:10:01 2012 -0700 GetPrerequisites: Add support for @rpath on Mac OS X. Change to consider a library embedded if it is found in a subdirectory relative to the using executable/library. Previous commit considered them local. This case is encountered when @rpath is used with framework libraries, which are inside a directory tree. diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index fbbaf9c..8761f40 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -478,12 +478,17 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) if(NOT is_system) get_filename_component(original_path ${original_lower} PATH) - string(LENGTH ${original_path}/ original_length) - string(LENGTH ${lower} path_length) - if(${path_length} GREATER ${original_length}) -string(SUBSTRING ${lower} 0 ${original_length} path) -if(${original_path}/ STREQUAL ${path}) - set(is_local 1) + get_filename_component(path ${lower} PATH) + if(${original_path} STREQUAL ${path}) +set(is_local 1) + else() +string(LENGTH ${original_path}/ original_length) +string(LENGTH ${lower} path_length) +if(${path_length} GREATER ${original_length}) + string(SUBSTRING ${lower} 0 ${original_length} path) + if(${original_path}/ STREQUAL ${path}) +set(is_embedded 1) + endif() endif() endif() endif() --- Summary of changes: Modules/GetPrerequisites.cmake | 17 +++-- 1 files changed, 11 insertions(+), 6 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2160-gf0f1c4a
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f (commit) via 0d96decdd069451c9b805e411abe0fc6225c8ee9 (commit) from 9d9a838b2e83b29953f787ca1b0148e38874287a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f commit f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f Merge: 9d9a838 0d96dec Author: Clinton Stimpson clin...@elemtech.com AuthorDate: Fri Jan 20 00:03:24 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Fri Jan 20 00:03:24 2012 -0500 Merge topic 'GetPrerequisites-rpath-OSX' into next 0d96dec GetPrerequisites: Add test for @rpath support. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d96decdd069451c9b805e411abe0fc6225c8ee9 commit 0d96decdd069451c9b805e411abe0fc6225c8ee9 Author: Clinton Stimpson clin...@elemtech.com AuthorDate: Thu Jan 19 22:03:06 2012 -0700 Commit: Clinton Stimpson clin...@elemtech.com CommitDate: Thu Jan 19 22:03:06 2012 -0700 GetPrerequisites: Add test for @rpath support. diff --git a/Tests/BundleUtilities/CMakeLists.txt b/Tests/BundleUtilities/CMakeLists.txt index 6209c8f..bb870e8 100644 --- a/Tests/BundleUtilities/CMakeLists.txt +++ b/Tests/BundleUtilities/CMakeLists.txt @@ -82,3 +82,52 @@ add_custom_target(testbundleutils2_test ALL DEPENDS testbundleutils1 module2 ) add_dependencies(testbundleutils2_test testbundleutils2) + + +if(APPLE AND CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0) +## Test a Bundle application using dependencies +## and @rpaths on Mac OS X 10.5 or greater + + # a shared library + add_library(shared-3 SHARED shared.cpp shared.h) + + # another shared library + add_library(shared2-3 SHARED shared2.cpp shared2.h) + + # a framework library + add_library(framework-3 SHARED framework.cpp framework.h) + set_target_properties(framework-3 PROPERTIES FRAMEWORK 1) + + # build dependencies with @rpath install name + set_target_properties(shared-3 shared2-3 framework-3 PROPERTIES +INSTALL_NAME_DIR @rpath +BUILD_WITH_INSTALL_RPATH 1) + + # a loadable module (depends on shared2) + # testbundleutils1 will load this at runtime + add_library(module3 MODULE module.cpp module.h) + set_target_properties(module3 PROPERTIES PREFIX LINK_FLAGS -Wl,-rpath,${CMAKE_CURRENT_BINARY_DIR}/testdir3) + get_target_property(module_loc module3 LOCATION) + target_link_libraries(module3 shared2-3) + + # a non-bundle application + add_executable(testbundleutils3 testbundleutils3.cpp) + target_link_libraries(testbundleutils3 shared-3 framework-3 ${CMAKE_DL_LIBS}) + get_target_property(loc testbundleutils3 LOCATION) + + set_target_properties(testbundleutils3 module3 PROPERTIES +LINK_FLAGS -Wl,-rpath,${CMAKE_CURRENT_BINARY_DIR}/testdir3) + + # add custom target to install and test the app + add_custom_target(testbundleutils3_test ALL +COMMAND ${CMAKE_COMMAND} +-DINPUT=${loc} +-DMODULE=${module_loc} +-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} +-DOUTPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/testdir3 +-P ${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake +DEPENDS testbundleutils3 module3 +) + + add_dependencies(testbundleutils3_test testbundleutils3) +endif() diff --git a/Tests/BundleUtilities/testbundleutils3.cpp b/Tests/BundleUtilities/testbundleutils3.cpp new file mode 100644 index 000..9df13e9 --- /dev/null +++ b/Tests/BundleUtilities/testbundleutils3.cpp @@ -0,0 +1,33 @@ + +#include framework.h +#include shared.h +#include stdio.h + +#if defined(WIN32) +#include windows.h +#else +#include dlfcn.h +#endif + +int main(int, char**) +{ + framework(); + shared(); + +#if defined(WIN32) + HANDLE lib = LoadLibraryA(module3.dll); + if(!lib) + { +printf(Failed to open module3\n); + } +#else + void* lib = dlopen(module3.so, RTLD_LAZY); + if(!lib) + { +printf(Failed to open module3\n%s\n, dlerror()); + } +#endif + + + return lib == 0 ? 1 : 0; +} --- Summary of changes: Tests/BundleUtilities/CMakeLists.txt | 49 .../{testbundleutils2.cpp = testbundleutils3.cpp} |8 ++-- 2 files changed, 53 insertions(+), 4 deletions(-) copy Tests/BundleUtilities/{testbundleutils2.cpp = testbundleutils3.cpp} (60%) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org
[Cmake-commits] CMake branch, next, updated. v2.8.7-2163-gccede27
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via ccede27648e85ebfbce77ccda49d7ec63f80bd4b (commit) via b8ff1c1e72899e7381d93e44b00824faf73d94ab (commit) via f2baff920e121377eb4873fc14783d64696270b1 (commit) from f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccede27648e85ebfbce77ccda49d7ec63f80bd4b commit ccede27648e85ebfbce77ccda49d7ec63f80bd4b Merge: f0f1c4a b8ff1c1 Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Fri Jan 20 02:03:34 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Fri Jan 20 02:03:34 2012 -0500 Merge topic 'uninitialized-var-in-if' into next b8ff1c1 KWSys Nightly Date Stamp f2baff9 KWSys Nightly Date Stamp --- Summary of changes: Source/kwsys/kwsysDateStamp.cmake |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits