[CMake] ExternalProjects_Add limitations

2014-01-05 Thread Rob McDonald
All, Thanks for all your work on CMake. I really hate toolchain problems and CMake makes them almost bearable. The entire community of developers trying to make cross platform programs would be far worse off without CMake. My project is a big open source C++ project with lots of library

[CMake] Visual Studio command line from CMake

2014-01-08 Thread Rob McDonald
Short version: Does anyone have an elegant way to launch the visual studio command line from within CMake? James Bigler asked essentially this question back in March of 2011. David responded with a link to a Blog entry, but I haven't figured out how to translate that into something that works.

Re: [CMake] Visual Studio command line from CMake

2014-01-08 Thread Rob McDonald
super deep into Erco's magic. Rob On Wed, Jan 8, 2014 at 7:50 PM, Rob McDonald rob.a.mcdon...@gmail.com wrote: Thanks for the tip, but that hasn't been very helpful to me. Perhaps I'm not doing it right. Here is a bit of CMake code so the conversation can be more concrete

[CMake] Fwd: Visual Studio command line from CMake

2014-01-08 Thread Rob McDonald
} --build SOURCE_DIR -- gmake But, it didn't seem to do anything useful Rob On Wed, Jan 8, 2014 at 5:31 PM, J Decker d3c...@gmail.com wrote: cmake --build On Wed, Jan 8, 2014 at 3:53 PM, Rob McDonald rob.a.mcdon...@gmail.com wrote: Short version: Does anyone have an elegant way

Re: [CMake] Fwd: Visual Studio command line from CMake

2014-01-09 Thread Rob McDonald
Correct, this is one of the concerns that makes it more complex than just searching for the first vcvarsall.bat you come to. I'd like to match up the vcvarsall to the version of visual studio currently in use by CMake. I think there are now enough pieces that I can write a CMake

Re: [CMake] Fwd: Visual Studio command line from CMake

2014-01-09 Thread Rob McDonald
the host environment. Is there a CMake way to detect whether the Visual Studio host environment is 32/64 bit? On Thu, Jan 9, 2014 at 10:48 AM, Rob McDonald rob.a.mcdon...@gmail.com wrote: Correct, this is one of the concerns that makes it more complex than just searching for the first vcvarsall.bat

Re: [CMake] Fwd: Visual Studio command line from CMake

2014-01-09 Thread Rob McDonald
files. All the common examples drive either ./configure, pure make, or CMake setups. Rob On Thu, Jan 9, 2014 at 11:28 AM, Bill Hoffman bill.hoff...@kitware.comwrote: On 1/9/2014 2:13 PM, Rob McDonald wrote: Bill, This sounds interesting. After FLTK, I have a couple other libraries

Re: [CMake] Fwd: Visual Studio command line from CMake

2014-01-09 Thread Rob McDonald
All, My FLTK EmbeddedProject woes are solved. As it turns out, the path of least resistance was the one I hadn't tried While the FLKT CMake files were indeed out of date, they weren't that bad. Fixing them was by far the best solution. I have a few more libraries for my project, but

[CMake] patch on Windows

2014-01-11 Thread Rob McDonald
Where does CMake get its patch implementation? I'm using a patch step with ExternalProject_Add on Windows (and other platforms). I had it working on one Windows machine - which unfortunately just got knocked off a desk and will never be recovered. The same files on a different Windows machine

Re: [CMake] patch on Windows

2014-01-12 Thread Rob McDonald
On Sun, Jan 12, 2014 at 1:39 AM, Rob McDonald rob.a.mcdon...@gmail.comwrote: Where does CMake get its patch implementation? It doesn't. It would be great if CMake implemented a cmake -E patch. Agreed. Problem is patch from GNUWin32 does not support Unix line endings (it will crash

[CMake] Compiling two versions of file/program

2014-01-20 Thread Rob McDonald
My project can be compiled with support for graphics, or in a completely headless mode with no dependencies on any graphics libraries. By and large, this is accomplished with the same source code and a very few #define 's. We also have an API/Library mode with no main(), but that can have

Re: [CMake] Compiling two versions of file/program

2014-01-20 Thread Rob McDonald
On Mon, Jan 20, 2014 at 7:39 AM, J Decker d3c...@gmail.com wrote: On Mon, Jan 20, 2014 at 7:37 AM, Игорь Пашев pashev.i...@gmail.com wrote: 2014/1/20 Rob McDonald rob.a.mcdon...@gmail.com: We also have an API/Library mode with no main(), but that can have graphics or not. So, one

