Re: [CMake] Experiments in CMake support for Clang (header & standard) modules

2018-04-30 Thread Stephen Kelly
On 04/30/2018 11:30 PM, Stephen Kelly wrote:
> Interestingly, GCC is taking a directory-centric approach in the
> driver (-fmodule-path=) as opposed to the 'add a file to your
> compile line for each import' that Clang and MSVC are taking:
>
>  http://gcc.gnu.org/wiki/cxx-modules
>
> Why is Clang not doing a directory-centric driver-interface? It seems
> to obviously solve problems. 

I just discovered `-fprebuilt-module-path=`. I'm glad it exists (is it
'new'?), but why don't you just use the -I paths?

Thanks,

Steve.

-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] Experiments in CMake support for Clang (header & standard) modules

2018-04-30 Thread Stephen Kelly
On 04/20/2018 01:39 AM, David Blaikie wrote:
> Hi there,
>
> I'm experimenting with creating examples (& potential changes to CMake
> itself, if needed/useful) of building clang modules (currently using
> the semi-backwards compatible "header modules", with the intent of
> also/moving towards supporting pre-standard C++ modules in development
> in Clang).

Great! Thanks for reaching out. Sorry it has taken me a while to
respond. Have you had other response off-list?

> The basic commands required are:
>
>   clang++ -fmodules -xc++ -Xclang -emit-module -Xclang
> -fmodules-codegen -fmodule-name=foo foo.modulemap -o foo.pcm
>   clang++ -fmodules -c -fmodule-file=foo.pcm use.cpp
>   clang++ -c foo.pcm
>   clang++ foo.o use.o -o a.out

Ok. Fundamentally, I am suspicious of having to have a
-fmodule-file=foo.pcm for every 'import foo' in each cpp file. I
shouldn't have to manually add that each time I add a new import to my
cpp file. Even if it can be automated (eg by CMake), I shouldn't have to
have my buildsystem be regenerated each time I add an import to my cpp
file either.

That's something I mentioned in the google groups post I made which you
linked to. How will that work when using Qt or any other library?

Today, a beginner can find a random C++ book, type in a code example
from chapter one and put `g++ -I/opt/book_examples prog1.cpp` into a
terminal and get something compiling and running. With modules, they'll
potentially have to pass a whole list of module files too.

Lots of people manually maintain Makefile-based buildsystems today, and
most other companies I've been inside of have their own custom tool or
bunch of python scripts, or both. Manually changing such buildsystems to
add -fmodule-file or -fmodule-map-file each time an import is added is a
significant barrier.

Will my project have to compile the modules files for all of my
dependencies? Even more complication for my buildsystem. Do I have to
wait for my dependencies to modularize bottom-up before I can benefit
from modules? If my dependency does add 'module foo' to their header
files, or whatever the current syntax is, can I continue to #include
 or is that a source incompatible change?

I raised some of these issues a few years ago regarding the clang
implementation with files named exactly module.modulemap:

http://clang-developers.42468.n3.nabble.com/How-do-I-try-out-C-modules-with-clang-td4041946.html

http://clang-developers.42468.n3.nabble.com/How-do-I-try-out-C-modules-with-clang-td4041946i20.html

Interestingly, GCC is taking a directory-centric approach in the driver
(-fmodule-path=) as opposed to the 'add a file to your compile line
for each import' that Clang and MSVC are taking:

 http://gcc.gnu.org/wiki/cxx-modules

Why is Clang not doing a directory-centric driver-interface? It seems to
obviously solve problems. I wonder if modules can be a success without
coordination between major compiler and buildsystem developers. That's
why I made the git repo - to help work on something more concrete to see
how things scale.

Having just read all of my old posts again, I still worry things like
this will hinder modules 'too much' to be successful. The more (small)
barriers exist, the less chance of success. If modules aren't
successful, then they'll become a poisoned chalice and no one will be
able to work on fixing them. That's actually exactly what I expect to
happen, but I also still hope I'm just missing something :). I really
want to see a committee document from the people working on modules
which actually explores the problems and barriers to adoption and
concludes with 'none of those things matter'. I think it's fixable, but
I haven't seen anyone interested enough to fix the problems (or even to
find out what they are).

Anyway, you are not here for my rants.

> My current very simplistic prototype, to build a module file, its
> respective module object file, and include those in the library/link
> for anything that depends on this library:
>
>   add_custom_command(
>           COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS} -xc++ -c
> -Xclang -emit-module -fmodules -fmodule-name=Hello
> ${CMAKE_CURRENT_SOURCE_DIR}/module.modulemap -o
> ${CMAKE_CURRENT_BINARY_DIR}/hello_module.pcm -Xclang -fmodules-codegen
>           DEPENDS module.modulemap hello.h

Why does this command depend on hello.h? If that is changed and
module.modulemap is not, what will happen?

>           OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hello_module.pcm
>           COMMENT "Generating hello_module.pcm"
>   )
>   add_library (Hello hello.cxx
> ${CMAKE_CURRENT_BINARY_DIR}/hello_module.pcm)
>   target_include_directories(Hello PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
>   target_compile_options(Hello PUBLIC -fmodules -Xclang
> -fmodule-file=${CMAKE_CURRENT_BINARY_DIR}/hello_module.pcm)
>
> (this is based on the example in the CMake docs using Hello/Demo)

Good that you got something working.

> This also required one modification to CMake itself to classify a pcm
> f

Re: [CMake] C++ standard version fallbacks.

2017-06-05 Thread Stephen Kelly
Craig Scott wrote:

> On Tue, Jun 6, 2017 at 7:50 AM, Stephen Kelly
>  wrote:
> 
>> Roger Leigh wrote:
>>
>> > Hi folks,
>> >
>> > I'm currently using this logic to use C++14 with a fallback to C++11
>> > when C++14 is unavailable:
>> >
>> >if(NOT CMAKE_CXX_STANDARD)
>> >  set(CMAKE_CXX_STANDARD 14)
>> >endif()
>> >if(NOT CMAKE_CXX_STANDARD_REQUIRED)
>> >  set(CMAKE_CXX_STANDARD_REQUIRED 11)
>> >endif()
>> >
>> > which seems to work OK.
>> >
>> > However, for some new stuff, I'd like to use C++17 when available, but
>> > fall back to C++14, C++11 or C++98.  Is it possible to do this?
>>
>> Probably set CMAKE_CXX_STANDARD
>>
>> without CMAKE_CXX_STANDARD_REQUIRED (That variable doesn't really make
>> sense
>> to me and I think it is overused when not needed).
>>
> 
> If you don't set CMAKE_CXX_STANDARD_REQUIRED, then there's no guarantee
> you get any particular minimum standard.

He wants to fall back all the way to C++98. Am I missing something?

> Roger's example (sorry Roger!)
> highlights part of the confusion about this latter variable (and the
> target property it ultimately controls). He appears to be setting it
> expecting it to specify a minimum version, but that's not how it works. It
> is expected to be a boolean which says whether CMAKE_CXX_STANDARD must be
> honoured or not, which most developers (myself included) tend to find
> unintuitive. 

Ok.

I remember I was opposed to introducing CMAKE_CXX_STANDARD_REQUIRED in the 
first place as I think it is redundant. I recommend populating compile 
features for whatever you absolutely need and let cmake populate the std 
flag. If your code can benefit from a more-recent std flag than the 
requirement, then set CMAKE_CXX_STANDARD to that.

> Roger's use would actually make it a bit better, if that was
> how it worked, but unfortunately there's currently no way to set a
> *minimum* standard version,

If you have a minimum, then you must be relying on some language features 
existing and you can list those.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] C++ standard version fallbacks.

2017-06-05 Thread Stephen Kelly
Roger Leigh wrote:

> Hi folks,
> 
> I'm currently using this logic to use C++14 with a fallback to C++11
> when C++14 is unavailable:
> 
>if(NOT CMAKE_CXX_STANDARD)
>  set(CMAKE_CXX_STANDARD 14)
>endif()
>if(NOT CMAKE_CXX_STANDARD_REQUIRED)
>  set(CMAKE_CXX_STANDARD_REQUIRED 11)
>endif()
> 
> which seems to work OK.
> 
> However, for some new stuff, I'd like to use C++17 when available, but
> fall back to C++14, C++11 or C++98.  Is it possible to do this?

Probably set CMAKE_CXX_STANDARD 

without CMAKE_CXX_STANDARD_REQUIRED (That variable doesn't really make sense 
to me and I think it is overused when not needed).

> - I'd like it to work on older CMake versions where "17" isn't a valid
> version for the above; is there any way to introspect the supported
> standards?

Not currently. It could be added now (as a global property), but that won't 
help you for existing CMake versions.

> - And I'd like it to fall back intelligently, i.e. if 17 isn't available
> I want it to select the newest standard possible, rather than falling
> back all the way to 98

