Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread J. Caleb Wherry
(Shameless plug ahead) If you want to see a working example of what I said above, you can check out my ExampleCMakeProject: https://github.com/calebwherry/example-cmake-project It is currently being built and tested on TravisCI (Linux + Mac [GGC5 and Clang3.7]) and Appveyor (Windows [VS2015]) an

[CMake] Compiling configuration set for vs project

2016-04-25 Thread vakano
Hi, I am generating a vcproj and sln project for windows VS2015, do I need to set each compiling configuration in cmakelist? I am doing nothing special for this in current cmakelist, but the generated vcproj looks like already contain with compiling info eg:Debug x64, Release x64, MinSizeRel x6

Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread J. Caleb Wherry
Altering the path, updating the registry, or having a custom install step that installs into a build location are all options that aren't scalable since they apply specifically to the one project. Paths would get huge if this was to be done in practice for multiple projects. Also, the OP seems to

Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread J Decker
On Apr 25, 2016 6:41 PM, "J. Caleb Wherry" wrote: > > (1) > > You typically want to define the entry point in the source itself. You can use the 'CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS' in CMake but you usually do something like this in the source: > > #ifdef WIN32 > #define PUBLIC_API __declspec(dllexp

Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread Craig Scott
Also see the GenerateExportHeader module which can handle much of this for you in a more platform independent way. The examples in the docs talk about classes, but it can also be applied to functions. On Tue, Apr 26, 2016 at 1

Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread J. Caleb Wherry
(1) You typically want to define the entry point in the source itself. You can use the 'CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS' in CMake but you usually do something like this in the source: #ifdef WIN32 #define PUBLIC_API __declspec(dllexport) #else #define PUBLIC_API #endif PUBLIC_API void HelloFunc

Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread J Decker
Add __declspec(dllexport) before void HelloFunc() On Apr 25, 2016 6:01 PM, "Chaos Zhang" wrote: > Hi, > > I faced this problem when i try built a shared lib and linked it on > windows. The structure of my project as below: > -test_dir/ > -sub_hello/ >CMakeLists.txt >

Re: [CMake] Need a example to use dll in vs

2016-04-25 Thread Chaos Zhang
Jakob van Bethlehem wrote > Hej, > > You really should provide more detailed information about your project > structure, and what is going wrong. There are some subtle differences > between Linux/Windows, but not at the level you're referring to. Certainly > the IMPORTED property has nothing to

[CMake] How to link shared lib on windows (visual studio 2014).

2016-04-25 Thread Chaos Zhang
Hi, I faced this problem when i try built a shared lib and linked it on windows. The structure of my project as below: -test_dir/ -sub_hello/ CMakeLists.txt hello.c -top/ main.c CMakeLists.txt CMakeLists.txt The content of each file: ①te

Re: [CMake] Version compatibility?

2016-04-25 Thread Craig Scott
In my case, I work with a large code base that spans many projects with various interdependencies. Some of that code base is quite old and would benefit from updating to more modern CMake features, but some parts of the code I'm not free to update. For these cases, I need to understand what CMake v

Re: [CMake] Finding 32bit libs on 64bit Ubuntu install

2016-04-25 Thread Nick Deubert
On Mon, Apr 25, 2016 at 4:01 PM, Alan W. Irwin wrote: > On 2016-04-25 14:06-0400 Nick Deubert wrote: > >> On Fri, Apr 22, 2016 at 5:08 PM, Alan W. Irwin >> wrote: >>> >>> On 2016-04-22 14:59-0400 Nick Deubert wrote: >>> Hey everyone, I am trying to build and link some 32bit binaries on

Re: [CMake] Finding 32bit libs on 64bit Ubuntu install

2016-04-25 Thread Alan W. Irwin
On 2016-04-25 14:06-0400 Nick Deubert wrote: On Fri, Apr 22, 2016 at 5:08 PM, Alan W. Irwin wrote: On 2016-04-22 14:59-0400 Nick Deubert wrote: Hey everyone, I am trying to build and link some 32bit binaries on Ubuntu 15.10 64bit, but no matter what combination of arguments I give FIND_LIBRA

Re: [CMake] Finding 32bit libs on 64bit Ubuntu install

2016-04-25 Thread Nils Gladitz
On 22.04.2016 20:59, Nick Deubert wrote: Hey everyone, I am trying to build and link some 32bit binaries on Ubuntu 15.10 64bit, but no matter what combination of arguments I give FIND_LIBRARY I cannot get it to use the 32bit libs. I have been scouring the mailing lists and came up with all these

Re: [CMake] Finding 32bit libs on 64bit Ubuntu install

2016-04-25 Thread Nick Deubert
On Fri, Apr 22, 2016 at 5:08 PM, Alan W. Irwin wrote: > On 2016-04-22 14:59-0400 Nick Deubert wrote: > >> Hey everyone, I am trying to build and link some 32bit binaries on >> Ubuntu 15.10 64bit, but no matter what combination of arguments I give >> FIND_LIBRARY I cannot get it to use the 32bit li

Re: [CMake] adding parts of build log to dashboard.

2016-04-25 Thread Rashad Kanavath
could we inject some files inside Build.xml ? On Thu, Jan 7, 2016 at 5:21 PM, Clinton Stimpson wrote: > On Thursday, January 07, 2016 02:51:18 PM Rashad Kanavath wrote: > > Hello, > > > > How can I include part of my build log to cdash output. Currently cdash > > pickup build errors and warnings

Re: [CMake] Version compatibility?

2016-04-25 Thread Vladimír Vondruš
In my case I'm going through changelogs to see what is added in which version. For example I switched to the imported target workflow recently and need to keep backward compatibility all the way back to 2.8.12 (because Ubuntu LTS). There are a lot of features that were added later and are crucia

Re: [CMake] Version compatibility?

2016-04-25 Thread Nils Gladitz
On 04/25/2016 02:29 PM, Craig Scott wrote: I personally have found myself having to look up to his sort of version info a lot lately. It sounds like others do too. Perhaps a more sustainable approach would be to include the version details in the CMAKE docs themselves. For each command, module,

Re: [CMake] Need a example to use dll in vs

2016-04-25 Thread Jakob van Bethlehem
Hej, You really should provide more detailed information about your project structure, and what is going wrong. There are some subtle differences between Linux/Windows, but not at the level you're referring to. Certainly the IMPORTED property has nothing to do with a platform distinction. IMPORTED

Re: [CMake] Version compatibility?

2016-04-25 Thread Craig Scott
I personally have found myself having to look up to his sort of version info a lot lately. It sounds like others do too. Perhaps a more sustainable approach would be to include the version details in the CMAKE docs themselves. For each command, module, variable, etc. it's documentation could state

Re: [CMake] Version compatibility?

2016-04-25 Thread Johannes Zarl-Zierl
Hi Rob, I've stopped working on it when 3.0 came out. Since the whole thing was very much manual work (diff'ing documentation pages and checking whether some change was only better documentation or a real change in cmake), it was too much effort to continue long-term. Johannes On Saturday 2

[CMake] Exe file can't find .dll file on windows

2016-04-25 Thread Chaos Zhang
Hi, all, At first i was struggled to solve the problem of link shared lib on windows by CMake, and i found solution by using set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS YES). But when i executed the exe file, an error occurred: "The program can't start because hello_lib.dll is missing from your computer