[CMake] Linking Shared C++ Object from ExternalProject Produces Binaries with Relative Path, not Absolute

2014-12-02 Thread J. Caleb Wherry
All, I've been beating my head over this for about 3 days now and haven't gotten anywhere. There have been a few discussions on topics related to this question but nothing has gotten me a 100% solution (yet). I have created a StackOverflow post to see if I could get anything there but have yet to

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
The target_link_libraries() directive is adequate for this job when the header files for the library are simply referred to with no directory prefix, i.e. #include "some file.h" instead of #include "my lib/somefile.h". Referencing the library with target_link_libraries() appears to automatically a

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
Yes, by adding another directory between my top-level ./src/ directory and ./mylib, I can cause the example to fail. I understand now that the include_directory() directive really has no hidden intelligence to it at all, as I had mistakenly believed. It's just a path. However, I don't really wan

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
Well, this fixed my example. But my real project still fails the same way. It is, of course, much more complex and the library directories are often several layers down in subdirectory trees. :-( On Tue, Dec 2, 2014 at 2:05 PM, Chris Johnson wrote: > I'm using Make as my build tool. Here's t

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Angeliki Chrysochou
Glad it worked! No I don't think it is automatically an include path, only the files in the current directory where your sources are should be by default an include path. On Tue, Dec 2, 2014 at 9:05 PM, Chris Johnson wrote: > I'm using Make as my build tool. Here's the failing compile line with

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
I'm using Make as my build tool. Here's the failing compile line with the -I paths. Indeed, they're not quite correct. This is with the suggested include_directories() directive. [100%] Building CXX object prog/CMakeFiles/prog.dir/prog.cpp.o cd /sandbox/src/.build/prog && /usr/bin/c++-I/san

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Angeliki Chrysochou
Hi Bill.. Apparently, from his first email his top directory is src: Here are the current CMakeLists.txt files. Top level (../src): cmake_minimum_required(VERSION 2.8.4) project(src) project(src) add_subdirectory(mylib) add_subdirectory(prog) So this would probably work: include_directories(${

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Angeliki Chrysochou
Hi Bill, He wrote "Note also that prog.cpp includes this header via #include "myfunc.h"." in his first email, so I thought he wants to include it directly. Cheers! Angeliki On Tue, Dec 2, 2014 at 8:09 PM, Bill Hoffman wrote: > On 12/2/2014 1:33 PM, Angeliki Chrysochou wrote: > >> >> you sh

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Bill Hoffman
On 12/2/2014 1:04 PM, Chris Johnson wrote: Adding this directive does not seem to change the results at all, actually. Am I missing something?​ What build tool are you using? Can you show a verbose compile line? Then check the -I paths. make VERBOSE=1 will do it for make. -Bill -- Powe

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Bill Hoffman
On 12/2/2014 1:33 PM, Angeliki Chrysochou wrote: you should add in ./src/prog/CMakeLists.txt in include_directories the correct path to myfunc.h. Assuming CMAKE_SOURCE_DIR is "." (this is where your top level CMakeLists.txt is located): include_directories(${CMAKE_SOURCE_DIR}/src/mylib) I don'

[CMake] [ANNOUNCE] Please test staged cmake for eclipse CDT 1.3.0

2014-12-02 Thread Martin Weber
Hi all, I about to release a new version of the plugin for Eclipse CDT to integrate CMake. It should make setting up CDT to use cmake much easier. A short description can be found at the project home page The update site URL of the staged versi

Re: [CMake] How to set path to library header files?

2014-12-02 Thread David Cole via CMake
This chunk: target_include_directories( mylib PUBLIC # Headers used from source/build location: "$" # Headers used from the installed location: "$" ) uses CMAKE_CURRENT_SOURCE_DIR, which already ends with "/mylib". Don't you need to use the parent directory in order to includ

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Angeliki Chrysochou
Hi Chris, Given your file structure The file structure: . |-- bin/ |-- include/ | `-- mylib/ |-- lib/ `-- src/ |-- CMakeLists.txt |-- mylib/ | |-- CMakeLists.txt | |-- myfunc.cpp | `-- myfunc.h `-- prog/ |-- CMakeLists.txt `-- prog.cpp you should a

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
Adding this directive does not seem to change the results at all, actually. Am I missing something?​ Thanks, ..chris On Tue, Dec 2, 2014 at 11:33 AM, Bill Hoffman wrote: > This should work: > > include_directories(${CMAKE_SOURCE_DIR}/src) > > -- Powered by www.kitware.com Please keep messag

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Miller Henry
You need to use include_directories to tell cmake where to find headers. include_directories(${CMAKE_SOURCE_DIR}/src) http://www.cmake.org/cmake/help/v3.0/command/include_directories.html http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_SOURCE_DIR.html From: CMake [mailto:cmake-boun...@cmake

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Bill Hoffman
This should work: include_directories(${CMAKE_SOURCE_DIR}/src) On 12/2/2014 12:06 PM, Chris Johnson wrote: Just for completeness. File prog/prog.cpp: #include "mylib/myfunc.h" int main(int argc, char** argv) { return myfunc(); } File mylib/myfunc.h: int myfunc(); And file mylib/myf

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
Just for completeness. File prog/prog.cpp: #include "mylib/myfunc.h" int main(int argc, char** argv) { return myfunc(); } File mylib/myfunc.h: int myfunc(); And file mylib/myfunc.cpp: #include "myfunc.h" int myfunc() { return 1; } -- Powered by www.kitware.com Please keep messages on

Re: [CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
Ah, and I royally typo'd: prog.cpp includes the header via: #include "mylib/myfunc.h" (not just "myfunc.h") On Tue, Dec 2, 2014 at 11:01 AM, Chris Johnson wrote: > Background: I'm converting an existing project from a custom build > process which uses BSD Make to CMake. The source for the p

[CMake] How to set path to library header files?

2014-12-02 Thread Chris Johnson
Background: I'm converting an existing project from a custom build process which uses BSD Make to CMake. The source for the project is contained in about 600 directories, and has about a dozen libraries and maybe a hundred executables. The old build system (make) has to continue working until th

Re: [CMake] 3.1 can't link my MinGW executables any more.

2014-12-02 Thread Brad King
On 12/02/2014 09:30 AM, Bill Somerville wrote: > Ran with last nights snapshot dev binary build and it all seems to be > fine now. Great, thanks for testing. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Ki

Re: [CMake] 3.1 can't link my MinGW executables any more.

2014-12-02 Thread Bill Somerville
On 01/12/2014 18:55, Brad King wrote: Hi Brad, thanks for the quick response on this one. On 12/01/2014 12:04 PM, Bill Somerville wrote: https://dl.dropboxusercontent.com/u/4192709/CMakeOutput.log.3.0.2 https://dl.dropboxusercontent.com/u/4192709/CMakeOutput.log.3.1.0-rc2 The relevant portion

[CMake] Nvidia nsight (eclipse cdt) error parsing

2014-12-02 Thread Georg Altmann
Hi, I am using CMake for generating a project file for nvidia nsight to edit CUDA sources. $ mkdir myproj-build && cd myproj-build $ cmake -G"Eclipse CDT4 - Unix Makefiles" ../myproj The problem is, eclipse won't recognize the compiler errors output by nvcc. I enabled the "nvcc error parser" in

[CMake] CTest errors out when skipping a test

2014-12-02 Thread Christoph Grüninger
Hi CMake, I am testing the SKIP_RETURN_CODE property for tests. Unfortunately ctest error out when it found skipped tests. I expect ctest to not fail, because skipped tests should be indicated, but are to some extend expected and should still leave ctest passing. Is this a bug? Or do I misundersta

[CMake] This used to work...

2014-12-02 Thread J Decker
MinGW Makefile generator... (yes ${target} is blank... it should be 'a') --- cmake_minimum_required(VERSION 2.8) add_library( a main.c ) set( MOREDEFS "TARGETNAME=\"${target}\" TARGET_LABEL=${TARGET_LABEL}" ) SET_PROPERTY(TARGET a APPEND PROPERTY COMPILE_DEFINITIONS ${MOREDEFS}