I think it already does that.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Absolute path printing of CMakeLists.txt files in title of CMake error messages.

2017-02-12 Thread Stephen Kelly
vbspam wrote:

> *What is the real driver behind?*
> 
> - I use KDevelop as my Linux IDE which has as you may know pretty nice
> CMake integration.

I believe KDevelop is getting support for the cmake server, so exposing 
messages through that would probably solve this aspect. Specifically, there 
is a cmMessenger class and messages go through that. If you add virtual 
method(s?) to it you can add an implementation specifically for the server 
which passes the messages over the protocol to the IDE.

> - Another driver is when I do parallel build on build server, the actual
> context of the CMake error line is hard to determine. Here is impossible
> to get the proper context (the only relevant context is the printed line
> itself).

I'm not familiar with this.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] OBJECT libraries and INTERFACE_SOURCES

2016-12-08 Thread Stephen Kelly
Giovanni Funchal wrote:

> Hi,
> 
> The help page [1] mentions that:
> 
>> Although object libraries may not be named directly in calls to the
>> target_link_libraries() command, they can be “linked” indirectly by
>> using an Interface Library whose INTERFACE_SOURCES target property
>> is set to name $.
> 
> However, I was unable to get this to work. Doing this:
> 
> add_library(lib-obj OBJECT test.cpp)
> add_library(lib INTERFACE)
> add_dependencies(lib lib-obj)
> set_target_properties(lib PROPERTIES INTERFACE_SOURCES
> $)
> 
> And then trying to specify lib in link_libraries of an executable yields
> an error message "Cannot find source file: ... Tried extensions:... ".
> 
> Am I doing something wrong?

This works for me:

cmake_minimum_required(VERSION 3.3)

project(testit CXX)

add_library(lib-obj OBJECT foo.cpp)
add_library(lib-iface INTERFACE)
set_target_properties(lib-iface PROPERTIES
  INTERFACE_SOURCES $
)
add_executable(main foo-user.cpp)
target_link_libraries(main lib-iface)


Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Editing IMPORTED targets

2016-10-16 Thread Stephen Kelly
Ivan Shapovalov wrote:

> On 2016-10-03 at 14:43 +0200, Stephen Kelly wrote:
>> Ivan Shapovalov wrote:
>> 
>> > Hello!
>> > 
>> > Using find modules to detect dependencies has a nice feature: it is
>> > then possible to edit the resulting cache entries to link to
>> > different
>> > libraries (or add other libraries along the found ones, for
>> > whatever
>> > purposes), or change directories, or flags, or whatever.
>> > 
>> > Using find configs and IMPORTED targets, however, prevents doing
>> > this,
>> > because IMPORTED targets are not stored in CMake cache. This can be
>> > a
>> > significant disadvantage at times.
>> 
>> Can you be more specific?
>> 
>> Why can the user provide better information than the supplier of the
>> IMPORTED target?
>> 
>> Thanks,
>> 
>> Steve.
>> 
>> 
> 
> Well, sometimes you need to do certain "maintainer-specific" overrides:
> include custom headers before everything, link to custom libraries
> before everything and so on. Think LD_PRELOAD, but at link time.

What is a 'maintainer' in that sentence? A 'maintainer' can change the 
buildsystem CMake files. I suspect that's not an actor you mean. If you can 
be more specific maybe I will understand.

Would 'wrapping' be a good solution?

 add_library(foo_wrapper INTERFACE)
 target_include_directories(foo_wrapper INTERFACE
   ${custom_includes}
   $
 )
 target_link_libraries(foo_wrapper INTERFACE
   ${custom_libraries}
   Foo::foo
 )


Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Editing IMPORTED targets

2016-10-03 Thread Stephen Kelly
Ivan Shapovalov wrote:

> Hello!
> 
> Using find modules to detect dependencies has a nice feature: it is
> then possible to edit the resulting cache entries to link to different
> libraries (or add other libraries along the found ones, for whatever
> purposes), or change directories, or flags, or whatever.
> 
> Using find configs and IMPORTED targets, however, prevents doing this,
> because IMPORTED targets are not stored in CMake cache. This can be a
> significant disadvantage at times.

Can you be more specific?

Why can the user provide better information than the supplier of the 
IMPORTED target?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] User-overriding IMPORTED targets (overlaying libraries, ...)

2016-09-01 Thread Stephen Kelly
Ivan Shapovalov wrote:

> Of course, I can always edit the FooConfig.cmake file manually, but I'd
> better avoid patching anything (installing new files or running any
> cmake commands is OK).
> 
> Is there any nice way to solve this?

After 

 find_package(Foo CONFIG)

do

 set_property(TARGET Foo::Foo PROPERTY LOCATION "foo_overlay.so")

Apply whatever platform-specific conditions, suffix and prefix are 
appropriate.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] set_directory_properties ADDITIONAL_MAKE_CLEAN_FILES globbing pattern?

2016-09-01 Thread Stephen Kelly
Steve Lorimer wrote:

> Is this just not possible?


Indeed - this is not possible.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Automatic inclusion of import targets found by find_package()?

2016-07-10 Thread Stephen Kelly
Robert Dailey wrote:

> Is there more automation here that I'm not seeing? Thanks in advance.

Yes, the documentation tells you to include what you need in the config 
file:

 
https://cmake.org/cmake/help/v3.6/manual/cmake-packages.7.html#creating-a-package-configuration-file

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Good practice: using INTERFACE-libraries in FindABC.cmake?

2016-02-29 Thread Stephen Kelly
Patrick Boettcher wrote:

> I came across the INTERFACE-type of libraries when writing a
> FindModule.cmake-file for custom libraries installed by my
> project.

You don't provide FindModules for your CMake-built libraries. 

See

 https://cmake.org/cmake/help/v3.4/manual/cmake-packages.7.html

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake 3.5-CMAKE_BINARY_DIR is set to ${CMAKE_SOURCE_DIR} when calling add_subdirectory?

2016-02-22 Thread Stephen Kelly
Attila Krasznahorkay wrote:

> Setting these variables by hand sounds quite dangerous. I'm not sure how
> much this is meant to be supported.
> 

This is definitely UB.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Update/Set _expectedTargets inside exports-release.cmake.

2016-01-12 Thread Stephen Kelly
Rashad Kanavath wrote:

> I am having this when I build packages for debian where I split components
> into separate packages project1-core, project1-gui etc..

I think you need to patch the buildsystems of the software you are packaging 
so that they support that kind of split by exporting to a different export-
set per split component.

ie:

install(TARGETS project1-core EXPORT CoreExports ...)
install(TARGETS project1-gui EXPORT GuiExports ...)
install(TARGETS project1-network EXPORT NetworkExports ...)

and put conditional includes for the resulting files in the 
Project1Config.cmake file.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Why does INTERFACE type targets only support whitelisted properties?

2016-01-11 Thread Stephen Kelly
Taylor Braun-Jones wrote:

> Consider library project Foo that uses a header-only project Bar. In
> FooConfig.cmake, it is a important to ensure any projects using Foo also
> use the exact same version of Bar that Foo was originally built with

COMPATIBLE_INTERFACE_STRING and similar properties are designed for that use 
case. 

You would populate an INTERFACE_ property on the INTERFACE target, which is 
whitelisted already:

 
https://cmake.org/cmake/help/v3.4/manual/cmake-buildsystem.7.html#compatible-interface-properties

 http://article.gmane.org/gmane.comp.programming.tools.cmake.devel/5813

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] add_test to support generator expressions?

2015-10-27 Thread Stephen Kelly
Nils Gladitz wrote:

> On 27.10.2015 19:58, Stephen Kelly wrote:
>> Chris Green wrote:
>>
>>> Ah, I see. It appears I was unclear on the difference between target and
>>> test. What I actually want is the *test* property SKIP_RETURN_CODE,
>>> which there does not seem to be any way to access via a generator
>>> expression. Looks like I'm out of look, unless this is an upcoming
>>> feature?
>> Generator expressions are generally only useful for things which are
>> determined at generate-time.
>>
>> Can't you just read the test property at configure-time instead? You're
>> the one setting the property, right?
> 
> Deferring evaluation to generation time does have the advantage that you
> can set and change properties at any point after the test has been
> created and you can still be sure that the test is invoked with the
> final value.

Right. What I missed is that Chris seems to be making an interface for other 
unknown downstreams to use (a cet_test function).

It would be possible to require the user of cet_test to specify the 
SKIP_RETURN_CODE in a parameter, but there would be unexpected behavior if 
someone omitted that parameter and wrote 

 cet_test(mytest ...)
 set_test_property(mytest PROPERTIES SKIP_RETURN_CODE ...)

instead.

A lot of effort went into cmake targets to make wrappers like 
kde4_add_executable/kde4_add_library unnecessary, and generator expressions 
were a part of that. 

Perhaps it makes sense to put similar effort into making add_test wrappers 
unnecessary, and generator expressions for test properties could be part of 
that. 

However, I don't have so much experience with doing beyond-basic things with 
ctest, so I don't know what kinds of issues arise which lead people to 
create wrappers like that, so I probably can't be of much help.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] add_test to support generator expressions?

2015-10-27 Thread Stephen Kelly
Chris Green wrote:

> Ah, I see. It appears I was unclear on the difference between target and
> test. What I actually want is the *test* property SKIP_RETURN_CODE,
> which there does not seem to be any way to access via a generator
> expression. Looks like I'm out of look, unless this is an upcoming
> feature?

Generator expressions are generally only useful for things which are 
determined at generate-time.

Can't you just read the test property at configure-time instead? You're the 
one setting the property, right?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Problem with CMake 3.3.0-rc3

2015-07-11 Thread Stephen Kelly
Brad King wrote:

> Steve, please take a look.  It looks like the cmState methods
> RemoveUserDefinedCommands and RenameCommand need to work better
> together.  This needs to be fixed for 3.3.

Fixed with

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2ee169d
 cmState: Restore renamed commands on cleanup

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] cmake-qt: controlling includes order

2015-07-08 Thread Stephen Kelly
Bill Somerville wrote:

> Also this is all due to a
> Mac issue where having MacPorts Qt4 installed causes it to be pulled in
> when some other MacPorts library is used, in this case FFTW3. Most of
> our developers work on Windows and Linux and are not going to know that
> this abomination is required to stop the Mac build breaking.

Yes, I've hit this issue before too. I filed 

 http://public.kitware.com/Bug/view.php?id=15643
 
to track it.

> I see target_include_directories() has a BEFORE option but no AFTER
> option, I would have thought that is necessary to be the equivalent of
> the directory level include_directories() command.
> 
> It would also help to understand how the Qt5 include directories get
> added when they are not specified at all, i.e. when something like:
> 
> add_executable(hello main.cpp)
> target_link_libraries(hello Qt5::Widgets)
> 
> is used alone.

In this case:

 add_executable(hello main.cpp)
 target_include_directories(hello PRIVATE /opt/foo)
 target_link_libraries(hello Qt5::Widgets)
 target_include_directories(hello PRIVATE /opt/bar)

the order will be 

 -I/opt/foo -I/opt/bar -I/opt/qt5/include/Qt5Widgets etc...

When generating the list of directories to include, the ordered contents of 
the INCLUDE_DIRECTORIES property is processed first, and after that, the 
include directories of any ordered linked targets are appended. The ordering 
is the order of each different set of commands.

Hope that helps. If you think the documentation can be clarified here, 
please contribute a patch, possibly to the cmake-buildsystem manual.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Finding internal libraries

2015-07-08 Thread Stephen Kelly
John LaGrone wrote:

> However, if I try to build the
> examples and the library at the same time, the configuration fails
> because it cannot find the library "foo" for examples because it has not
> been compiled.
> 
> I know I can build everything at once and it will work, ...

I don't understand. Does building the examples and lib (ie, 'everything') 
together work or not?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Cannot add target-level dependencies to non-existent target

2015-06-30 Thread Stephen Kelly
Glenn Coombs wrote:

> I am getting the error in the subject.  The code I have looks like this:
> 
> if (PRE_COMPILED_HEADERS_FOUND)
> ADD_PRECOMPILED_HEADER(${header_pch} ${source_pch} sources
> systemc)
> endif()
> 
> add_library(systemc ${sources} ${sources_no_pch} ${headers})
> 

Use target_sources after the target is created.

 add_library(systemc ${sources} ${headers})
 if (PRE_COMPILED_HEADERS_FOUND)
   ADD_PRECOMPILED_HEADER(${header_pch} ${source_pch} pch_files systemc)
   target_sources(systemc PRIVATE ${pch_files})
 endif()

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Using generator expressions with set_target_properties

2015-06-30 Thread Stephen Kelly
Stephen Kelly wrote:

>> Any suggestions on how I might accomplish this in a reasonable way?
> 
> Add the flag with target_link_libraries instead.

Ah, I see you tried that, sorry for the noise.

Thanks,

Steve.



-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] cmake-qt: controlling includes order

2015-06-30 Thread Stephen Kelly
Bill Somerville wrote:

> Any ideas how I can control the ordering or reorder the
> TARGET_INCLUDE_DIRECTORIES property?


 add_executable(hello main.cpp)
 target_link_libraries(hello Qt5::Widgets)
 target_include_directories(
   $
   ${otherIncludes}
 )

Thanks,

Steve.

-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Using generator expressions with set_target_properties

2015-06-30 Thread Stephen Kelly
Patrick Griffiths wrote:

> I'm trying to add the /PDBSTRIPPED option LINK_FLAGS_RELWITHDEBINFO config
> (Visual Studio generator, obviously):
> 
> set_target_properties(target PROPERTIES
>   LINK_FLAGS_RELWITHDEBINFO
> 
> "/PDBSTRIPPED:
$/stripped/$.pdb")
> 
> Unfortunately the generator expressions aren't being expanded.
> 
> Any suggestions on how I might accomplish this in a reasonable way?

Add the flag with target_link_libraries instead.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Recursively include target include directories only

2015-06-21 Thread Stephen Kelly
Petr Kmoch wrote:

> On Thu, Jun 18, 2015 at 1:43 AM, Robert Dailey
>  wrote:
> 
>> On Wed, Jun 17, 2015 at 4:31 PM, Dan Liew
>>  wrote:
>> > On 17 June 2015 at 12:28, Robert Dailey
>> > 
>> wrote:
>> >> Is there a way to only take (recursively) the include directiories
>> >> from a target or set of targets? I know that include directories
>> >> propagate when passing targets to target_link_libraries(), but I do
>> >> not want to link the libs; I only want the include directories.
>> >>
>> >> How can I do this? Thanks.
>>
> 
> I haven't tested this, but it should be possible to drag in the interface
> properties explicitly with generator expressions. Something like this:
> 
> add_executable(Depender ...)
> target_include_directories(Depender PRIVATE
>   $
>   $
> )
> 
> dtto for other INTERFACE_... properties you might need.


He seems to want INCLUDE_DIRECTORIES, not INTERFACE_INCLUDE_DIRECTORIES as 
he's compiling a file from the target.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] How does :: actually works?

2015-06-17 Thread Stephen Kelly
Klaim - Joël Lamotte wrote:

> Thinking about boost, if package files works well with header-only
> libraries (which I
> suppose it should as long as the boost define header-only targets)
> then it would be very useful indeed.

Yes, I wrote some cmake 3.0 features specifically for the Boost use cases 
(header only and lots of cyclic dependencies).

> Then I have to have all my libraries to link with all the boost libraries
> listed in the boost
> library variable generated by FindBoost.

I don't have working knowledge of FindBoost, so I can't give a good answer. 
The documentation at the top of the file says it creates a variable per 
library though.

> If I understand correctly, if FindBoost was supporting imported targets
> and using "Boost" as a
> namespace (like Qt does), then I could link my libraries to boost
> libraries in a more
> precise way as I would link each library separately instead of everything
> FindBoost
> put in the boost libraries variable.

This still has other advantages anyway, such as transitivity, conciseness, 
consistency, better error messages etc.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] How does :: actually works?

2015-06-17 Thread Stephen Kelly
Klaim - Joël Lamotte wrote:

> I didn't realize at all that the FindPackage way is supposed to be
> obsolete now.

It is not obsolete, but it is not a good approach (since CMake 2.6.0 
already) if the upstream uses cmake, because config file packages provide a 
better experience for downstreams

 http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html

Even for upstreams that do not use cmake, it is preferable to generate 
config file packages for a good downstream experience for cmake users. That 
is what Qt qmake and LLVM Makefile buildsystems do. Boost b2 could do it 
too:

 http://thread.gmane.org/gmane.comp.lib.boost.devel/259011/focus=259445

> I'm quite surprised actually.

We prefer not to accept new Find modules into the cmake tree because that 
puts the maintenance burden on us, and because it is an inferior user 
experience. Some new Find modules still get in, but they need to have a 
reason to get in.

> Ok I'll check PackageConfig.cmake for my new and even current projects
> if it can help with managing the tons of libraries I work on.

Do please let us know how that goes.

> I will consider providing patches, if I can spend time on this once and
> not bother
> later it would help a lot.

Documentation here explains how to do that for Find modules:

 
http://www.cmake.org/cmake/help/v3.2/manual/cmake-developer.7.html#a-sample-find-module

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] determining which system headerfile provides a given function

