Re: [CMake] Check header file woos
Is there any reason, why including just this header is not enough? Maybe some required definitions missing? CMake checks includes by compiling a simple program that does nothing. If compilation fails, the header is assumed not to exist. Those CMake flags can be helpful in diagnosing the issue: --debug-trycompile = Do not delete the try_compile build tree. Only useful on one try_compile at a time. --debug-output = Put cmake in a debug mode. --trace = Put cmake in trace mode. -- Gruesse, Jakub From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Oliver Sent: Dienstag, 18. Februar 2014 22:11 To: cmake@cmake.org Subject: [CMake] Check header file woos All, I am trying to use CheckIncludeFiles for header file check. I know the file I want to check is located at /usr/include/lustre, so I supplied the following: include(CheckIncludeFiles) check_include_files("lustre/lustre_user.h" HAVE_LUSTRE_USER_H) And it report can't find. Then I tried to be explicit about it set(CMAKE_REQUIRED_INCLUDES /usr/include/lustre) Still no avail. If I check any other header file in that directory, say "sys/io.h", it will work as expected. I am puzzled ... anything I missed? Thanks -- Oliver -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] include_directories(...) versus set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES ...)
That's just the quick brain dump version. If necessary, I can actually look at old commits, or the current code to try to refresh my memory. I think that's needed. Can you do that research into the commits and discussion? Please see the results of my "research" (aka, old commits detective work) in the newly added note to the mantis bug report here: http://public.kitware.com/Bug/view.php?id=14758#c35153 Sorry I don't have more time to spend on this for a while, but the links are in the bug note if anybody wants to investigate ways to reverse the effects of postponing de-duplication. Cheers, David C. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why does CMake set CMAKE_OSX_SYSROOT using the Xcode generator?
On 02/18/2014 03:02 AM, Kyle Sluder wrote: > But I'm being stymied by CMake, which is insisting on setting > CMAKE_OSX_SYSROOT to my current platform's SDK despite the fact that I'm > using the Xcode generator. It's designed for builds where everything is for a single OS X platform. One would need to teach the generators to support target properties like OSX_SYSROOT and OSX_DEPLOYMENT_TARGET to set the flags on a per-target basis as a first-class feature. We already have per-target OSX_ARCHITECTURES. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Help debug crazy Windows MSVC issue
On Mon, 2014-02-17 at 08:34 -0500, Paul Smith wrote: > On Mon, 2014-02-17 at 10:20 +0100, Hendrk Sattler wrote: > > Visual Studio 10 totally relies on the custom build tool to protect > > itself when run in parallel. It will run the generator as many times > > as the bar.cpp is mentioned in different targets, even in parallel if > > that is enabled. > > Yes, this matches what I found after sending my last email. > The problem, of course, is that it uses the exact same .OBJ file to > link into both the shared and static libraries. In my real > environment I'm using different -D* flags, so that doesn't work. Thanks to all that helped. I eventually "solved" this problem by deciding I didn't need this code linked into my static libraries, so I didn't need to compile the code twice with different flags. MSVC seems to be stable now... this is a bummer though. It might be helpful to add this limitation to the docs or a FAQ or something, for posterity. Unfortunately I've now run into a problem with Xcode generation which is at least as concerning. I'll start a new thread. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Critical Xcode problem with OBJECT libraries
Hi all. I'm using CMake 2.8.12.1 on Linux, MacOSX, and Windows. On my system I need to build libraries in a large number of subdirectories and link them (statically) with various executables (different executables use different libraries). Then I also need to take the content of all those libraries and include them into a single shared library / DLL. I understand this is tricky for CMake and so the special "OBJECT" library type was introduced to help with that. Here's a repro case for the problem I see: cmake_minimum_required(VERSION 2.8.12) project(CMTEST CXX) add_library(foo_OBJECTS OBJECT foo.cpp foo.h) add_library(foo STATIC dummy.cpp $) add_dependencies(foo foo_OBJECTS) add_executable(hello hello.cpp) target_link_libraries(hello foo) I needed to add the "dummy.cpp" because I previously learned that Xcode can't handle creating a library only from OBJECTS like this. It contains nothing but a comment. * I run cmake -G Xcode * I run xcodebuild build -config RelWithDebInfo * Everything is built correctly * Now I modify "foo.cpp" * I run xcodebuild build -config RelWithDebInfo For the last step I expect that: 1. foo.cpp will be recompiled 2. libfoo.a library will be updated 3. the "hello" program will be rebuilt. As a side-effect I guess a hidden "libfoo_OBJECTS.a" will be created, but I don't actually care about that. This is how it works with Makefile and MSVC. With Xcode, though, what actually happens is that the "libfoo_OBJECTS.a" is rebuild, BUT it does NOT rebuild libfoo.a and it does NOT relink the "hello" executable!! I've explicitly stated a dependency between the foo library target and the foo_OBJECTS target, and it still does not rebuild on changes! As you can imagine this is causing my Xcode-based builds to be completely unreliable: they fail with weird link errors, or else at runtime with strange vtable issues. Anyone else able to reproduce this? Is it a known limitation of Xcode? Any ideas for workarounds? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Build cmake child project from cmake parent project
I have cmake two projects, with project 2 added as a git submodule in project 1. I would like to build project 2 from project 1. How can I do this? I tried add_subdirectory, but this is just for adding source directories. I want to use the project 2 cmake files to build it. Thanks! -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Build cmake child project from cmake parent project
On Wed, Feb 19, 2014 at 06:24:44PM -0500, Aaron Boxer wrote: > I have cmake two projects, with project 2 added as a git submodule in > project 1. > > I would like to build project 2 from project 1. > > How can I do this? I tried add_subdirectory, but this is just for adding > source directories. I want to use the project 2 cmake files to build it. Have a look at ExternalProject (http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:ExternalProject) it's very likely what you are looking for. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. -- Alan Kay pgpQWILVXAHlJ.pgp Description: PGP signature -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake