Re: [CMake] CTest + Catch Framework

2015-01-27 Thread Fraser Hutchison
We've run into this exact chicken and egg problem with both gtest and Catch at my work too. In both cases, we've worked round the problem by writing fairly fragile CMake code which parses the C++ files comprising a test executable and ultimately calling add_test for each discovered test case.

Re: [CMake] Help with Policy CMP0026 (disallow LOCATION target property)

2014-12-30 Thread Fraser Hutchison
Yup - fair enough. I downgrade my "Alternatively" to "As a last resort". Thanks, Fraser. On 30/12/2014 12:13, Stephen Kelly wrote: Fraser Hutchison wrote: Alternatively, you can tell CMake to allow the use of the LOCATION target property by setting the relevant p

Re: [CMake] Help with Policy CMP0026 (disallow LOCATION target property)

2014-12-28 Thread Fraser Hutchison
Hi Paul, I'd have thought the following replacement would work the same:   function(stageobj target dir)       add_custom_target(stage_${target} ALL           COMMAND "${CMAKE_COMMAND}" -E make_directory "${DESTDIR}/${dir}"       COMMAND "${CMAKE_C

Re: [CMake] Useful extensions for CMake blog post

2014-09-06 Thread Fraser Hutchison
Indeed! On 05/09/2014 20:09, David Cole via CMake wrote: Wow. -- 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,

Re: [CMake] [CMAKE] Getting compilation date through CMake

2013-12-05 Thread Fraser Hutchison
Hi Jon, You'd have to invoke the command prompt to execute this I think.  On Windows this should be the value of the COMSPEC environment variable, so your command would be something like: execute_process(COMMAND     $ENV{COMSPEC} /c date /t     OUTPUT_VA

Re: [CMake] ExternalProject_Add examples

2013-10-24 Thread Fraser Hutchison
There's a StackOverflow answer I did a while back which gives an example of ExternalProject_Add for GTest: http://stackoverflow.com/a/9695234/2556117 It maybe needs updated, and I don't think I ever tried it on OSX, but it should hopefully be an OK starting point. (If not - hack away at my an

Re: [CMake] set_directory_properties() Isn't

2013-08-30 Thread Fraser Hutchison
Hi Rob, The DEFINITIONS directory property is read-only. COMPILE_DEFINITIONS or the configuration-specific versions are mutable I believe. Cheers, Fraser. On 30/08/2013 22:30, Stewart, Robert wrote: I'm effectively doing the following, with CMake 2.8, but it doesn't work. What am I missing

Re: [CMake] Is it possible to show dependent files in Visual Studio "folders" for ADD_CUSTOM_TARGET?

2013-01-19 Thread Fraser Hutchison
I think this is what the SOURCES arg is for. You could just duplicate the list of DEPENDS files as the SOURCES argument too: add_custom_target(LIB_NAME DEPENDS ${LIST_OF_HEADERS} SOURCES ${LIST_OF_HEADERS}) Cheers, Fraser. On 19/01/2013 10:08, Jose Luis Blanco wrote: Hello all, I hope you

Re: [CMake] Accepted way to add "-fPIC" onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Fraser Hutchison
I'm not a Linux guy, so hopefully someone else more knowledgeable can chime in here, but if you want to add to your CMAKE_CXX_FLAGS, you need to avoid creating a semi-colon-separated list by moving the quote mark: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

Re: [CMake] flags for shared/static lib

2012-06-12 Thread Fraser Hutchison
I assume they do the same thing too in this case, but I defer to David since he works for Kitware and knows the source code, whereas I don't and don't :-) On 13/06/2012 00:56, Totte Karlsson wrote: On 6/12/2012 4:23 PM, Fraser Hutchison wrote: You can use: |set_target_propertie

Re: [CMake] flags for shared/static lib

2012-06-12 Thread Fraser Hutchison
You can use: set_target_properties(${target}-static PROPERTIES COMPILE_DEFINITIONS RR_STATIC) For full details, run: cmake --help-property COMPILE_DEFINITIONS Cheers, Fraser. On 12/06/2012 23:39, Totte Karlsson wrote:

Re: [CMake] Visual Studio 2012 Beta: unable to compile individual files

2012-06-12 Thread Fraser Hutchison
Yeah - I can reproduce this too (better late than never - sorry!) I've upvoted your bug report Ben. Cheers, Fraser. On 12/06/2012 19:55, Ben Medina wrote: I've filed a bug with Microsoft: https://connect.microsoft.com/VisualStudio/feedback/details/748640/cannot-compile-individual-files-if-pr

Re: [CMake] Overriding CMAKE__FLAGS on a per target basis for Visual Studio project generation

2012-04-20 Thread Fraser Hutchison
Hi Dan, I don't think it's possible to set compiler flags on a per-configuration, per-target basis without splitting your project. There was a very similar discussion recently [1],[2] which indicated a couple of options. However the first option can't be used on a per-configuration basis, w

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread Fraser Hutchison
David's original answer does what you require. Simply include |add_custom_target(Foo ...)| and don't include |add_dependencies(Bar Foo)|. If your project is also called Bar, then Bar.sln will include Foo.vcproj and Bar.vcproj, but Foo will not be built when invoking "Build Solution". Cheers

Re: [CMake] Use of ADD_CUSTOM_COMMAND

2011-04-19 Thread Fraser Hutchison
Hi Gib, Try the following: GET_TARGET_PROPERTY(FUBAR_EXE fubar LOCATION) ADD_CUSTOM_COMMAND(TARGET fubar POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FUBAR_EXE} somepath) Cheers, Fraser. On 20/04/2011 03:31, Gib Bogle wrote: I'm a real cmake novice, and I find the cmake documentation har