2015-06-09 Thread Stephen Kelly
René J.V. Bertin wrote:

> Hello,
> 
> I need to determine the availability of a certain function (reallocf) and
> which headerfile provides its prototype. If there is a function that
> handles this case I must have overlooked it (including on google), so I
> tried repeating a check_symbol_exist() call repeatedly with the various
> known header file paths. But that also doesn't work, either because of
> caching or because I'm doing something else wrong.
> 
> So, how does one handle this kind of situation?


 http://www.macieira.org/blog/2012/05/doesnt-work-doesnt-work/

 http://sscce.org/




-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Conditional transitive link libraries

2015-06-03 Thread Stephen Kelly
Daniel Wirtz wrote:

> Hey,
> 
> so while this is a suitable solution for 3-level transitive packages, it
> will break as soon as you have

I don't understand. Please provide an http://sscce.org/ if you can.

> more than that..
> i realized there is no "native" solution to the problem, and the

The native solution is documented here:

 
http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages

If there is a 3-level or further problem, then I am not aware of it.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Conditional transitive link libraries

2015-06-03 Thread Stephen Kelly
Daniel Wirtz wrote:

> Hello all,
> 
> I'm struggling with the CMake "Config"-based package description when
> using two depending packages where the upstream package has optional
> link libraries.

For reference, you have the right answer and the link to the right 
documentation on SO

 http://stackoverflow.com/questions/30568733

Thanks,

Steve.

-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Setting install dir based on Debug or Release

2015-05-25 Thread Stephen Kelly
Scott Aron Bloom wrote:

> The problem I see, is the code only gets executed once, and at that point
> the CMAKE_BUILD_TYPE isn't set yet..  Yes I realize this for windows, so
> it is a multi-config system.. but I cant believe Im the only one with this
> issue.

See 

 
http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/52088/focus=52095

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Ninja generator: skip checking of dependencies when building a target

2015-05-21 Thread Stephen Kelly
Taylor Braun-Jones wrote:

> Does the CMake Ninja generator support a way to skip dependencies when
> building a target? Something like the target_name/fast feature for the
> Makefile generator? [1]

I believe the last time that was raised was 

 
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3471/focus=3483

If you have new information, feel free to file a bug and link to that.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] FindModules.cmake quality + Kitware proposition

2015-05-14 Thread Stephen Kelly
Nagy-Egri MC!tC\) Ferenc via CMake wrote:

> Tried jom years ago. Still chokes on Unicode paths.

Ok, I guess the jom developers are the ones to discuss that issue with.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Alias of imported target

2015-05-14 Thread Stephen Kelly
CHEVRIER, Marc wrote:

> 
> My need is the following:
> I have two imported targets, let say, IMPORTED::TARGET and
> IMPORTED::STATIC::TARGET
> 
> 
> And I have a project which can be customised, through an option, by
> selecting which imported target will be used (shared or static).
> 
> So I tried, at first place:
> if (USE_IMPORTED_STATIC)
>   add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::STATIC::TARGET)
> else()
>   add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::TARGET)
> endif()
> 
> So, after, I do not longer take care of which imported target is selected!

This makes sense to me, thanks.

I filed 

 http://public.kitware.com/Bug/view.php?id=15569

to track it.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Alias of imported target

2015-05-14 Thread Stephen Kelly
Ruslan Baratov via CMake wrote:

> It may be helpful in situations when you build package with examples. In
> case when you want examples to work both as a part of a project
> (add_subdirectory) or stand-alone (find_package).

I expect external_project may lead to more readability for this case, though 
the case you described also makes sense.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Making the export function output relative paths

2015-05-14 Thread Stephen Kelly
John van der Burg wrote:
> I basically need everything relative to the ${CUSTOM_ROOT} folder.
> 
> Any hints/help would be appreciated :)

Use install(EXPORT) instead:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f79d6025

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] FindModules.cmake quality + Kitware proposition

2015-05-14 Thread Stephen Kelly
Nagy-Egri Máté Ferenc via CMake wrote:

> ... NMake batch mode support for multicore build, etc.

I suggest you look into 'jom'.

Thanks,

Steve.

-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Target_link_libraries imported library

2015-05-14 Thread Stephen Kelly
Lars wrote:

> 
> There is one problem with this setup and that is the
> IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE contains a static path to a
> boost lib. So the "c:\boost\lib\boost_filesystem-vc110-mt-1_55.lib" is
> appended to the linking of "bar-library" and this will fail if the path is
> incorrect. We cannot guarantee that boost is located at the same path on
> all Windows system. So how can we remove or update the boost path?

The cmake-packages(7) manual in master describes this case (and used to 
mention Boost explicitly)

 
http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#creating-relocatable-packages

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af13782

Another option not listed at the end there would be to create IMPORTED 
targets for Boost yourself and maintain that. You could create a wrapper 
around FindBoost.

The ideal situation would be for Boost to ship cmake-config-packages itself, 
but that suggestion doesn't get much support from Boost devs (probably 
because they are not cmake fans :) ).

Thanks,

Steve.

-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Alias of imported target

2015-05-05 Thread Stephen Kelly
CHEVRIER, Marc wrote:

> 
> Hi,
> 
> Currently it is not possible to create an alias target for an imported
> target (I.e. add_library with ALIAS keyword). But I don’t understand what
> is the technical constraint or semantic reason behind this limitation. If
> anybody can explain this limitation, it will be nice.

It was designed with as many restrictions as I could think of (everything 
which was not part of the need to add it at all):

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=370bf554

The restrictions are there because they are easy to lift later when a need 
arises without breaking user code. It also means that design considerations 
which were not known or understood two years ago can be considered in 
designing new interfaces.

Do you have a need for ALIAS IMPORTED libraries? Can you describe it?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] C++Now / BoostCon / Boost 2.0

2015-05-01 Thread Stephen Kelly
Robert Ramey wrote:

> all things boost - which will touch upon CMake/CTest/CDash.  I have
> recommended CMake... for boost - like projects and would like to see it
> more widely accepted. http://rrsd.com/blincubator.com/tools_cmak/

There are many typos on the page (and even in the url). You might want to 
proof-read/copy-edit it in a text editor before publishing it more-widely.

> I'm
> aware that in the past there was a large effort to switch boost to CMake
> from Boost Build which ended in failure.

The CMake solution didn't result in interest from Boost.

It's the approach that uses modern CMake features though (including features 
designed and implemented specifically for Boost), so it's likely the better 
approach if Boost decides to make use of CMake at all.

Enjoy the conference,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] How to work around permission deficiencies of file(GENERATE...)?

2015-04-30 Thread Stephen Kelly
Alan W. Irwin wrote:

> But please keep
> in mind that the configure_file_generate function approach is itself a
> temporary workaround, and for CMake users who need to configure files
> that include generator expressions, a much cleaner approach will be
> possible if CMake developers implement a configure_file(... GENERATE
> ...) signature which configures generator expression items (and also
> configures all other items at generate time that configure_file
> without the GENERATE option configures at configure time).
> And if you do decide to implement something like that, I would be
> happy to test it for you.

Yes, something like that might make sense, but it's not on my radar 
currently to design/implement it. If someone else has the bandwidth for it, 
I can review it.

Thanks,

Steve.



-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] How to work around permission deficiencies of file(GENERATE...)?

2015-04-30 Thread Stephen Kelly
Alan W. Irwin wrote:

> However, until that is implemented (or configure_file(GENERATE ...) is
> implemented with the usual configure_file permission semantics which
> just copies the permissions of the source file) I need a method of
> setting file permissions at generate time.  Is there currently _any_
> way to do that under CMake?

Yes, CMake 3.2 uses the permissions of the input file if present:

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81afbbc0
  
I recommend trying that for your use, and if it works, I think setting 
CMP0026 to OLD for CMake >= 3.0 && < 3.2 would be ok.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] cmp0026, file(GENERATE...), and configure_file

2015-04-18 Thread Stephen Kelly
Alan W. Irwin wrote:

> So is it recommended that a two-step procedure be used to configure
> a file?  For example:

Yes, that seems to be a valid thing to do.

> If the above complications for configured files are the only way to
> deal with a mixture of @...@ items and generator expressions to
> configure, could a change to configure_file so that it honors
> generator expressions be implemented to avoid these complications?

Nope, generator expressions are only available at generate-time, but 
configure_file is evaluated before that.

Thanks,

Steve.



-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] ExternalProject can't have interface library as a dependency

2015-04-18 Thread Stephen Kelly
Andrey Pokrovskiy wrote:

> /* I'm using cmake-3.2.20150331-gb190c. */
> 
> I have a following construction:
> 
> ExternalProject_Add(
> websockets_ep
> DEPENDS ev openssl
> ...)
> 
> But it so happened, that "openssl" is a INTERFACE library.