[CMake] Reverse logic

2014-01-29 Thread Rob McDonald
I feel like this is a really dumb question, but I've got myself wrapped around the axel I'd like to use a negative conditional on a variable that may or may not be defined... say USE_SYSTEM_FOO So, I'd like to do something like this... IF( NOT ${USE_SYSTEM_FOO} ) # Build my own FOO

[CMake] AStyle or similar code beautifier

2014-01-30 Thread Rob McDonald
All, I'm interested in adding a code beautifier to my project. I'm looking at AStyle, but am open to others. Implementing a FindAStyle.cmake is pretty trivial. Likewise, implementing custom targets is pretty straightforward in the simple case. However, I thought there might be some

Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Rob McDonald
Thanks to everyone for all the helpful responses. It looks like most of the ideas were pretty similar to what I was thinking. Glad to know I wasn't missing anything huge. I had found UniversalIndentGUI and plan on using it. I had also found uncrustify and will take a closer look at it. On

[CMake] Determining appropriate CMAKE_MINIMUM_REQUIRED

2014-02-06 Thread Rob McDonald
Is there a way to get cmake to report back an _actual_ minimum required version? Our project has lots of parts, and the CMakeLists.txt have not been very well maintained. Right now, CMAKE_MINIMUM_REQUIRED is set to different values throughout, none of which are likely correct. It seems like it

[CMake] Path too long

2014-02-06 Thread Rob McDonald
All, I'm building FLTK as an ExternalProject to a 'Libraries' project. Inside the ExternalProject, I'm using the FLTK CMake build system. I've then created a SuperProject to build Libraries as an ExternalProject (and my main project too). This works great so far on my Mac. On my Windows

[CMake] Path vs. name preference during search.

2014-02-13 Thread Rob McDonald
When I search for a given library, specifying multiple possible names and multiple hints for paths... FIND_LIBRARY( FINDME_LIB NAMES name1 name2 name3 HINTS path1 path2 path3 DOC Library to find) CMake seems to have a preference for name1, and it first searches all HINTS

Re: [CMake] Path vs. name preference during search.

2014-02-13 Thread Rob McDonald
/External_teem.cmake#L13-16 Hth Jc On Thu, Feb 13, 2014 at 12:51 PM, Rob McDonald rob.a.mcdon...@gmail.comwrote: When I search for a given library, specifying multiple possible names and multiple hints for paths... FIND_LIBRARY( FINDME_LIB NAMES name1 name2 name3 HINTS path1 path2

[CMake] Matlab producing image files for use with LaTeX

2015-01-11 Thread Rob McDonald
I am familiar with UseLATEX, but would like to take the automation of my document build system a step or two further. Solutions that build on UseLATEX -- or a totally separate approach, are OK. I often use Matlab to create *.pdf figures -- which are then used in a LaTeX document. I would like

[CMake] ExternalProject_Add not re-building when source changes

2015-04-23 Thread Rob McDonald
I've used ExternalProject_Add to trick CMake into supporting two compilers to build my project. Part of my project needs OpenMP, but other parts do not. So, on MacOS, I would prefer to build most of the project with CLang, but the OpenMP requiring part with gcc. I have CMake set up to detect

Re: [CMake] Statically link OpenMP on Mac gcc

2015-05-02 Thread Rob McDonald
On a Mac, using GCC's global -static is bad, so that doesn't work out. However, as it turns out, -static-libgcc implies all parts of libgcc, including libgomp. So, building with -static-libgcc -static-libstdc++ looks like the best solution. Rob On Thu, Apr 30, 2015 at 2:19 PM, Rob McDonald

[CMake] Statically link OpenMP on Mac gcc

2015-04-30 Thread Rob McDonald
I'm using MacPorts GCC 4.8 and CMake 3.2. I use 'FIND_PACKAGE( OpenMP )', and then use OpenMP_C_FLAGS and OpenMP_CXX_FLAGS appropriately. My application works on the machine that I build on. However, users without MacPorts GCC installed can't find libgomp.1.dylib on their machine. I'd like to

[CMake] FindOpenMP not working on VS2010 Pro