That sounds odd. What provides it as an INTERFACE library?


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Strange behaviour of STREQUAL with a variable containing only "type"

2015-04-18 Thread Stephen Kelly
Nils Gladitz wrote:

> It is expected if "type" itself is a variable (set by some module
> evaluated by project()).

Indeed we should probably clean up after ourselves (in the project() 
implementation) when using such generic names...

Thanks,

Steve.

-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Find Module, add_library shared and static : standard ?

2015-04-13 Thread Stephen Kelly
r2d2leb...@voila.fr wrote:

> Hi,
> 
> I need to write a FindModule which search static and shared version of my
> lib. 

If it is your library, then you provide a Config.cmake file, not a 
FindModule:

 http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html

> I would like to know what is the standard name, convention to import
> library static and shared ? (MyLib.a and MyLib.so) 
> * Two names ?
> (Foo::MyLib, Foo::MyLibStatic) ? (Foo::MyLib, Foo::Static::MyLib) ? 

I think this is the best solution cmake currently offers.

The bug 

 http://public.kitware.com/Bug/view.php?id=4222

tracks this.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Enable C++11 for a Target with Intel

2015-04-07 Thread Stephen Kelly
Robert Maynard wrote:

> Currently the only compilers that support compiler features are:
> 
> Apple Clang versions 4.4 though 6.1.
> GNU compiler versions 4.4 through 5.0 on UNIX and Apple.
> Microsoft Visual Studio versions 2010 through 2015.
> Oracle SolarisStudio version 12.4.
> 
> If you are interested in adding support for the intel compilers you can
> look at:
> Modules/SunPro-CXX-FeatureTests.cmake and
> Modules/GNU-CXX-FeatureTests.cmake
> 

Here's a starting point for someone sufficiently interested:

 https://github.com/steveire/CMake/commit/3f16f927235ebd91603f8314a8

However, I believe the compiler features vary by operating system, so more 
conditions would be needed.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] iOS multi-arch library target and xcodebuild

2015-04-02 Thread Stephen Kelly
Jason Cooper wrote:

> Is there a plan to merge the above into cmake as a module?
> 
>> You can of course do something similar for Android:
>>
>> https://github.com/taka-no-me/android-cmake/blob/master/android.toolchain.cmake
> 
> Ah, thanks for the heads up.  I'll need that later.

There should be no need for anything as complicated as that huge 
android.toolchain.cmake file. CMake has a Modules/Platform/Android.cmake 
file, and cross compiling for Android should really be a case of specifying 
simple things local to you such as your compiler paths etc.

 
http://www.cmake.org/cmake/help/git-next/manual/cmake-toolchains.7.html#cross-compiling

I filed 

 http://public.kitware.com/Bug/view.php?id=15492

for better documentation there (and to find out what features are missing in 
CMake which would make everything easier). If you know what is missing in 
CMake but required to make cross compiling for android simpler, please add 
it there.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Full paths for transitive dependencies

2015-03-18 Thread Stephen Kelly
Adam wrote:

> I happened to stumble acrosss this today.  I fixed it by adding another
> find_package to the last project but this seems to defeat the purpose of
> transitive dependencies.  What am I doing wrong?

The docs I linked to describe Config files which include() the result of 
install(EXPORT).

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Globally disable AUTO MOC

2015-03-16 Thread Stephen Kelly
Scott Aron Bloom wrote:

> I have found I can disable it project by project, but I cant seem to
> disable it, globally for every project
> 
> Is there a way (or point in the cmake flow) to disable it globally?

It is disabled by default. It is defaulted to on for targets following the 
setting of the CMAKE_AUTOMOC variable to ON (or another truthy value). Maybe 
you have that in your code.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Full paths for transitive dependencies

2015-03-16 Thread Stephen Kelly
Richard Taylor wrote:

> 
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
>

Prefer the official documentation instead of the wiki wherever official 
documentation exists (especially if it is well-formatted; that means it's 
probably recent and maintained).

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html
 
> However, only the names of dependent targets are set (via
> INTERFACE_LINK_LIBRARIES in Targets.cmake)
> 
> I guess that's where the problem lies, I'm just not sure how to fix it..

The above link documents a find_dependency macro, which you might make use 
of.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] List all binaries associated with a target.

2015-03-16 Thread Stephen Kelly
Klaim - Joël Lamotte wrote:

> I am looking for a (hopefully simple) way to do the following:
> 1. gather a list of paths of all the binaries associated with a target,
> that is all the linked dll/so and executable the target link or depend
> on.

Apparently I starting thinking about a genex to do that a year ago, but I 
didn't complete it. I just filed 

 http://public.kitware.com/Bug/view.php?id=15449

Feel free to pick it up if you wish.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] List all binaries associated with a target.

2015-03-16 Thread Stephen Kelly
Klaim - Joël Lamotte wrote:

> Actually 2 and 3 are the same, I just put the files in a specific place in
> the
> build directory so that it looks like installed, but I do this when the
> binary is
> built so that it's always up to date while debugging.
> Now, I use post-build command (add_custom_command) to do this indeed
> but I didn't find a way yet to trigger install() a specific binary on
> post-build yet,
> but I suppose I just missed it so far.

There might be space for a first class feature in cmake for 'make something 
that looks like the install tree at build time'. Please file an issue to 
track it.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] can I make an AUTOMOC generated file depend on something ?

2015-03-05 Thread Stephen Kelly
Kim Rydhof Thor Hansen wrote:

> On Wed, Feb 25, 2015 at 10:45 PM, Stephen Kelly 
> wrote:
>> Kim Rydhof Thor Hansen wrote:
>>
>>> 
http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html
>>>
>>> I have a similar problem because automoc doesn't pick up that my
>>> metadata.json file is a dependency to the generated moc_plugin.cpp
>>> when building a Qt plugin
>>
>> Thanks for the testcase. I filed
>>
>>  http://public.kitware.com/Bug/view.php?id=15419
>>
>> with more information on what should be done to fix this.
> 
> Thanks for your work on this.
> 
> I can't find a good workaround, I tried using autoget_target_depends
> without success but I suspect that it is because I have done something
> wrong.
> 
> Can anyone suggest a line to put in CMakeLists.txt in order to
> manually register the dependency between metadata.json and
> moc_plugin.cpp?

A workaround would have to be based on changing the timestamp of the .h 
file. Here's an ugly workround:

add_custom_command(
  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/metadata.json"
  COMMAND ${CMAKE_COMMAND} -E copy 
"${CMAKE_CURRENT_SOURCE_DIR}/metadata.json.in" 
"${CMAKE_CURRENT_BINARY_DIR}/metadata.json"
  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/plugin.h.in" 
"${CMAKE_CURRENT_BINARY_DIR}/plugin.h"
  DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/metadata.json.in" 
"${CMAKE_CURRENT_SOURCE_DIR}/plugin.h.in"
)

set_property(TARGET plugin PROPERTY AUTOGEN_TARGET_DEPENDS 
"${CMAKE_CURRENT_BINARY_DIR}/metadata.json")

Depending on how you order your include directories, you might not have to 
rename the .h.

Thanks,

Steve.



-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] can I make an AUTOMOC generated file depend on something ?

2015-02-25 Thread Stephen Kelly
Kim Rydhof Thor Hansen wrote:

> http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html
> 
> I have a similar problem because automoc doesn't pick up that my
> metadata.json file is a dependency to the generated moc_plugin.cpp
> when building a Qt plugin

Thanks for the testcase. I filed 

 http://public.kitware.com/Bug/view.php?id=15419

with more information on what should be done to fix this.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMP0026 - Disallow use of the LOCATION target property

2015-02-24 Thread Stephen Kelly
Jifeng ZHANG wrote:

> Any idea when CMake 4.0 is planned to release? So we can get a general
> idea when the old behavior will stop working.

What will you do when it is released and the LOCATION property does stop 
working for build targets? Whatever it is, any reason not to do it now?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Problems with combo CMake/MSVC2013/Qt5

2015-02-24 Thread Stephen Kelly
Jakob van Bethlehem wrote:

> Dear users,

>   set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake")

Don't do this. Pass CMAKE_PREFIX_PATH as an argument to cmake.

> The CMakeLists.txt file in the subfolder looks like this:
> 
>   CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)

This has effects you probably don't intend. I suggest removing it.

 http://www.cmake.org/cmake/help/v3.1/manual/cmake-policies.7.html

> The problem: for some reason when compiling mymain.cpp I get:
>   fatal error C1083: Cannot open include file: 'mylib_export.h': No such
> file or directory
> 
> I already checked that the build-folder is added as an include directory,

The build folder of the top-level is added as an include directory. Your 
export.h file is in the subdirectory.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Mixed linking

2015-02-21 Thread Stephen Kelly
Ray Donnelly wrote:

>> >
>> > 1) Am I right when I say CMake, Qt and static linking don’t mix ?
>>
>> They should mix fine.

What I meant when I wrote this was 'they should mix fine, but some 
convenience is not available - you need to specify the correct link flags 
yourself'. 

That is, it's 'fine' in the same way that other static libraries which don't 
provide any cmake files at all are 'fine' and leave everything to you.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Mixed linking

2015-02-21 Thread Stephen Kelly
Ghyslain Leclerc wrote:

> Thanks for all the insight.  I have been looking at this and quite a few
> posts (mostly from you !) to try and understand.  I think I get most of
> it.
> 
> That being said, I finally got a static executable for my application on
> my mac. What I did is build my application using qmake, get the linker
> command and manually find every library using cmake in order to recreate
> the linker command from qmake (I don’t think it makes a difference, but
> I’m not sure so I even kept the library order the same).

Yes, I think it makes a difference. It also makes a difference whether 
find_library finds the exact same binary which Qt statically links or not. 

The inability to determine which static library (by exact path) is linked by 
the Qt libraries is the reason the Qt5 CMake files don't list the static 
libraries in their INTERFACE_LINK_LIBRARIES. Your find_library calls are not 
a fully generic solution because find_library might find a different binary 
to what Qt is linked to.

> This seems like a lot of work to get what I want…  But if it does the job.
>  The fun part will be to see what I need on Windows and then put
> conditionals around that and all.
> 
> If I misunderstood something and there is an easier way to get a static
> executable from using static qt from CMake, please let me know.

What I referred to with INTERFACE_SOURCES was just about automatically 
linking in the platform plugin in a static build.  That is provided by Qt, 
so ew know the full path, but we need to generate a file which you compile 
into the executable so that your executable uses a symbol from it. Otherwise 
the linker discards it. So my message was just saying that that part can be 
made simpler.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Problem with CMAKE_AUTOMOC files not being regenerated or cleaned

2015-02-21 Thread Stephen Kelly
René Tschirley wrote:

> Simplified
> the problem and verified if the set_directory_properties trick works. It
> does not work for me.
> 
> Used software: Windows7 SP1, CMake 3.1.2, Ninja 1.5.3.

> Am I forgetting something obvious? Is this an unfixed CMake bug?

Yes, it is: 

 http://public.kitware.com/Bug/view.php?id=13371

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Lower the barrier of entry to the wiki

2015-02-21 Thread Stephen Kelly
Gonzalo BG wrote:

> This is what happened:

> - For making an account I had to fill up a 50 words bio .

Years ago this prevented me from creating a wiki account. I put 'this page 
intentionally left blank' in this field because I thought I shouldn't have 
to fill a bio to edit a wiki (like you presumably). My account request was 
rejected, so I used the kde wiki instead :).

 https://community.kde.org/Frameworks/Epics/CMake_target_usage_requirements

> I think that having a wiki with such a high barrier of entry is pointless.
> By the time my account gets reviewed it is going to be a miracle if I
> actually get to contribute those recipes.

What do you want to edit? Would it be better to improve the CMake 
documentation instead?

 http://www.cmake.org/cmake/help/v3.1/

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Minor documentation mistake

2015-02-21 Thread Stephen Kelly
Cutberto Escamilla wrote:

> Hello,

> I tried searching the different archives, but there is no mention about
> this. Was wondering if I should submit a bug.

Thanks for the note.

I've pushed a fix here:

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f93438cd
 Fix typo, graphiz -> graphviz.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] add_dependencies: Disallow use with INTERFACE_LIBRARY. WHY?!?

2015-02-21 Thread Stephen Kelly
Andrey Pokrovskiy wrote:

> Hi,
> 
> Current CMake disallows Interface Libraries to have dependencies.

I filed  

 http://public.kitware.com/Bug/view.php?id=15414

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Not hardcoding install dir in Config.cmake.

2015-02-08 Thread Stephen Kelly
Chris Dembia wrote:

> Hey all:
> 
> I work on a project that is used heavily on Windows. Our project also
> creates a Config.cmake file. During build time, we do not know where the
> project will actually be installed on the user's system. However, the
> Config.file needs to know the installation directory of the package.

I'm curious why that's needed? I guess it's for things like include 
directories? You might consider creating IMPORTED targets instead and 
encoding the include directories into those instead.

 
http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html#creating-packages

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Mixed linking

2015-02-06 Thread Stephen Kelly
Norbert Pfeiler wrote:

>>
>> But I just don't know how to include the plugins.  Actually, I always get
>> the error about the platform plugin (cocoa in my case).  Any tips ?
> 
> 
> For Windows it’s like this:
> 
> #if defined(Q_OS_WIN) && defined(QT_STATIC)
> #include 
> Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
> #endif

Ah, right the platform plugin issue. This is likely the reason for not 
running on OSX.

CMake 3.1 learned a new feature specifically so that this would become 
easier in the future:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/7970

qmake generates a file like the above for you and compiles it and links it 
into your application for you in the static version.

With 

 http://www.cmake.org/cmake/help/v3.1/prop_tgt/INTERFACE_SOURCES.html

Qt can do the same, but someone would have to patch Qt to do so. Something 
for the future... :)

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] CMP0026 - Disallow use of the LOCATION target property

2015-02-06 Thread Stephen Kelly
Jifeng ZHANG wrote:

> Hi,
> 
> I have a question of policy CMP0026. Our project currently is on CMake
> 2 and we are planning to move to CMake 3.

Lot's of questions on that lately. Someone opened the floodgates it seems 
:).

> When we run CMake3.1.1, we get get a few warnings due to the policy
> CMP0026, "Disallow use of the LOCATION target property". Even though
> with those warnings, our cmake scripts still work fine and we are
> getting the property correctly.

> So my question is, will the support of this kind of usage be dropped
> in the future releases? 

Yes. That is the purpose of the policy. Attempting to read the LOCATION will 
eventually be an error. That is not going to happen before CMake 4.0 though.

> If we migrate away from get_target_property, "$ generator
> expression" is suggested from CMake3.1.1's documentation. So to get
> the LOCATION of ${TEST_PROJECT}, I can use:
>   set (TEST_PATH $)

This won't work. You need to use the generator expression instead of a cmake 
variable. You use the generator expression in place of ${TEST_PATH} in 
add_custom_command or wherever you use it.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Mixed linking

2015-02-05 Thread Stephen Kelly
Ghyslain Leclerc wrote:

> Here are a few questions for the list (hoping someone more knowledgable
> than me will read this and help):
> 
> 1) Am I right when I say CMake, Qt and static linking don’t mix ?

They should mix fine.

> 
> I have tried on OS X.   I have compiled a static version of Qt, making
> sure I explicitly enable every plugin I need.  Then, I have used the
> following CMake code :

I recommend starting with a minimal testcase, make sure it runs, and add 
things until it doesn't. Find the change that breaks. 

> qt5_use_modules( calculum Widgets Sql )

You probably don't need this line.

I don't have experience on OSX to help.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Resolving CMP0026 warnings

2015-02-05 Thread Stephen Kelly
Knox, Kent wrote:

> The problem is that get_prerequisites( ) needs a path to the target.  How
> do I now get this path without calling the LOCATION property?  I don't
> know where I can use a generator expression.

Replace your configure_file with something like

 file(GENERATE OUTPUT 
"${CMAKE_CURRENT_BINARY_DIR}/copyLibraryDependencies$.cmake"
   CONTENT "if(CMAKE_INSTALL_CONFIG_NAME STREQUAL $)
 set(libraryLocation $)
   endif()
"
 )

There's no need to 'fix' the library then. Of course, if there are multiple 
targets, you might want to generate a loop instead of one such file per 
target etc. I'll leave it to you to parametrize whatever you want :).

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Workaround for CMP0026

2015-02-05 Thread Stephen Kelly
NoRulez wrote:

> Thank you for your help.
> 
> I think that for the replacement there is some missing documentation
> outstanding, because i didn't find the "TYPE" attribute in the "file"
> function for example.

I copied and modifier the content from a generated cmake_install.cmake 
script.

The install(SCRIPT) command doesn't specify what can go into such a script. 
That's a gap in the docs.

> Or examples for the CMP0026 policy like in the CMP0043 documentation.
> 
> Nevertheless, I also need to change the filename from
> "dirInstallScript.cmake" to "dirInstallScript$.cmake" in the
> "file(GENERATE" statement and use the hard coded filename
> "dirInstallScriptRelease.cmake" in the "install(SCRIPT" statement, because
> if i didn't so, I get several warnings/errors when generating with Visual
> Studio generator.

Yes, I didn't test with that generator, but I see why that was needed. I'm 
sure it's possible to avoid hardcoding 'release' in the script. You can 
generate conditions or anything.

> Is this really the right way?