2015-04-08 Thread Rob McDonald
For some reason, FindOpenMP succeeds -- but reports failure for me on Visual Studio 2010 Pro. This is with the latest CMake just in case... 1 -- Try OpenMP C flag = [/openmp] 1 -- Performing Test OpenMP_FLAG_DETECTED 1 -- Performing Test OpenMP_FLAG_DETECTED - Success 1 -- Try OpenMP CXX

Re: [CMake] FindOpenMP not working on VS2010 Pro

2015-04-08 Thread Rob McDonald
Sorry for the noise. My Cache had variables leftover from VS 2010 Express. Thanks, Rob On Wed, Apr 8, 2015 at 3:44 PM, Rob McDonald rob.a.mcdon...@gmail.com wrote: For some reason, FindOpenMP succeeds -- but reports failure for me on Visual Studio 2010 Pro. This is with the latest CMake

Re: [CMake] ExternalProject_Add contributing to top-level Package

2015-04-05 Thread Rob McDonald
Ok, I think I've answered my own question... I added the following after the ExternalProject_Add command... ExternalProject_Get_Property( ALTBUILD BINARY_DIR ) INSTALL( PROGRAMS ${BINARY_DIR}/myprogram DESTINATION . ) Rob On Sat, Apr 4, 2015 at 12:57 PM, Rob McDonald rob.a.mcdon...@gmail.com

[CMake] ExternalProject_Add contributing to top-level Package

2015-04-04 Thread Rob McDonald
All, I have a project that is typically compiled with CLang/LLVM. However, I'm now adding a component that is preferentially built with OpenMP. CLang doesn't support OpenMP, so I'd like to build that component with GCC while still building everything else with CLang. So far, I'm approaching the

[CMake] SuperProject package/install

2015-11-11 Thread Rob McDonald
All, I have a SuperProject set up with ExternalProject_add the way some other projects do. The SuperProject has two EP's -- Libraries and Main. Libraries has a bunch of its own EP's. Main is my core project. When some users use this setup, they're confused at the end -- everything has worked,

[CMake] FindFLTK behavior changes between Ubuntu 14.04 and 15.10

2015-12-15 Thread Rob McDonald
On Ubuntu 14.04 (CMake 2.8.12.2), FindFLTK.cmake sets FLTK_FLUID_EXECUTABLE to '/usr/bin/fluid'. This is good. On 15.10 (CMake 3.2.2), FLTK_FLUID_EXECUTABLE gets set to 'fluid'. This is bad. An eyeball comparison of the FindFLTK.cmake scripts included with each doesn't reveal anything

[CMake] CMAKE_POSITION_INDEPENDENT_CODE Version

2016-04-23 Thread Rob McDonald
CMAKE_POSITION_INDEPENDENT_CODE first appears in the documentation for 2.8.9 while CMAKE_POSITION_INDEPENDENT_FLAGS appears in the docs for 2.8.8 -- with the same description. Was this just a documentation typo, or did the name of this variable change from 2.8.8 to 2.8.9? Only the _FLAGS version

[CMake] Version compatibility?

2016-04-23 Thread Rob McDonald
Is there a continuation of the CMake version -- feature mapping table? https://cmake.org/Wiki/CMake_Version_Compatibility_Matrix I found this to be quite useful, but need something that continues into 3.X. Rob -- Powered by www.kitware.com Please keep messages on-topic and check the CMake

[CMake] SWIG_ADD_LIBRARY Documentation?

2017-12-09 Thread Rob McDonald
In version 3.8, SWIG_ADD_MODULE was deprecated in favor of SWIG_ADD_LIBRARY. This added the ability to control the TYPE for the target. From the documentation, the options are this: https://cmake.org/cmake/help/v3.8/module/UseSWIG.html TYPE

Re: [CMake] SWIG_ADD_LIBRARY Documentation?

2017-12-09 Thread Rob McDonald
nterface and only include > the code needed for the lib’s interface. A static lib potentially leaks a > lot more about your build/files/etc instead of shared libs. Shared libs are > generally smaller too. > > -Caleb > > On Sat, Dec 9, 2017 at 1:00 PM Rob McDonald <rob.a.mcdo

Re: [CMake] SWIG_ADD_LIBRARY Documentation?

2017-12-09 Thread Rob McDonald
“name.dylib”. >> > >> > From a practical standpoint (and my opinion): shared libs are generally >> > better since they (usually) have a well defined interface and only >> > include >> > the code needed for the lib’s interface. A static lib potentially leaks &