Nope, this is a workaround for lack of generator expression support in the 
install(DIRECTORY) command, similar to 

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e89c8a5

I don't know if that's not possible for any reason, but it seems to be what 
you want.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Workaround for CMP0026

2015-02-04 Thread Stephen Kelly
NoRulez wrote:

> Hello,
> 
> currently I'm updating my CMake scripts to use newer features and/or to
> solve some old workarounds.

I think you're looking for 


  file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dirInstallScript.cmake"
CONTENT   " 
  if (CMAKE_INSTALL_CONFIG_NAME STREQUAL RELEASE)
file(INSTALL DESTINATION
  \"\${CMAKE_INSTALL_PREFIX}/share/myproj\" TYPE DIRECTORY
  FILES \"$/MyDir\")
  endif()")

  install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/dirInstallScript.cmake")


Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] automoc autorcc

2015-01-31 Thread Stephen Kelly
Norbert Pfeiler wrote:

>>
>> Ok. In that case you must be doing something different to the testcase:
>>  http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e1c359fe9
>> If you have a http://sscce.org/ please add it to
>>  http://public.kitware.com/Bug/view.php?id=15074
> 
> 
> The issue report you linked indicates that the fix is effective in CMake
> 3.2 not 3.1,
> coincidentally I also cannot find the changes from the commit in the
> official 3.1 sources.
> 
> Waiting for the 3.2 release then.

Oops, you're right. I misinterpreted the git output.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] automoc autorcc

2015-01-30 Thread Stephen Kelly
Norbert Pfeiler wrote:

>>
>> > When i use qt5_add_resources and some of my resources change they get
>> > recompiled during the next invocation of my build tool. Whereas when i
>> use
>> > cmakes autorcc this is not the case.
>> This was fixed in CMake 3.1.
> 
> 
> Well, I’m using CMake 3.1.1, so apparently it’s not.

Ok. In that case you must be doing something different to the testcase:

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e1c359fe9

If you have a http://sscce.org/ please add it to 

 http://public.kitware.com/Bug/view.php?id=15074

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] automoc autorcc

2015-01-29 Thread Stephen Kelly
Norbert Pfeiler wrote:

> Hello,
> i’m curious about 2 things and therefore wanted to ask:
> 
> When i use qt5_add_resources and some of my resources change they get
> recompiled during the next invocation of my build tool. Whereas when i use
> cmakes autorcc this is not the case.

This was fixed in CMake 3.1.

> 
> Secondly, with qt5_wrap_cpp every file gets processed in parallel – well,
> because they don’t depend on each other. In contrast, automoc mocs
> everything in sequence (for one target) which is a noticeable bottleneck
> on an 8 core machine.

This was part of the original design of the automoc feature. Maybe it could 
be done better, but as far as I know, no one is working on it.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] target_link_libraries replacing fully-qualified library with -l

2015-01-29 Thread Stephen Kelly
Chris Green wrote:

>  this library is found with
> find_library as part of a config.cmake file invoked as part of
> find_package()

Consider reading 

 http://www.cmake.org/cmake/help/v3.1/manual/cmake-packages.7.html

at some point.

find_library and config files don't go together.

Thanks,

Steve.



-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] whole archive linkage

2015-01-24 Thread Stephen Kelly
Adam wrote:

> I was hoping there might have been a better way to do this with target
> properties of legacyLib.
> 

There is with cmake 3.1:

 set(isExe $,EXECUTABLE>)
 target_sources(legacyLib INTERFACE 
  "$<${isExe}:${CMAKE_CURRENT_SOURCE_DIR}/use_symbol.cpp>")

LegacyLib provides a simple source file which gets compiled into executables 
linking to it, and the source file invokes the singleton or whatever.

This kind of use-case was the primary motivation for target_sources.

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/7082

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


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

2014-12-30 Thread Stephen Kelly
Paul Smith wrote:

> I've thought about many ways to do this, but I can't seem to get around
> the fact that generator expressions like $ are only
> available within the commands of the target.

It would probably help to have an sscce to experiment with.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Invoke-Build support

2014-12-30 Thread Stephen Kelly
Nagy-Egri Máté Ferenc via CMake wrote:

> I wasn’t hoping for much enthusiasm, but at least some feedback would be
> welcome. Am I making any sense here? Would such work be completely
> useless? 

On the issue of parallelism, jom builds in parallel using NMake makefiles.

Apart from that, discussion of a new generator you want to write/contribute 
belongs on the cmake-developer mailing list.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

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

2014-12-30 Thread Stephen Kelly
Fraser Hutchison wrote:

> Alternatively, you can tell CMake to allow the use of the LOCATION target
> property by setting the relevant policy to use the old behaviour
> temporarily

Please don't do that. 

Please don't encourage others to do it either.

Policies are not feature toggles.

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd4fa896

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake Tools for Visual Studio 1.3 RC1 Available

2014-12-30 Thread Stephen Kelly
David Golub wrote:

> I've made available the first release candidate of CMake Tools for Visual
> Studio 1.3, which adds support for CMake 3.1 and IntelliSense for
> generator
> expressions.  As usual, it's available from the project web site at
> http://cmaketools.codeplex.com.  Enjoy!

Are you aware of this thread?

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10711

And does it present possibilities of interesting features to you?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] unexpected behavior with TARGET_FILE_DIR and Visual Studio 2010

2014-12-06 Thread Stephen Kelly
Michael Ellery wrote:

> Can anyone offer advice? Is this how the visual studio generator works or
> is this possibly a bug in CMake?

I'm not very familiar with that generator. It looks like a bug to me too 
though. 

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


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

2014-12-03 Thread Stephen Kelly
Domen Vrankar wrote:

> I've started solving this a while ago with treating every library as
> an external dependency even if it is part of the same repository as
> the code for the executable.
> For every new library that I write I also write a FindSomeLib.cmake

Much of what you describe should not be necessary in a modern CMake system.

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html
 
http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#alias-targets
 http://www.cmake.org/cmake/help/v3.0/command/export.html#command:export

Thanks,

Steve.



-- 

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://public.kitware.com/mailman/listinfo/cmake


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

2014-12-03 Thread Stephen Kelly
Angeliki Chrysochou wrote:

> 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.
> 

See his second email.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


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

2014-12-03 Thread Stephen Kelly
Chris Johnson wrote:

> 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.

I'm curious: What hidden intelligence did you expect?

> However, I don't really want to have to go around to all my executables
> and add a bunch of relative paths based on which libraries they use, and
> where they are located in the tree.

Use PUBLIC or INTERFACE target_include_directories for that.

And please really go ahead and read 

 http://www.cmake.org/cmake/help/v3.1/manual/cmake-buildsystem.7.html

> 
> Is there some way that I can instead do something like force the install
> of the libraries to happen before the build of the programs which depend
> upon them?

Instead, use target_include_directories, as your initial example did to use 
different directories for the build and install locations.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


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

2014-12-03 Thread Stephen Kelly
Chris Johnson wrote:

> That
> seems to imply the top-level source is not part of the default include
> path, correct?

Correct. CMake doesn't add anything by default. The only defaults are those 
provided by the compiler.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Creating a library from subdirectories

2014-11-26 Thread Stephen Kelly
Chris Johnson wrote:

> * I do not want to use the add_library(component1 OBJECT
> ${component1_sources}) and add_library(toplevel
> $ ... ) syntax if it can be avoided.

Is the constraint that you want a top-level something like 

  # All components:
  set(components component1 component2)

  foreach(comp ${components})
add_subdirectory(${comp})
  endforeach()

  add_library(mylib dummy.c)
  target_link_libraries(mylib ${components})

  add_executable(other_target main.c)
  target_link_libraries(other_target mylib)

?

While at the same time not caring what type the components libraries are 
(OBJECT/STATIC etc)?

A solution for that is in CMake 3.1 by creating an INTERFACE library to hide 
the TARGET_OBJECTS expression:

 add_library(component1_objs OBJECT c1.c)

 add_library(component1 INTERFACE)
 target_sources(component1 INTERFACE
   $
 )

There is a bug however, but I just pushed a fix for it after trying to 
extend your test case to use it:

 http://www.cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=672f1001

An INTERFACE library also helps you avoid the dummy.c by not creating the 
intermediate archive at all, if that fits within what you're trying to 
achieve here:

  add_library(mylib INTERFACE)
  target_link_libraries(mylib INTERFACE ${components})

In the future it may be possible to link to OBJECT libraries directly 
without the INTERFACE library:

 http://public.kitware.com/Bug/view.php?id=14970

Another obvious solution, if it fits within what you're trying to achieve, 
is to avoid the OBJECT libraries instead:

 add_library(component1 INTERFACE)
 target_sources(component1 INTERFACE
   ${CMAKE_CURRENT_SOURCE_DIR}/c1.c
 )

This means that all binary consumers will compile their own version of each 
file, which you probably want to avoid.

Additionally, you do need to specify an absolute path or CMake issues a not-
informative-enough error. A second bug found from this thread, but which I 
haven't yet addressed (but should get done for 3.1 too).

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] BUILD_INTERFACE genex used even in install(EXPORT...

2014-11-25 Thread Stephen Kelly
Mueller-Roemer, Johannes Sebastian wrote:

> For clarification:
> 
> As an imported target can't have debug and optimized keywords, I can't
> simply use $
> $ But have to do
> $ $<$:
> ...

Yes, but for the user of the target, it's just

 target_link_libraries(mytgt Boost::Coroutine)

This is academic though anyway until someone decides to submit and maintain 
IMPORTED targets for Boost, or until Boost decides to make them available 
itself. So, for now, you are correct, it's verbose.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] BUILD_INTERFACE genex used even in install(EXPORT...

2014-11-25 Thread Stephen Kelly
Mueller-Roemer, Johannes Sebastian wrote:

> It appears that wasn't really the issue, but rather that I had my CMake
> minimum version set to 2.8.11 and not 2.8.12. 

See the reply from Nils and the documentation link I posted previously.

> Is there a cleaner solution
> for the "debug" and "optimized" keyword issue than using individual
> library variables?

I don't fully understand the question. Imported targets for Boost would be 
cleaner, but there's no one submitting and maintaining such a thing. There 
was a discussion that could be picked up though.

 
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10332/focus=10370

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Using CMAKE_CXX_KNOWN_FEATURES

2014-11-25 Thread Stephen Kelly
Andrew Maclean wrote:

> Is this a reasonable approach to using cx_11 features on multiple
> platforms? The issue is that I think you need to manually select the MSVC
> compiler version that supports these features target_compile_features only
> works for gcc.

Correct, I'm no confident I can maintain the known MSVC features as new MSVC 
releases appear and as CMake gains knowledge of new features in the future.

If you can do that, then 

 
https://gitorious.org/cmake/steveires-cmake/source/0156b7f4f169fe91971a072460db0f781ade2119:Modules/Compiler/MSVC-CXX-FeatureTests.cmake

is a starting point listing features of some existing releases. It should 
maybe be updated with information from 

 
http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx

Please post to the cmake-developers mailing list if you wish to maintain 
that file, and we can get it into a future release.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] BUILD_INTERFACE genex used even in install(EXPORT...

2014-11-25 Thread Stephen Kelly
Mueller-Roemer, Johannes Sebastian wrote:

> produces a file containing:
> IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
> "${Boost_COROUTINE_LIBRARY_RELEASE}"

You need to make sure policy CMP0022 is NEW for the 
BUILD_INTERFACE to be handled correctly. Unfortunately 
there is no warning in this case.

See 

 http://www.cmake.org/cmake/help/v3.1/manual/cmake-policies.7.html

for more.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] empty CMAKE_CXX_KNOWN_FEATURES in cmake 3.1.0-rc2

2014-11-20 Thread Stephen Kelly
Erik Sjölund wrote:

> CMAKE_CXX_KNOWN_FEATURES seems to be empty in
> cmake 3.1.0-rc2
> 
> Should it be?

Yes, it's not a variable, but a global property:

 get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
 message("known: ${cxx_features}")

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] CMake can't find Boost versions > 1.55

2014-11-19 Thread Stephen Kelly
Robert Ramey wrote:

> The module FindBoost is quite elaborate.  Unfortunately it seems to depend
> upon searching for specific version numbers found in a list.  This list
> only
> goes up to 1.55 so it can't find later versions of Boost.  Better would be
> to eliminate the list so module doesn't "expire"

It would be awesome if you could teach bjam to generate cmake config 
packages:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

Qt uses qmake to generate those, and LLVM generates them with a non-CMake 
buildsystem too.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Generic XML output file of project heirarchy

2014-11-18 Thread Stephen Kelly
Michael Jackson wrote:

> Yep, that is pretty much the discussion that I was wanting. Now, has there
> been any movement on any of the implementations?

Nothing is reported beyond that thread.

If you want to pick up the implementation or a creator patch, I'd say go 
ahead.

Thanks,

Steve.
 


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Generic XML output file of project heirarchy

2014-11-18 Thread Stephen Kelly
Michael Jackson wrote:

> Has there ever been any interest in CMake producing a generic "XML" (or
> some other file format) file that lays out the project structure?

See

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10711

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] library dependcies and add_library(OBJECT)

2014-11-17 Thread Stephen Kelly
avo...@mail.ru wrote:

> What should I add
> to B/CMakeLists.txt to successfully build my executable?

You might be able to add an INTERFACE library and populate its 
INTERFACE_SOURCES using the target_sources command:

 http://www.cmake.org/cmake/help/v3.1/command/target_sources.html
 
 
http://www.cmake.org/cmake/help/v3.1/manual/cmake-buildsystem.7.html#interface-libraries

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] can I make an AUTOMOC generated file depend on something ?

2014-11-17 Thread Stephen Kelly
Martin Koller wrote:

> What rules can I add so that the tar extraction is done BEFORE the moc
> generation ?

You can add depends in the AUTOGEN_TARGET_DEPENDS target property of 
particular targets. 

 http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html

Please try that out. It will require you to set it on each target. If that's 
too suboptimal, we can think about adding an additional convenience 
interface.

Thanks,

Steve.




-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Is there really no way in CMake to retrieve the objects file for a target?

2014-10-28 Thread Stephen Kelly
Emmanuel Blot wrote:

> This seems so convoluted that I guess I'm missing the proper way to
> properly add an intermediate step between the compilation and link
> stages, but I keep failing to find any useful advice from Google and
> the mailing list.

It's probably not possible cleanly.

Generator expressions can give you the list of object files in the makefile 
generators, but limitations in how the IDE generators work make it hard to 
implement.

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5de63265
 
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9705/focus=9722

I added a bug report to track this missing feature:

 http://public.kitware.com/Bug/view.php?id=15226

However, this is all just for information. I don't know that you'd be able 
to manipulate the files between compilation and linking without messing up 
the dependency logic.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMP0020 warning

2014-10-28 Thread Stephen Kelly
Scott Aron Bloom wrote:

> The warning message for CMP0020 seems to be completely random as to where
> you actually have to set the policy.
> 
> Im not getting the warning on my main executables, but cant seem to get
> rid of it on any of my Qt based unittests (using gmock/gtest )
> 
> I have the following line, in various places in the system,
> cmake_policy(SET CMP0020 NEW)
> 
> but is there any documentation on where it MUST be set???

Anywhere should do. Note that policies are cleared by the 
cmake_minimum_required command. If you use that multiple times, you probably 
shouldn't.

If the problem persists, feel free to provide an example.

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Is this the proper way to define a package config?

2014-10-26 Thread Stephen Kelly
Robert Dailey wrote:

> I've skimmed over it, but I haven't seen anything useful in that
> section. Maybe you can point out what exactly I'm supposed to use from
> that?
> 
> Someone has already stated that I should use a find module and not
> define a package config since I'm not the maintainer of boost, I only
> need to use it. Are you suggesting the opposite, that I should define
> a package config as a downstream consumer?
> 

Sorry, I guess that link was not so relevant.

This has relevant information:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-developer.7.html#modules

You might be interested in picking up the effort here:

 
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10332/focus=10337

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Is this the proper way to define a package config?

2014-10-24 Thread Stephen Kelly
Robert Dailey wrote:

> What is the "Filters" target here? How is it created? Would I just
> create a target called Boost and configure it as needed?

You've read  

 
http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html#creating-packages

right?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Qt5 + cmake 3.0

2014-10-24 Thread Stephen Kelly
Scott Aron Bloom wrote:

> I have minimized the project to a simple testcase that will represent the
> problem, and it still exists.

You didn't attach it, right?

> In this file, I previously called include( ${QT_USE_FILE} ) to make sure
> the necessary include paths were setup correctly However, for Qt5, this
> has been replaced with modifying the target_link_libraries to include
> Qt5::Widgets (or the other necessary components)

Everything that works with Qt 5 works with Qt 4. You could use more 
intermediate steps to understand whatever problem it is you're hitting.
 
> And the qt5_use_modules( MyLibrary Core )

According to the Qt 5 documentation, you shouldn't use this after CMake 
2.8.11.

> 
> The problem, is then I would need to call this, inside every libraries
> CMake file, since its required to know the "current project"
> 
> Is there anyway around this issue? Where I could just add the necessary Qt
> 5 modules to current project?

I don't understand the problem. Do you just need to add a find_package?

Thanks,

Steve.


-- 

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://public.kitware.com/mailman/listinfo/cmake


  1   2   3   >