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

2016-07-10 Thread Robert Dailey
On Sun, Jul 10, 2016 at 5:11 PM, Stephen Kelly <steve...@gmail.com> wrote:
> 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, I realized this a bit too late. The title of the section was a
little misleading, I thought that section would go over the normal
find module scenario, not the config package one. In other words, the
section above it already gave instructions on creating the config
package file.
-- 

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


[CMake] Why is target installation done in 2 separate steps?

2016-07-10 Thread Robert Dailey
Documentation states, that to export a file that imports your targets,
you must do roughly:

install(TARGETS fubar EXPORT fubar-targets)
install(EXPORT fubar-targets DESTINATION lib/cmake/fubar)

Why is this done in two steps? Based on reading the install()
documentation, I don't see how the install(TARGETS) command is useful
without the corresponding install(EXPORT).

Can someone explain why these are separate commands instead of 1
complete command? Thanks in advance.
-- 

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


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

2016-07-10 Thread Robert Dailey
Let's say I have my own upstream library and I export a target for it.
This subsequent cmake file (containing my IMPORT target definition) is
included with my tarball.

When a consuming project wants to find and use my import targets, they
currently have to do (consider this pseudocode since i just typed it
up for example purposes):

find_package(mylibrary REQUIRED CONFIG)
include(${mylibrary_DIR}/lib/cmake/mylibrary-0.1.2/mylibrary.cmake)
add_executable(fubar mylibrary)

It would be nice if the include part happened automatically. Mostly
because since the version number is intertwined with the path, it
makes explicitly specifying it cumbersome and high maintenance.

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

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


[CMake] Convenience version of CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE for INTERFACE_SOURCES

2016-07-10 Thread Robert Dailey
I am exporting/installing a header-only INTERFACE library and I run
into difficulty with target_sources() because I can't use relative
paths to the files. So I do this:



set(project_name fubar)

set(source_files
myfile.h
)

# Include dir for installed targets
set(INCLUDE_DIR include/${project_name}-${upstream_version})

foreach(source_file ${source_files})
get_filename_component(abs_source_file ${source_file} ABSOLUTE)
list(APPEND absolute_source_files
$
$
)
endforeach()

add_library(${project_name} INTERFACE)
target_sources(${project_name} INTERFACE ${absolute_source_files})



Without the separate generator expressions for BUILD_INTERFACE and
INSTALL_INTERFACE, CMake complains that absolute paths are not inside
INSTALL_PREFIX in my install() command later:



CMake Error in CMakeLists.txt:
Target "better-enums" INTERFACE_SOURCES property contains path:

"C:/code/fubar/myfile.h"

which is prefixed in the source directory.



Corresponding install() command is:


install(TARGETS ${project_name} EXPORT ${project_name}-targets
INCLUDES DESTINATION ${INCLUDE_DIR}
)

export(EXPORT ${project_name}-targets
FILE ${CMAKE_CURRENT_BINARY_DIR}/${project_name}-targets.cmake
)

install(EXPORT ${project_name}-targets
FILE ${project_name}-targets.cmake
DESTINATION ${package_config_dir}
)

For INTERFACE_INCLUDE_DIRECTORIES, this same problem exists except
CMake provides a convenience toggle called
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES. Is there a similar convenience
for interface sources? Or maybe I'm going about this all the wrong
way?

Honestly the only reason interface sources are specified is because I
have a header-only library and I want that header to show up in only
MY targets during development so I can edit those header files through
my IDE. I do not expect the header files to appear in targets that
simply import my target as a dependency.

So it's possible I'm going about this the wrong way. Advice is greatly
appreciated.
-- 

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] Unable to find source files in different directory using target_sources(INTERFACE)

2016-07-09 Thread Robert Dailey
Thanks, I just verified that doing absolute path works. I find it
frustrating though that relative paths aren't calculated to absolute
at the time the function is called, though. I feel like CMake should
be doing this for me.

On Sat, Jul 9, 2016 at 7:23 PM, Craig Scott <craig.sc...@crascit.com> wrote:
> Sorry, hit the send button prematurely. To achieve your desired goal of
> creating a header only library as a target in Visual Studio, it somewhat
> depends on what you want to do with that library. If you just want it to be
> there so you can see the header in the IDE, then simply defining a dummy
> custom target is one approach I've seen people use. E.g.
>
>   add_custom_target(foo SOURCES foo.h)
>
> If you want to actually link to the target so it can provide header search
> path dependencies, then the approach you tried is probably the closest (with
> the use of absolute paths as described in my previous email). As you
> discovered though, it adds the header to the sources list of each project
> linking against it, which it sounds like you want to avoid. An interface
> library doesn't create build output on its own, so it doesn't make sense for
> it to have its own list of sources. The only way sources make sense for it
> is for those sources to be added to anything linking against it, which is
> the behaviour you are seeing.
>
>
>
>
>
> On Sun, Jul 10, 2016 at 10:04 AM, Craig Scott <craig.sc...@crascit.com>
> wrote:
>>
>> When using target_sources(), if you specify the source file(s) with a
>> relative path, CMake does not convert that to an absolute path when storing
>> it in the target's SOURCES property (that's my interpretation anyway). The
>> end result is that the source you specify is going to be interpreted as
>> being relative to the source directory the dependent target is defined in,
>> not the directory where you called target_sources().  You can prevent the
>> problem you described by ensuring the path for the source file(s) is always
>> an absolute one. For example:
>>
>> target_sources(foo INTERFACE "${CMAKE_CURRENT_LIST_DIR}/foo.h")
>>
>> You may find the following blog article useful (it discusses the above
>> problem and also other related material):
>>
>>
>> https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/
>>
>>
>>
>>
>> On Sun, Jul 10, 2016 at 9:03 AM, Robert Dailey <rcdailey.li...@gmail.com>
>> wrote:
>>>
>>> I have the following:
>>>
>>> cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
>>> project(foo)
>>> add_library(foo INTERFACE)
>>> target_sources(foo INTERFACE foo.h)
>>> add_subdirectory(subdir)
>>>
>>> And inside subdir, I specify add_executable() and then
>>> target_link_libraries(myexe foo).
>>>
>>> I get an error:
>>>
>>> Cannot find source file: foo.h
>>>
>>> I'm using CMake 3.6. What am I doing wrong here?
>>>
>>> My goal is to generate a header-only project in Visual Studio.
>>> According to the documentation, what I'm trying to do won't give me
>>> that. Instead, foo.h would exist in every project that links to it as
>>> a dependency (that's what it seems like anyhow).
>>>
>>> Advice is appreciated.
>>> --
>>>
>>> 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
>>
>>
>>
>>
>> --
>> Craig Scott
>> Melbourne, Australia
>> http://crascit.com
>
>
>
>
> --
> Craig Scott
> Melbourne, Australia
> http://crascit.com
-- 

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


[CMake] Unable to find source files in different directory using target_sources(INTERFACE)

2016-07-09 Thread Robert Dailey
I have the following:

cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(foo)
add_library(foo INTERFACE)
target_sources(foo INTERFACE foo.h)
add_subdirectory(subdir)

And inside subdir, I specify add_executable() and then
target_link_libraries(myexe foo).

I get an error:

Cannot find source file: foo.h

I'm using CMake 3.6. What am I doing wrong here?

My goal is to generate a header-only project in Visual Studio.
According to the documentation, what I'm trying to do won't give me
that. Instead, foo.h would exist in every project that links to it as
a dependency (that's what it seems like anyhow).

Advice is appreciated.
-- 

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


[CMake] Ninja + parallel linking

2016-07-07 Thread Robert Dailey
I notice on ninja builds generated via CMake 3.6, the link step blocks
compilation threads. What I expect is that if I have 32 threads
available for compiling, those are also shared via the link step. In
other words, if I reach a link step, I want it to consume 1 thread and
the other 31 threads start compiling translation units for the next
library.

Is there a reason it isn't behaving as I describe? Is there a setting
or CMake option I can set to enable this?
-- 

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


[cmake-developers] Changing FOLDER property of ALL_BUILD and RUN_TESTS targets in VS

2016-04-12 Thread Robert Dailey
I have the following CMake code:

get_property( predefined_folder GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER )

set_target_properties( ALL_BUILD PROPERTIES FOLDER ${predefined_folder} )

if( BUILD_TESTING )
set_target_properties( RUN_TESTS PROPERTIES FOLDER "Testing" )
endif()

However this fails stating those targets do not exist. Is there a way
I can make this work? I'd like to organize these CMake targets in my
own way in the Visual Studio solution. There have been topics
regarding this on the mailing list in the past, but they have gone
unanswered.

Specifically, why are these targets treated as if they do not exist?
Does CMake only allow you to set properties on targets created
directly by the scripts themselves (i.e. no built-in targets can be
affected)?

I'm happy to contribute a patch to this if needed.

Thanks in advance.
-- 

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


[CMake] Changing FOLDER property of ALL_BUILD and RUN_TESTS targets in VS

2016-04-12 Thread Robert Dailey
I have the following CMake code:

get_property( predefined_folder GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER )

set_target_properties( ALL_BUILD PROPERTIES FOLDER ${predefined_folder} )

if( BUILD_TESTING )
set_target_properties( RUN_TESTS PROPERTIES FOLDER "Testing" )
endif()

However this fails stating those targets do not exist. Is there a way
I can make this work? I'd like to organize these CMake targets in my
own way in the Visual Studio solution. There have been topics
regarding this on the mailing list in the past, but they have gone
unanswered.

Specifically, why are these targets treated as if they do not exist?
Does CMake only allow you to set properties on targets created
directly by the scripts themselves (i.e. no built-in targets can be
affected)?

I'm happy to contribute a patch to this if needed.

Thanks in advance.
-- 

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] Visual Studio + Ninja?

2016-03-25 Thread Robert Dailey
Thanks for the feedback. I know for sure that you can create
"Makefile" projects in Visual Studio, that do nothing but run
commands. You can even still have files in the project itself, to
allow you to edit those files (even though they won't actually build).

I think CMake can use this functionality already, it just isn't setup
to treat Visual Studio as an extra generator like most other IDEs.

On Mon, Mar 7, 2016 at 3:18 AM, Nagy-Egri Máté Ferenc
<csiga.b...@aol.com> wrote:
> Short version: no.
>
>
>
> Long version: Visual Studio is heavily built around MSBuild as the back-end
> of execution of various tasks. While theoretically it could be done that
> MSBuild only acts as a relay and calls into Ninja scripts, you would lose
> the entire feature set of Solution Explorer, which is quite a large portion
> of the IDE. (Using CMake does preclude using most of it though.) MS is
> looking into deeper CMake integration into their IDE, but the exec back-end
> will most likely be MSBuild.
>
>
>
> Should you really want to achieve this, you would need support from both
> CMake side and VS side. You would need to develop an Add-In with a custom
> project type (CMake+Ninja) and hook up most Solution Explorer entries to
> generate not MSBuild but Ninja script portions. And from CMake you would
> need a generator for this mixed generator type. It could be done, but it’s a
> lot of effort. Given the performance of MSBuild (which is not that bad
> compared to Ninja), the benefits would only be substantial in enourmous
> projects. MS generally looks into increasing build throughput by integrating
> IncrediBuild into their IDE.
>
>
>
>
>
>
>
> Feladó: Robert Dailey
> Elküldve: 2016. március 2., szerda 21:45
> Címzett: CMake
> Tárgy: [CMake] Visual Studio + Ninja?
>
>
>
> Right now I am using a toolchain file to setup cmake to build my C++
>
> code against Android NDK. I also have several custom targets for
>
> running 'ant' commands for the java portions.
>
>
>
> I can use the Ninja generator to generate the build scripts to make my
>
> builds work fine. However, I'd love to be able to use Visual Studio on
>
> Windows as my IDE. However, there is no "Visual Studio - Ninja"
>
> generator that I can see. Is there a way to make Visual Studio wrap
>
> the Ninja scripts and simply execute them? that way I can use it to
>
> edit code and invoke builds.
>
>
>
> Thanks in advance.
>
> --
>
>
>
> 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
>
>
-- 

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

[CMake] Visual Studio + Ninja?

2016-03-02 Thread Robert Dailey
Right now I am using a toolchain file to setup cmake to build my C++
code against Android NDK. I also have several custom targets for
running 'ant' commands for the java portions.

I can use the Ninja generator to generate the build scripts to make my
builds work fine. However, I'd love to be able to use Visual Studio on
Windows as my IDE. However, there is no "Visual Studio - Ninja"
generator that I can see. Is there a way to make Visual Studio wrap
the Ninja scripts and simply execute them? that way I can use it to
edit code and invoke builds.

Thanks in advance.
-- 

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-developers] Assertion hit in CMake for KDevelop on Ubuntu

2016-01-14 Thread Robert Dailey
On Wed, Jan 13, 2016 at 3:16 PM, Alexander Neundorf <neund...@kde.org> wrote:
> On Wednesday, January 13, 2016 10:16:23 Robert Dailey wrote:
>> Running version 3.2.2 on Ubuntu 15. I run the following command:
>>
>> $ cmake .. -G"KDevelop3" -DCMAKE_C_COMPILER=gcc-4.9
>> -DCMAKE_CXX_COMPILER=g++-4.9 -DCMAKE_BUILD_TYPE=$config
>> -DCMAKE_TOOLCHAIN_FILE="../toolchains/linux_i686.toolchain.cmake"
>
> are you sure you actually want to use the KDevelop3 generator ?
> This is for the KDE3 version, and you are probably using the KDE4 version of
> KDevelop ? For that you don't need these generated project files.
>
> Actually I was thinking about removing this generator, because KDevelop3 is
> really really old, not sure whether it is still available in current Linux
> distributions.

This might explain it. I just installed kdevelop on Ubuntu 15, not
sure what version it is using. I also have never used kdevelop before
so I was not aware that it had built in support for CMake. I saw it in
the list of generators so I naturally assumed I had to use it. Note
that Eclipse is in kind of the same boat, as far as which versions it
supports and its not immediately obvious.
-- 

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


Re: [cmake-developers] Assertion hit in CMake for KDevelop on Ubuntu

2016-01-13 Thread Robert Dailey
On Wed, Jan 13, 2016 at 12:36 PM, Brad King <brad.k...@kitware.com> wrote:
> On 01/13/2016 11:16 AM, Robert Dailey wrote:
>> Running version 3.2.2 on Ubuntu 15. I run the following command:
> [snip]
>> cmake: ../../Source/cmTarget.cxx:722: void
>> cmTarget::GetSourceFiles(std::vector<std::__cxx11::basic_string
>>> &, const string&) const: Assertion `this->GetType() !=
>> INTERFACE_LIBRARY' failed.
>> ../frontend/Core/CMake/helper-scripts/kdevelop-linux.sh: line 13:
>> 21545 Aborted (core dumped) cmake "$DIR/../../.."
>
> Please try running with CMake 3.4 or 'master' to see if it still
> happens.  There has been substantial refactoring of this code
> since 3.2.
>
> Thanks,
> -Brad
>

3.4 isn't available to me on Ubuntu 15; do you have a custom PPA I can
add to grab the latest CMake debian package?
-- 

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


[cmake-developers] Assertion hit in CMake for KDevelop on Ubuntu

2016-01-13 Thread Robert Dailey
Running version 3.2.2 on Ubuntu 15. I run the following command:

$ cmake .. -G"KDevelop3" -DCMAKE_C_COMPILER=gcc-4.9
-DCMAKE_CXX_COMPILER=g++-4.9 -DCMAKE_BUILD_TYPE=$config
-DCMAKE_TOOLCHAIN_FILE="../toolchains/linux_i686.toolchain.cmake"



My toolchain file is specified as follows:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR "i686")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")



I get the following output when I generate for KDevelop. Why is CMake
not properly generating my projects? Based on what the assertion says,
I do actually define some interface libraries, mostly to create
"dummy" targets for my third party libraries. If I have a library with
only headers and no binaries or libs, I will make them as interface
libraries. I will post a sample of this below the output below.

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/bin/gcc-4.9
-- Check for working C compiler: /usr/bin/gcc-4.9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-4.9
-- Check for working CXX compiler: /usr/bin/g++-4.9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Generating copy_dlls for configurations: Debug
-- + UI> Core/UI/CMakeLists.txt
-- + WebServices   > Core/WebServices/CMakeLists.txt
-- + Barcode   > Core/Barcode/CMakeLists.txt
-- + TestUtils > Core/UI/TestUtils/CMakeLists.txt
-- + DynamicUI > Applications/DynamicUI/CMakeLists.txt
-- + OrderEntry> Applications/OrderEntry/CMakeLists.txt
-- + PATT  > Applications/PATT/CMakeLists.txt
-- + EmailClub > Applications/EmailClub/CMakeLists.txt
-- + Survey> Applications/Survey/CMakeLists.txt
-- + SettingsManager   > Applications/SettingsManager/CMakeLists.txt
-- + zFacebook > Applications/zFacebook/CMakeLists.txt
-- + Loyalty   > Applications/Loyalty/CMakeLists.txt
-- + MessagingModule   > Applications/MessagingModule/CMakeLists.txt
-- + zApp  > Applications/zApp/CMakeLists.txt
-- + zApp_Library  > Applications/zApp/CMakeLists.txt
-- Configuring done
cmake: ../../Source/cmTarget.cxx:722: void
cmTarget::GetSourceFiles(std::vector&, const string&) const: Assertion `this->GetType() !=
INTERFACE_LIBRARY' failed.
../frontend/Core/CMake/helper-scripts/kdevelop-linux.sh: line 13:
21545 Aborted (core dumped) cmake "$DIR/../../.."
-G"KDevelop3" -DCMAKE_C_COMPILER=gcc-4.9 -DCMAKE_CXX_COMPILER=g++-4.9
-DCMAKE_BUILD_TYPE=$config
-DCMAKE_TOOLCHAIN_FILE="$DIR/../toolchains/linux_i686.toolchain.cmake"



Sample of how I define interface libraries (contents of one of my
CMakeLists.txt):

set( project_name Catch )
add_library( ${project_name} INTERFACE )
target_include_directories( ${project_name} INTERFACE include )
-- 

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


[CMake] CMake with VS 2015 using Android?

2015-12-21 Thread Robert Dailey
Is it possible for CMake 3.4 to generate VS2015 projects targeting
their new Android functionality? Is this just a matter of configuring
the toolset (-T)? Or is there more to it?
-- 

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


[CMake] Toolset target property?

2015-12-09 Thread Robert Dailey
Doesn't look like there is a Toolset target property anywhere. You can
set it from the command line, but I think setting a toolset per target
makes sense. Considering the direction that Visual Studio 2015 is
headed. For example Microsoft has a Clang compiler with MS CodeGen.
They recommend using this toolset with the platform agnostic targets,
and using normal MSVC with windows-specific targets (for example, CLR
projects).

This requires setting a toolset per target. Does this feature make
sense from the CMake perspective?
-- 

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] Copying directories as post build events without losing parent directory

2015-12-07 Thread Robert Dailey
On Mon, Dec 7, 2015 at 3:59 PM, David Cole <dlrd...@aol.com> wrote:
> $ cmake -E copy_directory foo bar/foo
>
> ?
>
>
> On Mon, Dec 7, 2015 at 4:53 PM, Robert Dailey <rcdailey.li...@gmail.com> 
> wrote:
>> I have a custom target which runs a command similar to this:
>>
>> $ cmake -E copy_directory foo bar
>>
>> The problem is that the contents of "foo" are copied inside of "bar",
>> instead of it creating a directory "bar/foo" and putting the contents
>> in there.
>>
>> Is there a way to make copy_directory behave like this? If not, I
>> guess my only option is to create a little CMake script that runs
>> file(INSTALL) to copy the directories like I want.
>> --
>>
>> 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

That's the obvious answer but due to complexity reasons I don't want
to repeat the destination directory name. I want the copy to be
inclusive of the source directory name. I'd have to use
get_filename_component() to find the leaf directory name in the list
of directories I provide to my function for copying, simply to repeat
that name in the destination path I build. I want to avoid this.
Another weirdness is that I like to pass in a list with a mixture of
directories and files. Think of this is a way for me to pass in a list
of game data resources that need to be copied to the EXE directory so
the game can find them and run. I also have to add weird
if(IS_DIRECTORY) checks so I can tell my custom command to use "copy"
or "copy_directory".

A simple little install.cmake script that I run is able to do this,
but as far as complexity goes, it doesn't save me a whole lot:

function( copy_data )
if( NOT TARGET copy_data )
add_custom_target( copy_data COMMENT "Copying data directories
and files..." )
endif()

set( data_directories ${ARGN} )

foreach( data ${data_directories} )
get_filename_component( data ${data} ABSOLUTE )
set( output_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$" )
set( install_script "${BUILD_CMAKE_DIR}/scripts/install.cmake" )

add_custom_command( TARGET copy_data POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS "-DSOURCE=${data}" "-DOUTPUT_DIR=${output_dir}" -P
"${install_script}"
)
endforeach()
endfunction()
-- 

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] Copying directories as post build events without losing parent directory

2015-12-07 Thread Robert Dailey
On Mon, Dec 7, 2015 at 4:15 PM, Robert Dailey <rcdailey.li...@gmail.com> wrote:
> On Mon, Dec 7, 2015 at 3:59 PM, David Cole <dlrd...@aol.com> wrote:
>> $ cmake -E copy_directory foo bar/foo
>>
>> ?
>>
>>
>> On Mon, Dec 7, 2015 at 4:53 PM, Robert Dailey <rcdailey.li...@gmail.com> 
>> wrote:
>>> I have a custom target which runs a command similar to this:
>>>
>>> $ cmake -E copy_directory foo bar
>>>
>>> The problem is that the contents of "foo" are copied inside of "bar",
>>> instead of it creating a directory "bar/foo" and putting the contents
>>> in there.
>>>
>>> Is there a way to make copy_directory behave like this? If not, I
>>> guess my only option is to create a little CMake script that runs
>>> file(INSTALL) to copy the directories like I want.
>>> --
>>>
>>> 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
>
> That's the obvious answer but due to complexity reasons I don't want
> to repeat the destination directory name. I want the copy to be
> inclusive of the source directory name. I'd have to use
> get_filename_component() to find the leaf directory name in the list
> of directories I provide to my function for copying, simply to repeat
> that name in the destination path I build. I want to avoid this.
> Another weirdness is that I like to pass in a list with a mixture of
> directories and files. Think of this is a way for me to pass in a list
> of game data resources that need to be copied to the EXE directory so
> the game can find them and run. I also have to add weird
> if(IS_DIRECTORY) checks so I can tell my custom command to use "copy"
> or "copy_directory".
>
> A simple little install.cmake script that I run is able to do this,
> but as far as complexity goes, it doesn't save me a whole lot:
>
> function( copy_data )
> if( NOT TARGET copy_data )
> add_custom_target( copy_data COMMENT "Copying data directories
> and files..." )
> endif()
>
> set( data_directories ${ARGN} )
>
> foreach( data ${data_directories} )
> get_filename_component( data ${data} ABSOLUTE )
> set( output_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$" )
> set( install_script "${BUILD_CMAKE_DIR}/scripts/install.cmake" )
>
> add_custom_command( TARGET copy_data POST_BUILD
> COMMAND ${CMAKE_COMMAND}
> ARGS "-DSOURCE=${data}" "-DOUTPUT_DIR=${output_dir}" -P
> "${install_script}"
> )
> endforeach()
> endfunction()

Oh and the contents of install.cmake:

file( INSTALL ${SOURCE} DESTINATION ${OUTPUT_DIR} )
-- 

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


[CMake] List of debug configurations for multi-generators?

2015-12-03 Thread Robert Dailey
For any arbitrary configuration in a multi-generator, I need to
determine if it's configuration is optimized or not (release or
debug). At the moment I thought I could do this by comparing against
the list of DEBUG_CONFIGURATIONS, however this property is empty if I
have not set it. I was expecting CMake to fill this in at least with
"Debug" for the pre-provided configurations.

Is there no way to get this information? The only other way to do this
is to compare if the current configuration is "Debug", and if not,
treat it as release. But this will not work if I add my own custom
configurations.

I need to do this because for third party libraries, I only build
"Debug" and "Release" versions. "RelMinSize" and "RelWithDebInfo" both
use "release" libraries. I use this logic to help build relative paths
to point to the proper libs.
-- 

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 generate for Ninja + MSVC?

2015-12-02 Thread Robert Dailey
On Wed, Dec 2, 2015 at 1:29 PM, Nils Gladitz <nilsglad...@gmail.com> wrote:
> On 02.12.2015 20:18, Robert Dailey wrote:
>>
>> Is there a way to generate for Ninja using MSVC toolchain? If so, how
>> do I do that? Do I need a toolchain file?
>
>
> You can select the Ninja generator (e.g. cmake -G Ninja) while running cmake
> from the desired Visual Studio command line environment.

This doesn't work unfortunately; it still finds GNU 4.8.3 compiler somehow.
-- 

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


[CMake] How to generate for Ninja + MSVC?

2015-12-02 Thread Robert Dailey
Is there a way to generate for Ninja using MSVC toolchain? If so, how
do I do that? Do I need a toolchain file?
-- 

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 generate for Ninja + MSVC?

2015-12-02 Thread Robert Dailey
On Wed, Dec 2, 2015 at 1:37 PM, Robert Dailey <rcdailey.li...@gmail.com> wrote:
> On Wed, Dec 2, 2015 at 1:29 PM, Nils Gladitz <nilsglad...@gmail.com> wrote:
>> On 02.12.2015 20:18, Robert Dailey wrote:
>>>
>>> Is there a way to generate for Ninja using MSVC toolchain? If so, how
>>> do I do that? Do I need a toolchain file?
>>
>>
>> You can select the Ninja generator (e.g. cmake -G Ninja) while running cmake
>> from the desired Visual Studio command line environment.
>
> This doesn't work unfortunately; it still finds GNU 4.8.3 compiler somehow.

For some reason Strawberry Perl installed gcc/g++ to my PATH. I
removed this and it's finding MSVC 19 now. Thanks.
-- 

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-developers] Code style auto-formatting

2015-11-19 Thread Robert Dailey
On Wed, Nov 18, 2015 at 5:47 PM, Alan W. Irwin
<ir...@beluga.phys.uvic.ca> wrote:
> On 2015-11-17 16:44-0600 Robert Dailey wrote:
>
>> [...]Honestly all of this is a matter of taste, I don't expect
>> everyone to agree on every little detail. I think the goal should be
>> to strive for something a little more modern (determined by general
>> consensus in the open source community) and most importantly enforce
>> it. No matter what style you choose, consistency is what matters the
>> most.
>
>
> Well said.  We used similar principles in the PLplot case and the
> resulting code style consistency (implemented with uncrustify in that
> case) within that project has been quite beneficial.

Tonight I will do some testing and submit a patch + example files
converted to the style Brad suggested. We can fine-tune it as needed.
I'll probably format cmake.h / cmake.cxx as an example.

Note also that there is an extension for Visual Studio that lets you
run clang format. I've used this and it's pretty useful. The link
below (bottom of the page) has the link to download the plugin.

http://llvm.org/builds/
-- 

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


Re: [cmake-developers] Code style auto-formatting

2015-11-19 Thread Robert Dailey
On Thu, Nov 19, 2015 at 8:26 AM, Brad King <brad.k...@kitware.com> wrote:
> On 11/19/2015 09:22 AM, Robert Dailey wrote:
>> Tonight I will do some testing and submit a patch + example files
>> converted to the style Brad suggested. We can fine-tune it as needed.
>
> Rather than a patch please work on a script to perform the conversion.
> Then at any time we can choose to run the script as the one-shot conversion
> and commit as a robot user.  Any sweeping patch would be too big to
> post to the list anyway.  Ideally the script should be simple enough
> to cut-n-paste into a shell so we can just record it in the commit
> message.
>
> See this commit for an example of this approach:
>
>  https://cmake.org/gitweb?p=cmake.git;a=commit;h=7bbaa428

Sorry for the confusion, what I meant was a patch with just the clang
format file in it. I do not plan to perform any conversions in any
patch.
-- 

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


Re: [cmake-developers] Code style auto-formatting

2015-11-17 Thread Robert Dailey
On Tue, Nov 17, 2015 at 3:35 PM, Brad King <brad.k...@kitware.com> wrote:
> Hi Folks,
>
> For reference, the current CMake indentation style is:
>
>  https://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style
>
> but with 2 space indentation instead of 4 as shown on that page.
> The style was popular when CMake started (year 2000) but is not
> very widely used anymore.
>
> For Emacs, see attached file (that comes from VTK folks that also
> use the style.  For Vim one can use something like:
>
>  set tabstop=2 shiftwidth=2 expandtab
>  set cindent cinoptions={1s,l1,g0,c0,t0,(0,W1s
>
> Since the style is not very popular anymore I don't know whether
> other editors can be configured for it.  For this reason I've
> been thinking about proposing use of clang-format for a while.
> We could also consider switching to a more widely-used indentation
> style outright and using clang-format to define it formally.
>
> On 11/17/2015 04:29 PM, Daniel Pfeifer wrote:
>> On Tue, Nov 17, 2015 at 10:12 PM, Robert Dailey wrote:
>>> How did you guys want to approach reformatting inconsistently
>>> formatted source files?
>>
>> I would say: As a byproduct.
>>
>> Adding a .clang-format file to CMake would be greatly appreciated. It
>> can be used to ensure that refactorings and new contributions follow
>> exactly the predefined style. However, changing existing code simply
>> because it does not match the style is something that should be
>> refused.
>
> I think we could do a one-shot conversion of existing sources.  This
> was done in our CMakeLists.txt and *.cmake files a while ago to update
> capitalization style.  We recorded the commit as done by a robot user
> instead of a specific developer's name.  It is not that hard to
> re-invoke `git blame` to see past any blame poisoning such a commit
> might introduce.  For that cost, we gain consistency in the code
> and simplicity for patches.

So I'd like to propose first of all that we explore a new coding
standard. Let's make the changes we want to make. In the meantime, I
will reflect that discussion into a clang format file. I'll provide it
as an attachment here, along with some samples of conversions of
existing files in the code base so we can get an idea of how it looks.

I agree with Brad about a mass one time conversion. BTW you can
instruct git blame to ignore whitespace changes; this would
effectively ignore the "whitespace robot" commit entirely (so you
don't even have to use a robot user if you didn't want to, but it's
still a great idea and doesn't hurt).

To get some discussion going, take a look at the BasedOnStyle option
in clang format:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html

There are a couple of predefined formats you could use here. Obviously
choosing one of those as a base and then fine-tuning it to your needs
would probably be the best approach. Mozilla's standard looks
reasonable. Honestly all of this is a matter of taste, I don't expect
everyone to agree on every little detail. I think the goal should be
to strive for something a little more modern (determined by general
consensus in the open source community) and most importantly enforce
it. No matter what style you choose, consistency is what matters the
most.
-- 

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


Re: [cmake-developers] Code style auto-formatting

2015-11-17 Thread Robert Dailey
On Tue, Nov 17, 2015 at 6:57 AM, Paul Smith  wrote:
> On Tue, 2015-11-17 at 08:14 +, Stuermer, Michael SP/HZA-ZSEP wrote:
>> In short, there is no fully automated style checking. If someone would
>> come up with a tool & configuration I would love to use this. So far I
>> tested astyle and the C++ edition of ReSharper (unfortunately quite
>> expensive).
>
> We've used uncrustify with excellent results in the past, FWIW.
>
> It is a major hassle though.  We did a complete code reformat with a
> well-defined process, and then had all developers apply reformatting to
> their personal branches using a particular set of steps to minimize the
> insanity.
>

I'm willing to assist with a clang format file, I've worked with them
in the past. This means contributions will likely come with multiple
patch files, some containing only whitespace fixups per the clang
format.

How did you guys want to approach reformatting inconsistently
formatted source files?

Git has plenty of options to ignore whitespace in different ways, so
it's really a non-issue as far as auditability of logs and diffs go.
-- 

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


Re: [cmake-developers] [PATCH] User may now specify toolset through CMake GUI

2015-11-16 Thread Robert Dailey
Hello everyone,

I apologize for the long hiatus, but I've finally gotten back to this.
I've implemented the suggestions here:

* deleteCache() now clears the toolset
* When the binary directory changes, the GUI now reloads the toolset
(The toolset isn't used by anything except the first-time dialog right
now, so this wasn't a necessary change, but I did it on request. We
only show the toolset on first time setup anyway, so even if you go to
an existing binary dir it won't let you change the toolset again via
the setup wizard).
* I've refactored the generator factories a bit to specify whether or
not they support toolsets.
* A lot of places that used to only pass around a list of generator
names now pass around a composite object of name+toolset support
(boolean flag). This eventually propagates to QT code so it can
determine which generators support toolsets, so it can show/hide the
toolset fields as the generator selection changes (in the first-time
dialog).

Note that I was not able to test Code Blocks. Documentation states it
has toolset support, but I didn't see a generator for code blocks
(only an extra generator, which I did not touch). I left the extra
generators in the code base alone.

Please see the attached revised patch and let me know if there is
anything else I can do. I tested on Windows 10, using Visual Studio
2013. I installed the CTP_Nov2013 compiler and tested the toolchain
field, all is working great!

On Thu, Feb 19, 2015 at 8:19 AM, Brad King <brad.k...@kitware.com> wrote:
> On 02/17/2015 01:46 PM, Brad King wrote:
>> On 02/17/2015 01:43 PM, Robert Dailey wrote:
>>> Of course right now only Visual Studio and XCode support the toolset
>>> parameter
>>
>> Correct.  Furthermore it is supported only for VS >= 10.
>
> In response to this issue:
>
>  http://www.cmake.org/Bug/view.php?id=15411
>
> I've made this change:
>
>  cmake-gui: Reset generator platform and toolset on configure (#15411)
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ade687d
>
> Please account for that while developing your changes.
>
> Thanks,
> -Brad
>


0001-User-may-now-specify-toolset-through-CMake-GUI.patch
Description: Binary data
-- 

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

Re: [cmake-developers] [PATCH] User may now specify toolset through CMake GUI

2015-11-16 Thread Robert Dailey
I also forgot to mention that this patch is based on the 'next'
branch. Originally it was based on 'master' but I rebased it to
'next'. Let me know if this is correct. I'm assuming the master branch
is used for maintenance releases only and would not be appropriate for
such a change.

On Mon, Nov 16, 2015 at 9:50 PM, Robert Dailey <rcdailey.li...@gmail.com> wrote:
> Hello everyone,
>
> I apologize for the long hiatus, but I've finally gotten back to this.
> I've implemented the suggestions here:
>
> * deleteCache() now clears the toolset
> * When the binary directory changes, the GUI now reloads the toolset
> (The toolset isn't used by anything except the first-time dialog right
> now, so this wasn't a necessary change, but I did it on request. We
> only show the toolset on first time setup anyway, so even if you go to
> an existing binary dir it won't let you change the toolset again via
> the setup wizard).
> * I've refactored the generator factories a bit to specify whether or
> not they support toolsets.
> * A lot of places that used to only pass around a list of generator
> names now pass around a composite object of name+toolset support
> (boolean flag). This eventually propagates to QT code so it can
> determine which generators support toolsets, so it can show/hide the
> toolset fields as the generator selection changes (in the first-time
> dialog).
>
> Note that I was not able to test Code Blocks. Documentation states it
> has toolset support, but I didn't see a generator for code blocks
> (only an extra generator, which I did not touch). I left the extra
> generators in the code base alone.
>
> Please see the attached revised patch and let me know if there is
> anything else I can do. I tested on Windows 10, using Visual Studio
> 2013. I installed the CTP_Nov2013 compiler and tested the toolchain
> field, all is working great!
>
> On Thu, Feb 19, 2015 at 8:19 AM, Brad King <brad.k...@kitware.com> wrote:
>> On 02/17/2015 01:46 PM, Brad King wrote:
>>> On 02/17/2015 01:43 PM, Robert Dailey wrote:
>>>> Of course right now only Visual Studio and XCode support the toolset
>>>> parameter
>>>
>>> Correct.  Furthermore it is supported only for VS >= 10.
>>
>> In response to this issue:
>>
>>  http://www.cmake.org/Bug/view.php?id=15411
>>
>> I've made this change:
>>
>>  cmake-gui: Reset generator platform and toolset on configure (#15411)
>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ade687d
>>
>> Please account for that while developing your changes.
>>
>> Thanks,
>> -Brad
>>
-- 

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


[cmake-developers] Code style auto-formatting

2015-11-16 Thread Robert Dailey
IMHO, the code style in the CMake code base is incredibly
inconsistent, but even the consistent style that is there is a giant
pain to follow by hand.

I'm constantly fighting my tooling's auto formatting. I prefer to keep
my code additions similar to surrounding code. Do you use some tool
such as clang-format to auto format code? This will make it easier to
make my style more consistent after my work is completed.

Thanks in advance.
-- 

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


[cmake-developers] Visual Studio 2013 with CMake GUI on Windows

2015-11-13 Thread Robert Dailey
CMake requires Qt4, which is incompatible with VS 2013 officially. I
do not want to apply patches to get it working.

Is it possible to get CMake to use Qt5? I know this already supports
VS 2013. Is Qt5 backward compatible with Qt4 with regards to the
feature sets being utilized by CMake?

I do not have VS 2008 or 2010 available, unfortunately. I also do not
have a linux or mac platform to build on.
-- 

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


Re: [cmake-developers] Visual Studio 2013 with CMake GUI on Windows

2015-11-13 Thread Robert Dailey
On Fri, Nov 13, 2015 at 10:53 AM, Brad King <brad.k...@kitware.com> wrote:
> On 11/13/2015 11:42 AM, Robert Dailey wrote:
>> CMake requires Qt4, which is incompatible with VS 2013 officially. I
>> do not want to apply patches to get it working.
>>
>> Is it possible to get CMake to use Qt5?
>
> CMake already supports being built with Qt5 on Windows.
>
> Configure with CMAKE_PREFIX_PATH containing to the path to
> msvc2013_64_opengl and it should be found automatically.
> Ensure Qt5Widgets_DIR points to
>
>  msvc2013_64_opengl/lib/cmake/Qt5Widgets

Thank you Brad, I wasn't setting CMAKE_PREFIX_PATH because it didn't
show up by default in the list of cache variables after generating. I
added it manually and it just worked. At first all I was doing was
enabling QT dialog in config, regenerating, and then changed the path
that it wanted for qtmake.exe. When I pointed it at qtmake for Qt5, it
complained about requiring Qt4.
-- 

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


[cmake-developers] C++11 support?

2015-11-13 Thread Robert Dailey
Just to be clear, does CMake code base allow for C++11 or higher? or
are you guys locked down to C++03?
-- 

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


[CMake] Colored diagnostic output for GCC 4.9 through Ninja

2015-10-28 Thread Robert Dailey
I'm using CMake + Ninja against GCC 4.9 in the Android NDK. I'm on
Windows, invoking 'ninja' through CMD.exe.

I do not see colored output for diagnostics (errors, warnings, etc)
GCC gives. Is there something in CMake I need to configure to enable
colored output?
-- 

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] Colored diagnostic output for GCC 4.9 through Ninja

2015-10-28 Thread Robert Dailey
On Wed, Oct 28, 2015 at 11:20 AM, Robert Dailey
<rcdailey.li...@gmail.com> wrote:
> On Wed, Oct 28, 2015 at 11:19 AM, Robert Dailey
> <rcdailey.li...@gmail.com> wrote:
>> On Wed, Oct 28, 2015 at 9:03 AM, Miller Henry <millerhe...@johndeere.com> 
>> wrote:
>>>
>>> I do something like this, which works for clang and should work for gcc 4.9 
>>> though I haven't tested it.   I haven't wrote the right way to do this 
>>> which is to check if the terminal supports color before passing the flag 
>>> in. I don't know what will happen on our e.g. CI system which doesn't 
>>> support color.
>>>
>>> macro(AddCXXFlagIfSupported flag test)
>>>CHECK_CXX_COMPILER_FLAG(${flag} ${test})
>>>if( ${${test}} )
>>>   message("adding ${flag}")
>>>   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
>>>endif()
>>> endmacro()
>>>
>>> if("Ninja" STREQUAL ${CMAKE_GENERATOR})
>>>AddCXXFlagIfSupported(-fcolor-diagnostics 
>>> COMPILER_SUPPORTS_fcolor-diagnostics)
>>> endif()
>>>
>>> P.s. AddCXXFlagIfSupported ought to be in the default cmake distribution 
>>> along with a lot or similar things
>>
>> Unfortunately your solution doesn't seem to work. I get the following output:
>>
>> [1/1] Re-running CMake...
>> -- Performing Test COMPILER_SUPPORTS_fcolor-diagnostics
>> -- Performing Test COMPILER_SUPPORTS_fcolor-diagnostics - Failed
>>
>> GCC 4.9 supports this I thought?
>
> I found the issue, the flag is diagnostics-color, not color-diagnostics.


Actually, even after getting this working, I still get no color output. :-(
-- 

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] Colored diagnostic output for GCC 4.9 through Ninja

2015-10-28 Thread Robert Dailey
On Wed, Oct 28, 2015 at 9:03 AM, Miller Henry  wrote:
>
> I do something like this, which works for clang and should work for gcc 4.9 
> though I haven't tested it.   I haven't wrote the right way to do this which 
> is to check if the terminal supports color before passing the flag in. I 
> don't know what will happen on our e.g. CI system which doesn't support color.
>
> macro(AddCXXFlagIfSupported flag test)
>CHECK_CXX_COMPILER_FLAG(${flag} ${test})
>if( ${${test}} )
>   message("adding ${flag}")
>   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
>endif()
> endmacro()
>
> if("Ninja" STREQUAL ${CMAKE_GENERATOR})
>AddCXXFlagIfSupported(-fcolor-diagnostics 
> COMPILER_SUPPORTS_fcolor-diagnostics)
> endif()
>
> P.s. AddCXXFlagIfSupported ought to be in the default cmake distribution 
> along with a lot or similar things

Unfortunately your solution doesn't seem to work. I get the following output:

[1/1] Re-running CMake...
-- Performing Test COMPILER_SUPPORTS_fcolor-diagnostics
-- Performing Test COMPILER_SUPPORTS_fcolor-diagnostics - Failed

GCC 4.9 supports this I thought?
-- 

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] Colored diagnostic output for GCC 4.9 through Ninja

2015-10-28 Thread Robert Dailey
On Wed, Oct 28, 2015 at 11:19 AM, Robert Dailey
<rcdailey.li...@gmail.com> wrote:
> On Wed, Oct 28, 2015 at 9:03 AM, Miller Henry <millerhe...@johndeere.com> 
> wrote:
>>
>> I do something like this, which works for clang and should work for gcc 4.9 
>> though I haven't tested it.   I haven't wrote the right way to do this which 
>> is to check if the terminal supports color before passing the flag in. I 
>> don't know what will happen on our e.g. CI system which doesn't support 
>> color.
>>
>> macro(AddCXXFlagIfSupported flag test)
>>CHECK_CXX_COMPILER_FLAG(${flag} ${test})
>>if( ${${test}} )
>>   message("adding ${flag}")
>>   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
>>endif()
>> endmacro()
>>
>> if("Ninja" STREQUAL ${CMAKE_GENERATOR})
>>AddCXXFlagIfSupported(-fcolor-diagnostics 
>> COMPILER_SUPPORTS_fcolor-diagnostics)
>> endif()
>>
>> P.s. AddCXXFlagIfSupported ought to be in the default cmake distribution 
>> along with a lot or similar things
>
> Unfortunately your solution doesn't seem to work. I get the following output:
>
> [1/1] Re-running CMake...
> -- Performing Test COMPILER_SUPPORTS_fcolor-diagnostics
> -- Performing Test COMPILER_SUPPORTS_fcolor-diagnostics - Failed
>
> GCC 4.9 supports this I thought?

I found the issue, the flag is diagnostics-color, not color-diagnostics.
-- 

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


[CMake] Writing find packages

2015-09-03 Thread Robert Dailey
How recent is this documentation?
http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules

It seems rather old. What is the modern way of doing this? Below is my
find module, I'm not sure if I'm doing it "the right way":

# Try to find the vsvars32.bat file

if( MSVC_VERSION EQUAL 1900 )
set( ENV_VAR_NUM 140 )
endif()

set( vscomntools $ENV{} )

find_file( VSVARS_FILE vsvars32.bat
HINTS ENV "VS${ENV_VAR_NUM}COMNTOOLS"
)

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( FindVSVars DEFAULT_MSG VSVARS_FILE )

mark_as_advanced( VSVARS_FILE )
-- 

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 depend on external cmake projects?

2015-08-22 Thread Robert Dailey
On Mon, Aug 17, 2015 at 10:17 AM, James Johnston
jam...@motionview3d.com wrote:
 Well, you'd do this in conjunction with ExternalProject_Add.  A well-written
 CMake external project will provide a projectConfig.cmake file which you
 will then find using find_package.

After toying around with this idea for a bit, I've found out that
ExternalProject_Add() actually builds the project from a custom target
within Visual Studio (I'm using VS as my generator). However,
find_package() works at CMake configure time, so this is a chicken 
egg problem. find_package() won't work because the external project
has not been built yet.

How do you solve this problem?

 A high-level CMake project that does nothing but call ExternalProject_Add;
 this is called a superbuild.  Your own CMake projects will be
 ExternalProjects to this high-level project and the superbuild would pass
 the location to your project via -Dproject_DIR=location so that
 find_package can locate the Config file.

I'm not sure I understand this. This smells related to my question
above, maybe an answer even. Can you clarify/go into more detail?
Thanks a bunch.
-- 

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


[CMake] Crawling documentation to find named argument keywords

2015-08-17 Thread Robert Dailey
I've attached a python script I'm using to obtain a list of keywords
across all CMake commands that I can use. Can someone let me know if
this is a reliable way to craw the help documentation to find these
keywords?

Note that the keywords I'm referring to are things like APPEND in the
list() command, or PUBLIC and PRIVATE in the target_link_libraries()
command. Each command has a set of all-upper-case keywords it uses to
separate out arguments. I want a list of these keywords for all
commands in one big list.

I'm doing this to support syntax highlighting in a text editor.

To use the script, first pipe out CMake's help to a file like this:

$ cmake --help-full  help.txt

Then run it through the python script attached:

$ python-3.4 strip-options.py help.txt

This should output to console the list of keywords. I feel like a lot
are missing. I also got a lot of false positives. Can anyone suggest a
better way to isolate true argument keywords in the help text?
# This script requires Python 3.x
import re
import sys

matched_words = []

help_file = sys.argv[1]
with open(help_file, 'r') as f:
for line in f:
if line.startswith(' ') or line.startswith('\t'):
for match in re.finditer('[^\w\d]([A-Z]+)(?=[^\w\d])', line):
matched_words.append(match.group(1))

for word in set(matched_words):
if len(word)  1:
print(word)
-- 

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

[CMake] How to depend on external cmake projects?

2015-08-16 Thread Robert Dailey
There are certain repositories on Github I'd like to pull in as a
dependency. These repositories already use CMake to build their source
code. Based on personal experience and reading material online, there
are a couple of different options:

1. Pull down the repository as a submodule to my own git repository.
Then call add_subdirectory() on it to make it part of the build,
allowing me to refer to those targets as dependencies in my own
targets.

2. Use ExternalProject_Add(). This seems like legacy, I'm not sure if
I should use this. It also seems very verbose and boilerplate.

3. Use packages. The [CMake package documentation][1] does not go into
great detail on support for both installed versions and build tree for
a single package. Does this require two scripts? Can it share a single
one? Where are the examples?

How do I accomplish this?

[1]: 
http://www.cmake.org/cmake/help/v3.3/manual/cmake-packages.7.html#creating-a-package-configuration-file-for-the-build-tree
-- 

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


[CMake] Managed C++ / C# Projects: Location of assembly DLL

2015-08-05 Thread Robert Dailey
I am including external MS projects via CMake for my C# projects. The
Managed C++ projects I generate via CMake directly. However, sharing
assembly references between the two is difficult.

Sometimes I need my imported C# projects to know where to find the
managed C++ DLL assembly it built. This is in the CMake binary
directory, which might be different on each machine, so I can't
exactly setup a relative path to this file in the C# project
references section.

Likewise with dependencies on C# output from Managed C++. It's a
little easier to tell CMake where to find the output DLL file for a C#
project (since the output location is relative inside the source dir).

How do you guys recommend solving these dependency issues? Is there a
way I can add an assembly reference to a Managed C++ project via path
through CMake?
-- 

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


[CMake] Is add_definitions() still recommended?

2015-07-24 Thread Robert Dailey
Starting with CMake 3.1, and going forward, is add_definitions() still
recommended if you have preprocessor definitions you want included in
all projects? The evolution of CMake appears to discourage setting
global state in favor of relying more on target properties (for
includes, definitions, and more).

This usually requires me to create a wrapper function I use in all
CMake scripts to generate targets, so it will handle setup common to
all projects. Sometimes it's just easier to set global state.

What's the desired design and structure intended going forward?
-- 

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] Toolchain file for VS2013 + November CTP compiler toolset?

2015-07-21 Thread Robert Dailey
On Fri, Jul 17, 2015 at 11:25 AM, Robert Dailey
rcdailey.li...@gmail.com wrote:
 Hello,

 How would I define a toolchain file for the Visual Studio 2013
 generator that also defines the toolset for that generator to be the
 November CTP compiler?

 I'd rather use a toolchain for this than do -D definitions when I
 invoke cmake to generate.

 Thanks in advance.

Any thoughts on this? I'd actually rather specify the toolset within
my root CMakeLists.txt script (since when generating our code, you
*must* use the November CTP compiler when selecting the MSVC12
generator). However the documentation states it should not be set from
within the CMake script.

Ideas? The toolchain file is not necessary if it's valid to set the
CMAKE_GENERATOR_TOOLSET variable within the CMakeLists.txt script
(before or after the first project() call?)
-- 

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


[CMake] Toolchain file for VS2013 + November CTP compiler toolset?

2015-07-17 Thread Robert Dailey
Hello,

How would I define a toolchain file for the Visual Studio 2013
generator that also defines the toolset for that generator to be the
November CTP compiler?

I'd rather use a toolchain for this than do -D definitions when I
invoke cmake to generate.

Thanks in advance.
-- 

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-18 Thread Robert Dailey
On Thu, Jun 18, 2015 at 1:57 AM, Dan Liew d...@su-root.co.uk wrote:
 The reason I'm asking this question is because of how I handle unit
 tests in CMake right now. Instead of just defining an executable
 target for the test and then adding a link dependency on the library
 containing the class or set of classes to be tested, I am manually
 pulling in the CPP and H file into the test target and building them
 inline with the test code. This is to support mocking (I can't mock
 objects already compiled into a static library). As such, I need the
 transitive includes and defines, but I do not want the transitive link
 libraries.

 Okay with that context what I suggested isn't going to completely
 solve the problem.

 It is actually possible to link with your static library and a mock
 implementation by making the symbols that you want mock in the library
 weak. Then when you link the linker will choose the strong (the mock)
 implementation in preference to the weak implementation. It probably
 isn't desirable to have weak symbols in a shipping library just to
 make unit testing easier so you could build two versions of the
 library (one with weak symbols and one without).
 This would allow to use target_link_libraries() but not get link
 conflicts between your mock implementation and the real
 implementation.

 However Petr's suggestion also sounds good (although I haven't tested it).


Can you explain what you mean by strong and weak symbols?
-- 

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-18 Thread Robert Dailey
On Thu, Jun 18, 2015 at 4:24 PM, Dan Liew d...@su-root.co.uk wrote:
 Hi,

 On 18 June 2015 at 12:16, Robert Dailey rcdailey.li...@gmail.com wrote:
 On Thu, Jun 18, 2015 at 12:02 PM, Dan Liew d...@su-root.co.uk wrote:
 Can you explain what you mean by strong and weak symbols?


 Google is your friend

 https://en.wikipedia.org/wiki/Weak_symbol

 http://stackoverflow.com/questions/2290587/gcc-style-weak-linking-in-visual-studio

 Normally Google is my friend, but today it hates me. Because no such
 feature exists for MSVC that I saw.

 The stackoverflow suggests it is possible for MSVC.

 Thinking about it some more I think what I'm suggesting is the wrong
 approach. If you're writing C++ code you should avoid coupling your
 classes to allow dependency injection (i.e. you pick how classes are
 coupled at run time not at compile time). If your classes are written
 with dependency injection in mind then you don't need the weak symbol
 stuff I was talking about.

I managed to find MSVC information outside of the SO question (No, I
never skimmed through it sufficiently to find any information directly
there on it). Apparently MSVC will prioritize symbols in .OBJ files
over those found in .LIB without any warnings or errors. So only
special case logic is needed for GCC on Linux (the #pragma weak
symbol format).

I agree with the principle of runtime dependency injection. It's
necessary when mocking across library boundaries. However, my two main
concerns:

1) Complexity overhead (Objects will now become more complex to
construct, as dependencies must be fulfilled externally). This appears
to be a common concern with dependency injection, however factories
and reasonable defaults normally will help counter the issue.
2) Compile time polymorphism for dependency injection (i.e. templates)
may not be an option. Template classes are not compiled into static
libs, so there may even be a way to do this. However slightly related
to #1, it forces a class to become a template when it otherwise would
not need to be one (remedy would be an alias serving a default
template argument).

I think I can make this work, thanks to the fine suggestions here.
Much appreciated guys.
-- 

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-18 Thread Robert Dailey
On Thu, Jun 18, 2015 at 12:02 PM, Dan Liew d...@su-root.co.uk wrote:
 Can you explain what you mean by strong and weak symbols?


 Google is your friend

 https://en.wikipedia.org/wiki/Weak_symbol

 http://stackoverflow.com/questions/2290587/gcc-style-weak-linking-in-visual-studio

Normally Google is my friend, but today it hates me. Because no such
feature exists for MSVC that I saw.
-- 

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


[CMake] Recursively include target include directories only

2015-06-17 Thread Robert Dailey
Is there a way to only take (recursively) the include directories 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.
-- 

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-17 Thread Robert Dailey
On Wed, Jun 17, 2015 at 4:31 PM, Dan Liew d...@su-root.co.uk wrote:
 On 17 June 2015 at 12:28, Robert Dailey rcdailey.li...@gmail.com 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 presume recursively you mean propagating the required include
 directories between targets rather anything to do recursively handling
 directories.

 As you mentioned include directories do propagate but this only
 happens under certain conditions (when using PUBLIC or INTERFACE
 scopes).

 I don't know of a way of doing it without target_link_libraries but if
 it is necessary for you to do this it sounds like you have bigger
 problems relating to the way you have your project header files
 organised.

 The approach I use for include directories is to have all includes for
 the project rooted in a single include directory in the source tree
 and have all includes relative to that directory. Then if I you

 ```
 include_directories(${CMAKE_SOURCE_DIR}/include)
 include_directories(${CMAKE_BINARY_DIR}/include) # for generated header files
 ```

 in the root of the project you never need to set include paths
 anywhere else for sources that are in your project tree. E.g. if there
 is header file in

 ${CMAKE_SOURCE_DIR}/include/project/moduleA/interface.h

 then in the sources this is included as

 #include project/moduleA/interface.h

 (note there are never relative header file includes).

 This is the approach that the LLVM project uses which is very simple
 and very clean (take a look at the sources). This also works very well
 for installing your header files, the contents of ${CMAKE_SOURCE_DIR}
 just need to be copied into /usr/include .

Thanks, I will go through this and see if it helps.

The reason I'm asking this question is because of how I handle unit
tests in CMake right now. Instead of just defining an executable
target for the test and then adding a link dependency on the library
containing the class or set of classes to be tested, I am manually
pulling in the CPP and H file into the test target and building them
inline with the test code. This is to support mocking (I can't mock
objects already compiled into a static library). As such, I need the
transitive includes and defines, but I do not want the transitive link
libraries.

If there is a better structure or overall approach I'm happy to
listen! This has been a nightmare so far.
-- 

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


[CMake] Accessing source directory of a target

2015-06-12 Thread Robert Dailey
Hello,

Is there a SOURCE_DIR property for targets? I wasn't able to find
anything in the documentation on this, however I thought I saw
something similar to this a few years ago. I'm using CMake 3.2.
Basically I want the equivalent of CMAKE_CURRENT_SOURCE_DIR, but for a
specific project.

Documentation states you can do TARGET_SOURCE_DIR, but this value is
empty for me. Unless this is for projects, not targets (i.e. the value
passed to the project() command).

Thanks in advance.
-- 

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, Android, and Eclipse ADT Integration

2015-05-01 Thread Robert Dailey
Honestly I hadn't set any expectations for the response I was going to
get here. Your response is surprisingly hopeful IMHO.

So basically the goal is to treat C++ completely separate from Java
from a development, workflow, and build system perspective. In other
words, if we need to debug native code, we use Visual Studio + GDB
toolchain of sorts, all controlled and generated by CMake?

And for the Java side, we switch over to Android Studio? Also
launching on device or emulator, we initiate that from Android Studio
as well I imagine (simply to deploy the APK to the device, not really
for debugging). This won't be controlled by CMake at all.

I guess this means the only missing piece is how the Gradle scripts
find the *.so files from native code so it can be packaged up in the
APK. I assume this means a post-build event on the CMake side for
shared library targets that copies the files to
libs/armeabi/libfoo.so? Or is that not the way to do it anymore with
gradle? I have only used the ant + ndkbuild method, so I'm not sure
how things would change. But it seems like the general direction is
this:

1. Check out source code
2. Generate native project with CMake + android toolchain
3. Build the native libraries with the project generated by CMake
4. The build completes by installing all *.so files to corresponding
paths in the source tree so Gradle/Android Studio can find them
5. Open Android Studio  build everything
6. Deploy to device

Does this sound about right?

On Thu, Apr 30, 2015 at 10:11 PM, Parag Chandra pa...@ionicsecurity.com wrote:
 Hi Robert,

 This will be a bit long-winded, so bear with me. I¹m also cross-compiling
 for Android with CMake, and am currently using Eclipse ADT for much of my
 development. I have tried hard to make Eclipse work for both the Java and
 the C++ portions of my libraries and applications, but gave up after a few
 months when it became apparent that Eclipse¹s support for Android¹s C++
 toolchain is horribly broken. Essentially, I got it to work for brief
 periods of time, with concurrent Java/C++ debugging, but then Eclipse
 would inexplicably forget all of the library/include paths, display
 thousands of red squiggles all over my code, and then refuse to launch my
 application. The only Œsolution¹ was to completely strip the project of
 its C++ nature, add it back in, and then reconfigure all the
 library/include paths, at which point everything would work again for a
 few hours or a couple of days. Add to this the fact that Google has
 officially deprecated Ant+Eclipse in favor of IntelliJ+Gradle, and it¹s
 become clear that my time will be better spent migrating to Android Studio.

 Of course, Android Studio has absolutely no support for C/C++ at the
 moment, but at least it won¹t get in the way like Eclipse did. So I think
 a near-term solution is to use Android Studio for all of the Java code, in
 conjunction with one of several different Visual Studio-based offerings
 for all the C++ code:

 Visual Studio 2015
 WinGDB
 VisualGDB
 Android++

 Somewhere around the CMake 3.1 timeframe, they introduced a small feature
 that enables the Visual Studio generator to support any arbitrary
 cross-toolchain, instead of just a few hardcoded ones. I¹ve been using
 this to generate VS solutions that target Native Client as well as Windows
 Phone. Although I haven¹t yet had a chance to play around with any of the
 offerings I mentioned previously, I believe you will be able to use this
 same feature to target Android, after you have installed one of these
 plug-ins in Visual Studio.

 Probably not the answer you wanted to hear, but I thought I would share my
 experience and hopefully save you some trouble.

 Parag Chandra
 Senior Software Engineer, Mobile Team
 Mobile: +1.919.824.1410

  https://ionic.com

 Ionic Security Inc.
 1170 Peachtree St. NE STE 400, Atlanta, GA 30309











 On 4/30/15, 4:46 PM, Robert Dailey rcdailey.li...@gmail.com wrote:

On Wed, Mar 11, 2015 at 11:42 AM, Robert Dailey
rcdailey.li...@gmail.com wrote:
 I am implementing support for Android in my CMake scripts by using
 custom commands to invoke 'ant' to build the final APK. If I do it
 this way, and I generate for eclipse, how can I make sure it will
 integrate with the ADT plugin?

 Basically I want to be able to right-click my project in Eclipse
 (generated by CMake) and Run as Android Application and have it
 deploy to the device. What is required to make this happen?

 Also any idea how debugging will be impacted?

 Thanks.

No help or advice on this?
--

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

Re: [CMake] find_library while cross compiling?

2015-05-01 Thread Robert Dailey
Should I override these variables in the android toolchain file?

On Thu, Apr 30, 2015 at 9:43 PM, Parag Chandra pa...@ionicsecurity.com wrote:
 Hi Robert,

 I encountered a similar problem when I was cross-compiling for NaCl on
 Windows. You need to set various CMake variables that explicitly override
 things like the library suffix/prefix. For example, in my case I needed to
 set the following:

 set (CMAKE_STATIC_LIBRARY_PREFIX lib)
 set (CMAKE_STATIC_LIBRARY_SUFFIX .a)
 set (CMAKE_EXECUTABLE_SUFFIX .pexe CACHE STRING  FORCE)
 set (CMAKE_SHARED_LIBRARY_PREFIX lib)
 set (CMAKE_SHARED_LIBRARY_SUFFIX .so)

 Hope this helps.




 Parag Chandra
 Senior Software Engineer, Mobile Team
 Mobile: +1.919.824.1410

  https://ionic.com

 Ionic Security Inc.
 1170 Peachtree St. NE STE 400, Atlanta, GA 30309











 On 4/30/15, 4:34 PM, Robert Dailey rcdailey.li...@gmail.com wrote:

I'm on Windows and I am cross compiling for Android NDK. I use
find_library() with PATHS to hunt down some libssl.a files, plus a few
others.

However, find_library() says it can't find them. I'm assuming this is
because I'm on Windows and it doesn't recognize *.a files as a valid
library on that platform. Is there a way to make CMake search
libraries based on the platform the target is being compiled for?
--

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

-- 

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


[CMake] find_library while cross compiling?

2015-04-30 Thread Robert Dailey
I'm on Windows and I am cross compiling for Android NDK. I use
find_library() with PATHS to hunt down some libssl.a files, plus a few
others.

However, find_library() says it can't find them. I'm assuming this is
because I'm on Windows and it doesn't recognize *.a files as a valid
library on that platform. Is there a way to make CMake search
libraries based on the platform the target is being compiled for?
-- 

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, Android, and Eclipse ADT Integration

2015-04-30 Thread Robert Dailey
On Wed, Mar 11, 2015 at 11:42 AM, Robert Dailey
rcdailey.li...@gmail.com wrote:
 I am implementing support for Android in my CMake scripts by using
 custom commands to invoke 'ant' to build the final APK. If I do it
 this way, and I generate for eclipse, how can I make sure it will
 integrate with the ADT plugin?

 Basically I want to be able to right-click my project in Eclipse
 (generated by CMake) and Run as Android Application and have it
 deploy to the device. What is required to make this happen?

 Also any idea how debugging will be impacted?

 Thanks.

No help or advice on this?
-- 

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-developers] [CMake] Bug in CMake GUI 3.2.1?

2015-04-13 Thread Robert Dailey
I am running on Windows 8.1. Screenshots attached.

On Mon, Apr 13, 2015 at 9:20 AM, Brad King brad.k...@kitware.com wrote:
 On 04/10/2015 12:26 PM, Robert Dailey wrote:
 I am noticing that after installing the official Windows installer for
 3.2.1 release, CMake GUI looks different. Menu options have GCC
 specific options and when I generate through the GUI for Visual Studio
 2013, my projects are missing preprocessor definitions like _WINDOWS,
 WIN32, etc.

 I don't see any of that behavior.  I would think such major breakage
 would have been reported pretty quickly, so something may be wrong
 locally for you.  From what environment are you running cmake-gui?

 -Brad
-- 

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

Re: [CMake] Bug in CMake GUI 3.2.1?

2015-04-13 Thread Robert Dailey
I am running on Windows 8.1. Screenshots attached.

On Mon, Apr 13, 2015 at 9:20 AM, Brad King brad.k...@kitware.com wrote:
 On 04/10/2015 12:26 PM, Robert Dailey wrote:
 I am noticing that after installing the official Windows installer for
 3.2.1 release, CMake GUI looks different. Menu options have GCC
 specific options and when I generate through the GUI for Visual Studio
 2013, my projects are missing preprocessor definitions like _WINDOWS,
 WIN32, etc.

 I don't see any of that behavior.  I would think such major breakage
 would have been reported pretty quickly, so something may be wrong
 locally for you.  From what environment are you running cmake-gui?

 -Brad
-- 

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

[cmake-developers] .gitattributes updates

2015-03-15 Thread Robert Dailey
Hey everyone,

This isn't a huge change but I think it is important.

I noticed that .gitattributes was not properly configured to utilize
modern Git features:

1. * text=auto to specify automatic line ending handling for files
that git detects as text files
2. Replace deprecated attribute specifications with newer versions
3. General cleanup and removal of redundant attributes

One patch file is a line-ending conversion that does nothing more than
replace CRLF with LF. This must be done since the goal is that all
files are stored natively as LF in the actual repository. Line ending
conversions are applied to the working copy as needed (e.g. LF - CRLF
on Windows for certain files, like VCPROJ)

Note that this isn't simply a cleanup change. There were actually
some things wrong with the current gitattributes:

1. Some files were not properly being handled by git
2. Git config settings on a per-machine basis affected the EOL
normalization in the repository

These changes will enforce consistency and ignore per-machine settings.

Let me know if the changes look acceptable. I'm happy to answer any questions.


0001-Add-automatic-EOL-handling-to-.gitattributes.patch
Description: Binary data


0002-Normalized-line-endings.patch
Description: Binary data
-- 

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

[CMake] CMake, Android, and Eclipse ADT Integration

2015-03-11 Thread Robert Dailey
I am implementing support for Android in my CMake scripts by using
custom commands to invoke 'ant' to build the final APK. If I do it
this way, and I generate for eclipse, how can I make sure it will
integrate with the ADT plugin?

Basically I want to be able to right-click my project in Eclipse
(generated by CMake) and Run as Android Application and have it
deploy to the device. What is required to make this happen?

Also any idea how debugging will be impacted?

Thanks.
-- 

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-developers] [PATCH] User may now specify toolset through CMake GUI

2015-02-17 Thread Robert Dailey
On Tue, Feb 17, 2015 at 12:08 PM, Brad King brad.k...@kitware.com wrote:
 On 02/17/2015 12:21 PM, Robert Dailey wrote:
 What would be the best way to handle detecting which generators support 
 toolset?

 The confusing piece I had to figure out last night is that there is
 simply no generator base class from which everything derives, there
 are 2 types: extra generators and generators.

 The extra generators are not of concern here.  They are only ever
 used in conjunction with real generators.  The base class for the
 latter is cmGlobalGenerator.  However, cmGlobalGeneratorFactory is
 also a candidate for this check since it exists before the actual
 generator is created.  You'll have to pick whichever works more
 cleanly for this use case.

Of course right now only Visual Studio and XCode support the toolset
parameter (according to the docs). These both happen to be global
generators. However, I was thinking of a case in the future where
Eclipse CDT4 or Code Blocks may support toolsets. Would these be
implemented through global generators anyway? Does it make sense for
extra generators to support toolset? Some educational explanation here
for my benefit would be appreciated.
-- 

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


Re: [cmake-developers] [PATCH] User may now specify toolset through CMake GUI

2015-02-16 Thread Robert Dailey
Fair points, I will make the changes.

What is the recommended practice for updating patches on mailing
lists? With pull requests it's easy because it picks up my changes I
push to my branch automatically. I think if I push another patch to
the mailing list it will start another email thread, which may cause
lost context since this email chain won't be connected to the new one
(not sure if that matters).

Thanks Brad.

On Mon, Feb 16, 2015 at 10:35 AM, Brad King brad.k...@kitware.com wrote:
 On 02/15/2015 03:27 PM, rcdailey.li...@gmail.com wrote:
 From: Robert Dailey rcdai...@gmail.com

 The -T parameter to CMake may now be specified through QtDialog
 (cmake-gui) via a new text field in the first-time configure
 wizard (below the generator chooser).

 Thanks for working on this.  I think QCMake::setBinaryDirectory
 also needs to check for CMAKE_GENERATOR_TOOLSET from an existing
 cache file much like it already does for CMAKE_GENERATOR.  One
 may currently use the Add Entry button to pre-define an entry
 for CMAKE_GENERATOR_TOOLSET to set this from the GUI indirectly.

 Since not all generators support this field, we should not present
 it when a non-supporting generator is selected.  This will need
 some type of query on the selected generator to be added.

 Thanks,
 -Brad

-- 

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


[cmake-developers] How to work with QtDialog?

2015-02-15 Thread Robert Dailey
I'm making minor modifications to add -T support to cmake-gui.
However, I'm not familiar with how to develop CMake's GUI application.
Do I generate for Visual Studio 2013 (I'm on windows)? I'm able to
compile the QT dialog application and run it from Visual Studio,
however if I have to add new signals, i end up having to manually edit
the moc_* files. I assume those are generated.

Could I get some workflow tips? Thanks.
-- 

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


Re: [CMake] CMake Android with debugging

2015-02-05 Thread Robert Dailey
Would love some feedback from those who have experience with this setup.

On Tue, Feb 3, 2015 at 11:47 AM, Robert Dailey rcdailey.li...@gmail.com wrote:
 So the way I've seen JAVA integration with NDK suggested is to use a
 custom target to launch ant to build the APK. However, if I do it this
 way, how would I launch debugging from Eclipse with ADT installed?
-- 

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


[CMake] CMake Android with debugging

2015-02-03 Thread Robert Dailey
So the way I've seen JAVA integration with NDK suggested is to use a
custom target to launch ant to build the APK. However, if I do it this
way, how would I launch debugging from Eclipse with ADT installed?
-- 

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 can I make CTest not do dart-related stuff?

2015-01-30 Thread Robert Dailey
Apparently I have to:

include( CTest )

I wasn't doing that. Now it works as you have explained. Thanks!

On Fri, Jan 30, 2015 at 2:26 PM, Robert Dailey rcdailey.li...@gmail.com wrote:
 David,

 I added a CTestConfig.cmake right next to the root CMakeLists.txt and
 it's empty except for a comment. I get the following output:

 ===
 [189/189] Linking CXX executable output/bin/Test_UI_String
 Cannot find file:
 /home/fe/atlassian/bamboo_builds/131076/FE-MP88-UT/build/DartConfiguration.tcl
Site:
Build name: (empty)
 Create new tag: 20150130-2000 - Experimental
 Cannot find file:
 /home/fe/atlassian/bamboo_builds/131076/FE-MP88-UT/build/DartConfiguration.tcl
 Test project /home/fe/atlassian/bamboo_builds/131076/FE-MP88-UT/build
 Start 1: Test_UI_List
 Start 2: Test_UI_String
 1/2 Test #1: Test_UI_List .   Passed0.03 sec
 2/2 Test #2: Test_UI_String ...   Passed0.03 sec

 100% tests passed, 0 tests failed out of 2

 Total Test time (real) =   0.04 sec
 ===

 It still says it can't find the dart files. Do I need to include the
 CTestConfig.cmake file somewhere?

 here is the build script my Bamboo server is using:

 ===
 set -e

 export CC=clang
 export CXX=clang++
 NINJA=${bamboo.capability.system.builder.command.Ninja}
 TRUE_COMMAND=${bamboo.capability.system.builder.command.true}

 cmake ../frontend -GNinja \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_MAKE_PROGRAM=$NINJA \

 # This builds all tests + dependencies
 $NINJA all_tests || { echo Build Failure; exit 1; }

 # Test against /usr/bin/true so that test failures don't
 # cause build failures.
 ctest -T Test -j 16 --output-on-failure || eval $TRUE_COMMAND
 ===

 On Fri, Jan 30, 2015 at 1:47 PM, David Cole dlrd...@aol.com wrote:
 Do you have a CTestConfig.cmake file in your source tree?

 If you do, then ctest will load that instead of looking for the
 DartConfiguration.tcl file in your build tree... Even if it's empty
 because you don't submit to a CDash server, the presence of
 CTestConfig.cmake in your top level source tree should suppress this
 error message.


 HTH,
 David C.



 On Fri, Jan 30, 2015 at 1:07 PM, Robert Dailey rcdailey.li...@gmail.com 
 wrote:
 I run ctest on my build server *just* to run the test executables and
 get result XML. I use a separate tool to parse the XML and upload it
 to an unrelated server (not CDash)

 I get errors like below:

 Cannot find file: /sourcerepo/build/DartConfiguration.tcl

 Can someone explain what CTest is doing and if there is a way to turn it 
 off?
 --

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

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 can I make CTest not do dart-related stuff?

2015-01-30 Thread Robert Dailey
David,

I added a CTestConfig.cmake right next to the root CMakeLists.txt and
it's empty except for a comment. I get the following output:

===
[189/189] Linking CXX executable output/bin/Test_UI_String
Cannot find file:
/home/fe/atlassian/bamboo_builds/131076/FE-MP88-UT/build/DartConfiguration.tcl
   Site:
   Build name: (empty)
Create new tag: 20150130-2000 - Experimental
Cannot find file:
/home/fe/atlassian/bamboo_builds/131076/FE-MP88-UT/build/DartConfiguration.tcl
Test project /home/fe/atlassian/bamboo_builds/131076/FE-MP88-UT/build
Start 1: Test_UI_List
Start 2: Test_UI_String
1/2 Test #1: Test_UI_List .   Passed0.03 sec
2/2 Test #2: Test_UI_String ...   Passed0.03 sec

100% tests passed, 0 tests failed out of 2

Total Test time (real) =   0.04 sec
===

It still says it can't find the dart files. Do I need to include the
CTestConfig.cmake file somewhere?

here is the build script my Bamboo server is using:

===
set -e

export CC=clang
export CXX=clang++
NINJA=${bamboo.capability.system.builder.command.Ninja}
TRUE_COMMAND=${bamboo.capability.system.builder.command.true}

cmake ../frontend -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MAKE_PROGRAM=$NINJA \

# This builds all tests + dependencies
$NINJA all_tests || { echo Build Failure; exit 1; }

# Test against /usr/bin/true so that test failures don't
# cause build failures.
ctest -T Test -j 16 --output-on-failure || eval $TRUE_COMMAND
===

On Fri, Jan 30, 2015 at 1:47 PM, David Cole dlrd...@aol.com wrote:
 Do you have a CTestConfig.cmake file in your source tree?

 If you do, then ctest will load that instead of looking for the
 DartConfiguration.tcl file in your build tree... Even if it's empty
 because you don't submit to a CDash server, the presence of
 CTestConfig.cmake in your top level source tree should suppress this
 error message.


 HTH,
 David C.



 On Fri, Jan 30, 2015 at 1:07 PM, Robert Dailey rcdailey.li...@gmail.com 
 wrote:
 I run ctest on my build server *just* to run the test executables and
 get result XML. I use a separate tool to parse the XML and upload it
 to an unrelated server (not CDash)

 I get errors like below:

 Cannot find file: /sourcerepo/build/DartConfiguration.tcl

 Can someone explain what CTest is doing and if there is a way to turn it off?
 --

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

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


[CMake] How can I make CTest not do dart-related stuff?

2015-01-30 Thread Robert Dailey
I run ctest on my build server *just* to run the test executables and
get result XML. I use a separate tool to parse the XML and upload it
to an unrelated server (not CDash)

I get errors like below:

Cannot find file: /sourcerepo/build/DartConfiguration.tcl

Can someone explain what CTest is doing and if there is a way to turn it off?
-- 

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 Eclipse Resource Filters

2015-01-29 Thread Robert Dailey
Submitted here:
http://public.kitware.com/Bug/view.php?id=15382

Thanks.

On Wed, Jan 28, 2015 at 3:55 PM, Alexander Neundorf
a.neundorf-w...@gmx.net wrote:
 On Wednesday, January 28, 2015 12:56:24 Robert Dailey wrote:
 Hello,

 I generate my project using Eclipse CDT4 - Ninja. I have a
 subdirectory called Third Party under my source directory that
 contains boost, QT, and a number of other very large libraries. I
 notice that the C++ indexer in Eclipse processes files in these
 directories and frequently locks up my machine or crashes. Indexing
 takes up to 30 minutes if it decides to complete.

 Is there a way I can specify resource filters in CMake scripts? If I
 can do this, I can tell Eclipse to ignore the directories I don't want
 it to scan or care about.

 no, there's currently not.
 Please enter a ticket on http://public.kitware.com/Bug

 Thanks
 Alex
 --

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

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] CTest + Catch Framework

2015-01-28 Thread Robert Dailey
@David

I agree with your point about unit test initialization. Perhaps
instead of running a test multiple times, we can inspect the output of
a test that is run 1 time and assuming it spits out success/failure
details for individual test cases, we can simply parse that output
into appropriate CText XML so that it appears as if it was instead run
once for each test case?

I'm being fairly abstract here as I'm not sure of the implementation
details of CTest or if this is even possible. But it's a thought. Let
me know what you think.

On Wed, Jan 28, 2015 at 6:43 AM, David Cole dlrd...@aol.com wrote:
 I have two more suggestions for whoever takes on this work.

 One: add a new CMake command add_unit_test_container (or
 add_unit_tester or a better name ... ?) which names the DLL or
 executable file containing the unit tests. Give it properties to
 indicate how to extract a list of tests from it (perhaps just a type
 that maps to internal code that knows how to do this for each
 type...), and how to run *all* the tests, and how to run an individual
 test by name.

 Two: consider performance, both of running all the unit tests and of
 submitting/processing results on CDash, ... frequently, some unit test
 containers involve expensive setup and teardown, and that's why it's
 a good thing to have many tests in one container -- so the slow stuff
 only has to run once for 100 tests... (or more!)

 Unless you really really need this functionality, you might want to
 test out CDash first to make sure it can handle the number of tests
 you want to send it. Done properly, unit tests will test every single
 C++ method in your code... If VTK were to do that, there would be
 **tens of thousands** of test results being sent to CDash for each row
 on the dashboard.

 OK, and [Three:], make it a goal to add support for all of the
 following (and make it easily extensible for more):

 - gtest
 - cppunit
 - Catch
 - Boost.Test
 - Microsoft::VisualStudio::CppUnitTestFramework

 I am currently involved with a project where we're using
 Microsoft::VisualStudio::CppUnitTestFramework for unit tests, and we
 run vstest.console.exe to run all the unit tests at once for each
 library we test. Then we submit to a CDash dashboard as
 Release.UnitTests.LibraryName and Debug.UnitTests.LibraryName --
 if a single test fails, you just have to inspect the output and read
 which test failed.

 Unit tests, in general, should run nearly instantaneously, and ALL
 your developers should run them and verify passing unit tests before
 every push to the repo. If they're not doing that already, then new
 ctest features ain't gonna help you...


 Cheers,
 David C.

 On Wed, Jan 28, 2015 at 4:19 AM, Nils Gladitz nilsglad...@gmail.com wrote:
 On 28.01.2015 01:38, Robert Dailey wrote:

 I suspect that per David's suggestion, CTest would essentially do what
 you're doing but in a more thorough manner (based on the test
 framework used). So essentially CTest will need:

 - A new command line parameter that specifies the test framework
 - Functionality to parse the contents of source files provided to the
 target the test is assigned to

 I'll try to look into this when I can. David, if you have more
 specific requirements or pointers please do share them here. Thanks
 for the input everyone.


 CMake generates CTestTestfile.cmake files which contain the code that
 defines tests during execution of ctest itself.

 Those CTestTestfile.cmake files could use execute_process() to query test
 binaries for their contained tests and then add tests appropriately.
 With that approach there would be no need to parse source files.

 This can already be done in a hackish way by using the TEST_INCLUDE_FILE[1]
 directory property.
 file(GENERATE) can be used to create per-test-binary/per-configuration
 snippets with executable locations ($TARGET_FILE) which then can be
 globbed for and included by CTestTestfile.cmake.

 I would still opt for implementing support for this in cmake itself though
 since the entire logic could be contained in the generated
 CTestTestfile.cmakes.
 Perhaps with a couple of properties that would define how to e.g. query the
 list of tests and the required parameter to run a specific test; that way it
 could be made to work irregardless of which test framework is being used.

 Nils

 [1] http://www.cmake.org/cmake/help/v3.1/prop_dir/TEST_INCLUDE_FILE.html

 --

 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

[CMake] CMake Eclipse Resource Filters

2015-01-28 Thread Robert Dailey
Hello,

I generate my project using Eclipse CDT4 - Ninja. I have a
subdirectory called Third Party under my source directory that
contains boost, QT, and a number of other very large libraries. I
notice that the C++ indexer in Eclipse processes files in these
directories and frequently locks up my machine or crashes. Indexing
takes up to 30 minutes if it decides to complete.

Is there a way I can specify resource filters in CMake scripts? If I
can do this, I can tell Eclipse to ignore the directories I don't want
it to scan or care about.

Thanks in advance. Using CMake v3.1
-- 

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] CTest + Catch Framework

2015-01-27 Thread Robert Dailey
I suspect that per David's suggestion, CTest would essentially do what
you're doing but in a more thorough manner (based on the test
framework used). So essentially CTest will need:

- A new command line parameter that specifies the test framework
- Functionality to parse the contents of source files provided to the
target the test is assigned to

I'll try to look into this when I can. David, if you have more
specific requirements or pointers please do share them here. Thanks
for the input everyone.

On Tue, Jan 27, 2015 at 5:08 PM, Fraser Hutchison
fraser.hutchi...@gmail.com wrote:
 We've run into this exact chicken and egg problem with both gtest and Catch
 at my work too.  In both cases, we've worked round the problem by writing
 fairly fragile CMake code which parses the C++ files comprising a test
 executable and ultimately calling add_test for each discovered test case.

 gtest is harder to handle than Catch in that it provides macros for handling
 value-parameterised and type-parameterised tests.  It would be great if
 CTest were able to handle these popular test libraries automatically.  I'm
 really short of time of the moment, but if there are any pointers from
 experts on how this might be best handled by CTest, I could perhaps start to
 have a poke about if there are no other takers?

 In the meantime, here's a link to our Catch-handling code:
 https://github.com/Fraser999/MaidSafe/blob/846ce37c23bd86ee261e439919dfd7000a8f9372/cmake_modules/add_catch_tests.cmake

 The file's commented at the top.  It probably doesn't cover all Catch
 macros, and I'd be amazed if it handled all C++ coding styles properly, but
 it worked fairly reliably for us.  We don't use Catch any more, so I'm not
 even sure if it works with the current version of Catch.  For comparison (of
 the complexity) here's our gtest equivalent:
 https://github.com/Fraser999/MaidSafe/blob/72af3a0def2f03af7320696f5ea3d241c5af9bdc/cmake_modules/add_gtests.cmake
 (it's old code and could be made more efficient I'm sure - but again it
 works fine for us).

 Cheers,
 Fraser.



 On 27/01/2015 17:14, David Cole via CMake wrote:

 The best thing to do would be to make CTest aware of unit test
 frameworks like this, and have it be automatic.

 Support for cppunit, gtest and Catch (and any other popular ones)
 would all be appreciated by many, I'm sure.

 Got time to dig into ctest a little bit?


 D



 On Tue, Jan 27, 2015 at 11:18 AM, Robert Dailey
 rcdailey.li...@gmail.com wrote:

 I wouldn't say this is an artificial problem. let me go into more detail.

 A single test can define any number of test cases. These are unknown
 to CMake scripts, as they are written and defined in code. The ideal
 solution is to have the test program output a list of all test cases
 and based on that list, automatically generate the add_test commands.
 That way I don't have to worry about hard-coding test case names in
 the build scripts. When a new test case is added to the test code (no
 new files would be added), magically a new unit test appears to
 CMake.

 But none of this can be done unless the unit test executables are
 built. Thus the chicken and egg problem. To do it as you suggest would
 require me to hard-code the test cases. Example:

 In MyTest.cpp:

 #include catch.hpp
 TEST_CASE(test1) {}
 TEST_CASE(test2) {}

 In CMakeLists.txt:

 add_executable( MyTest MyTest.cpp )
 add_test( NAME MyTest_test1 COMMAND test1 )
 add_test( NAME MyTest_test2 COMMAND test2 )

 Am I correctly understanding what you have in mind? If so, can you
 think of a way to automate this a little better?

 On Tue, Jan 27, 2015 at 7:18 AM, David Cole dlrd...@aol.com wrote:

 It's only a chicken and egg problem if you constrain yourself
 artificially.

 When you define a new unit test source file, there are two things you
 need to do:
 (1) add it to its executable
 (2) write an add_test line that invokes that specific unit test

 You could possibly encapsulate those actions into an add_unit_test
 macro so that it only seems like you have one thing to do, but
 certainly, it's possible.

 You must be doing #1 already, so you just have to make sure #2 always
 happens whenever #1 happens.

 Both eggs.


 D




 On Mon, Jan 26, 2015 at 4:05 PM, Robert Dailey
 rcdailey.li...@gmail.com wrote:

 I believe so, but then you run into the chicken and egg problem:

 I need to fully build all unit tests in order to know all the test
 cases, but I need to define the tests at the generation phase (before
 build).

 I'm just not sure how to handle this. The best i can think of is to
 generate 1 test executable per CPP file that we write in our unit
 tests (generally 1 CPP file per class that is unit tested). Any ideas?

 On Mon, Jan 26, 2015 at 10:05 AM, David Cole dlrd...@aol.com wrote:

 Can you run a command that executes one test case at a time, or do you
 have to run all 50 when you execute the tests for a library?

 ctest just runs whatever you give it with add_test -- if you want

Re: [CMake] CTest + Catch Framework

2015-01-27 Thread Robert Dailey
I wouldn't say this is an artificial problem. let me go into more detail.

A single test can define any number of test cases. These are unknown
to CMake scripts, as they are written and defined in code. The ideal
solution is to have the test program output a list of all test cases
and based on that list, automatically generate the add_test commands.
That way I don't have to worry about hard-coding test case names in
the build scripts. When a new test case is added to the test code (no
new files would be added), magically a new unit test appears to
CMake.

But none of this can be done unless the unit test executables are
built. Thus the chicken and egg problem. To do it as you suggest would
require me to hard-code the test cases. Example:

In MyTest.cpp:

#include catch.hpp
TEST_CASE(test1) {}
TEST_CASE(test2) {}

In CMakeLists.txt:

add_executable( MyTest MyTest.cpp )
add_test( NAME MyTest_test1 COMMAND test1 )
add_test( NAME MyTest_test2 COMMAND test2 )

Am I correctly understanding what you have in mind? If so, can you
think of a way to automate this a little better?

On Tue, Jan 27, 2015 at 7:18 AM, David Cole dlrd...@aol.com wrote:
 It's only a chicken and egg problem if you constrain yourself artificially.

 When you define a new unit test source file, there are two things you
 need to do:
 (1) add it to its executable
 (2) write an add_test line that invokes that specific unit test

 You could possibly encapsulate those actions into an add_unit_test
 macro so that it only seems like you have one thing to do, but
 certainly, it's possible.

 You must be doing #1 already, so you just have to make sure #2 always
 happens whenever #1 happens.

 Both eggs.


 D




 On Mon, Jan 26, 2015 at 4:05 PM, Robert Dailey rcdailey.li...@gmail.com 
 wrote:
 I believe so, but then you run into the chicken and egg problem:

 I need to fully build all unit tests in order to know all the test
 cases, but I need to define the tests at the generation phase (before
 build).

 I'm just not sure how to handle this. The best i can think of is to
 generate 1 test executable per CPP file that we write in our unit
 tests (generally 1 CPP file per class that is unit tested). Any ideas?

 On Mon, Jan 26, 2015 at 10:05 AM, David Cole dlrd...@aol.com wrote:
 Can you run a command that executes one test case at a time, or do you
 have to run all 50 when you execute the tests for a library?

 ctest just runs whatever you give it with add_test -- if you want to
 filter a collection of unit tests to run only a single unit test, then
 the unit test framework you're using would have to support that. Does
 Catch allow you to run the tests individually?



 On Mon, Jan 26, 2015 at 12:30 AM, Robert Dailey
 rcdailey.li...@gmail.com wrote:
 Hi,

 I'm using Catch as my unit test framework:
 https://github.com/philsquared/Catch

 Is it possible for CTest to report each TEST_CASE block as an
 individual test? My understanding is that CTest will only treat each
 executable as a test. However, my test structure is as follows:

 1 library
 1 test project

 Each test project has 1 test CPP file per each class in the library.
 This way I implement tests for classes in a corresponding CPP file.

 Each CPP file contains multiple test cases (defined by TEST_CASE macro).

 The resulting output of `ctest -T Test` shows only 1 test, even though
 that may be around 50 test cases. I'd like CMake to show the pass/fail
 status of each one. Is this possible?
 --

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

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] CTest + Catch Framework

2015-01-26 Thread Robert Dailey
I believe so, but then you run into the chicken and egg problem:

I need to fully build all unit tests in order to know all the test
cases, but I need to define the tests at the generation phase (before
build).

I'm just not sure how to handle this. The best i can think of is to
generate 1 test executable per CPP file that we write in our unit
tests (generally 1 CPP file per class that is unit tested). Any ideas?

On Mon, Jan 26, 2015 at 10:05 AM, David Cole dlrd...@aol.com wrote:
 Can you run a command that executes one test case at a time, or do you
 have to run all 50 when you execute the tests for a library?

 ctest just runs whatever you give it with add_test -- if you want to
 filter a collection of unit tests to run only a single unit test, then
 the unit test framework you're using would have to support that. Does
 Catch allow you to run the tests individually?



 On Mon, Jan 26, 2015 at 12:30 AM, Robert Dailey
 rcdailey.li...@gmail.com wrote:
 Hi,

 I'm using Catch as my unit test framework:
 https://github.com/philsquared/Catch

 Is it possible for CTest to report each TEST_CASE block as an
 individual test? My understanding is that CTest will only treat each
 executable as a test. However, my test structure is as follows:

 1 library
 1 test project

 Each test project has 1 test CPP file per each class in the library.
 This way I implement tests for classes in a corresponding CPP file.

 Each CPP file contains multiple test cases (defined by TEST_CASE macro).

 The resulting output of `ctest -T Test` shows only 1 test, even though
 that may be around 50 test cases. I'd like CMake to show the pass/fail
 status of each one. Is this possible?
 --

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

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


[CMake] Eclipse build project does nothing

2015-01-25 Thread Robert Dailey
I'm generating for Eclipse CDT4 - Ninja. When a build fails because of
compiler errors or whatnot, Build project does absolutely nothing
unless I change a CPP file and save it, then the build works.

Is this a CMake issue or Eclipse setting? Help is appreciated.
-- 

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


[CMake] CTest + Catch Framework

2015-01-25 Thread Robert Dailey
Hi,

I'm using Catch as my unit test framework:
https://github.com/philsquared/Catch

Is it possible for CTest to report each TEST_CASE block as an
individual test? My understanding is that CTest will only treat each
executable as a test. However, my test structure is as follows:

1 library
1 test project

Each test project has 1 test CPP file per each class in the library.
This way I implement tests for classes in a corresponding CPP file.

Each CPP file contains multiple test cases (defined by TEST_CASE macro).

The resulting output of `ctest -T Test` shows only 1 test, even though
that may be around 50 test cases. I'd like CMake to show the pass/fail
status of each one. Is this possible?
-- 

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] Specify 32-bit compilation to Clang

2015-01-21 Thread Robert Dailey
Thanks for your help so far. Your 3rd command produced the output
below. I'll keep looking into this but just wanted to share. I'm not
sure why it isn't working, and I'm not completely familiar with linux
development so it will take me a while to figure this out.

robert@robert-OptiPlex-745 ~ $ clang++ -m32 -Wl,--verbose test.cpp|grep libgcc
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so when searching
for -lstdc++
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a when searching
for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching
for -lgcc_s
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so succeeded
/usr/bin/ld: cannot find -lgcc_s
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.a failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc_s.so
failed
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for
-lgcc
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc_s.a
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc_s.so
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc_s.a
failed
/usr/bin/ldattempt to open /usr/bin/../lib/i386-linux-gnu/libgcc_s.so failed
: cannot find -lgcc
attempt to open /usr/bin/../lib/i386-linux-gnu/libgcc_s.a failed
attempt to open /usr/bin/../lib32/libgcc_s.so failed
attempt to open /usr/bin/../lib32/libgcc_s.a failed
attempt to open /lib/i386-linux-gnu/libgcc_s.so failed
attempt to open /lib/i386-linux-gnu/libgcc_s.a failed
attempt to open /lib/../lib32/libgcc_s.so failed
attempt to open /lib/../lib32/libgcc_s.a failed
attempt to open /usr/lib/i386-linux-gnu/libgcc_s.so failed
attempt to open /usr/lib/i386-linux-gnu/libgcc_s.a failed
attempt to open /usr/lib/../lib32/libgcc_s.so failed
attempt to open /usr/lib/../lib32/libgcc_s.a failed
attempt to open /usr/lib/x86_64-linux-gnu/../../lib32/libgcc_s.so failed
attempt to open /usr/lib/x86_64-linux-gnu/../../lib32/libgcc_s.a failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libgcc_s.so failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libgcc_s.a failed
attempt to open /usr/bin/../lib/libgcc_s.so failed
attempt to open /usr/bin/../lib/libgcc_s.a failed
attempt to open /lib/libgcc_s.so failed
attempt to open /lib/libgcc_s.a failed
attempt to open /usr/lib/libgcc_s.so failed
attempt to open /usr/lib/libgcc_s.a failed
attempt to open /usr/i386-linux-gnu/lib32/libgcc_s.so failed
attempt to open /usr/i386-linux-gnu/lib32/libgcc_s.a failed
attempt to open /usr/x86_64-linux-gnu/lib32/libgcc_s.so failed
attempt to open /usr/x86_64-linux-gnu/lib32/libgcc_s.a failed
attempt to open //usr/local/lib/i386-linux-gnu/libgcc_s.so failed
attempt to open //usr/local/lib/i386-linux-gnu/libgcc_s.a failed
attempt to open //usr/local/lib32/libgcc_s.so failed
attempt to open //usr/local/lib32/libgcc_s.a failed
attempt to open //lib/i386-linux-gnu/libgcc_s.so failed
attempt to open //lib/i386-linux-gnu/libgcc_s.a failed
attempt to open //lib32/libgcc_s.so failed
attempt to open //lib32/libgcc_s.a failed
attempt to open //usr/lib/i386-linux-gnu/libgcc_s.so failed
attempt to open //usr/lib/i386-linux-gnu/libgcc_s.a failed
attempt to open //usr/lib32/libgcc_s.so failed
attempt to open //usr/lib32/libgcc_s.a failed
attempt to open //usr/local/lib/libgcc_s.so failed
attempt to open //usr/local/lib/libgcc_s.a failed
attempt to open //lib/libgcc_s.so failed
attempt to open //lib/libgcc_s.a failed
attempt to open //usr/lib/libgcc_s.so failed
attempt to open //usr/lib/libgcc_s.a failed
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.so failed
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a succeeded
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc.so
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc.a
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc.so
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc.a
failed
attempt to open /usr/bin/../lib/i386-linux-gnu/libgcc.so failed
attempt to open /usr/bin/../lib/i386-linux-gnu/libgcc.a failed
attempt to open /usr/bin/../lib32/libgcc.so failed
attempt to open /usr/bin/../lib32/libgcc.a failed
attempt to open /lib/i386-linux-gnu/libgcc.so failed
attempt to open /lib/i386-linux-gnu/libgcc.a failed
attempt to open /lib/../lib32/libgcc.so failed
attempt to open /lib/../lib32/libgcc.a failed
attempt to open /usr/lib/i386-linux-gnu/libgcc.so failed
attempt to open /usr/lib/i386-linux-gnu/libgcc.a failed
attempt to open /usr/lib/../lib32/libgcc.so failed
attempt to open 

Re: [CMake] Specify 32-bit compilation to Clang

2015-01-20 Thread Robert Dailey
On Mon, Jan 19, 2015 at 2:12 PM, Nils Gladitz nilsglad...@gmail.com wrote:
 On 19.01.2015 21:08, Robert Dailey wrote:

 I have done this and it fails while linking the test program during
 configuration:

 /usr/bin/ld: cannot find crtbegin.o: no such file or directory
 /usr/bin/ld: cannot find -lgcc
 /usr/bin/ld: cannot find -lgcc_s

 Any ideas?


 Try installing the g++-multilib package.

Installed this as you instructed, deleted CMakeCache.txt and re-ran
generation. Got the errors below:

-- The C compiler identification is Clang 3.5.0
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake:61
(message  ):
  The C compiler /usr/bin/clang is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /home/robert/frontend_build/CMakeFiles/CMakeTmp



  Run Build Command:/home/robert/ninja/ninja cmTryCompileExec2104404287

  [1/2] Building C object
  CMakeFiles/cmTryCompileExec2104404287.dir/testCCompiler.c.o

  [2/2] Linking C executable cmTryCompileExec2104404287

  FAILED: :  /usr/bin/clang -m32
  CMakeFiles/cmTryCompileExec2104404287.dir/testCCompiler.c.o -o
  cmTryCompileExec2104404287 -rdynamic  :

  /usr/bin/ld: skipping incompatible
  /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc

  /usr/bin/ld: cannot find -lgcc

  /usr/bin/ld: skipping incompatible
  /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
  -lgcc_s

  /usr/bin/ld: cannot find -lgcc_s

  clang: error: linker command failed with exit code 1 (use -v to see
  invocation)

  ninja: build stopped: subcommand failed.
-- 

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] Specify 32-bit compilation to Clang

2015-01-20 Thread Robert Dailey
On Tue, Jan 20, 2015 at 9:58 AM, Nils Gladitz nilsglad...@gmail.com wrote:
 On 01/20/2015 04:48 PM, Robert Dailey wrote:

 On Mon, Jan 19, 2015 at 2:12 PM, Nils Gladitz nilsglad...@gmail.com
 wrote:

 On 19.01.2015 21:08, Robert Dailey wrote:


 I have done this and it fails while linking the test program during
 configuration:

 /usr/bin/ld: cannot find crtbegin.o: no such file or directory
 /usr/bin/ld: cannot find -lgcc
 /usr/bin/ld: cannot find -lgcc_s

 Any ideas?


 Try installing the g++-multilib package.


 Installed this as you instructed, deleted CMakeCache.txt and re-ran
 generation. Got the errors below:




/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for
 -lgcc


 From the diagnostic it looks like clang shares gcc 4.8's libraries.

 Is the system wide default gcc 4.8 as well?
 e.g. does gcc --version report 4.8.x?

 If it isn't installing g++-4.8-multilib might help (If 4.8 is the default
 g++-multilib will already have installed it).

Here are the results:

robert@robert-VirtualBox ~ $ gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

robert@robert-VirtualBox ~ $ sudo apt-get install g++-4.8-multilib
[sudo] password for robert:
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++-4.8-multilib is already the newest version.
g++-4.8-multilib set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 172 not upgraded.
-- 

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


[CMake] Specify 32-bit compilation to Clang

2015-01-19 Thread Robert Dailey
I'm running CMake 3.1 on Mint 64-bit OS. I need to generate an Eclipse
project using Ninja that uses Clang to build a 32-bit application.

When I do this:

add_definitions(-m32)

For some reason my code is not able to include STL headers (files not
found). Any reason for this? Is there a more proper way to specify
32-bit compilation so STL include paths are set?
-- 

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


[CMake] List of compile features from command line?

2015-01-17 Thread Robert Dailey
Can I use cmake to spit out a list of supported compile features based
on my already-configured project? I'm not sure how I'm expected to get
the list of features otherwise. The documentation does not explain
this.
-- 

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


[CMake] Clang not using C++11 on Linux

2015-01-17 Thread Robert Dailey
I'm running a custom built CMake 3.1 on Ubuntu Server 12. I have Clang
3.4 installed. At the top of my root CMakeLists.txt, I have enabled
C++11 like so:

cmake_minimum_required( VERSION 3.1 )
if( UNIX )
set( CMAKE_CXX_FLAGS -std=c++11 -stdlib=libc++ )
endif()
project( FrontEnd )

However when I build, it fails:

fe@BLD01:~/frontend/build$ make
[  0%] Copying third party binaries
[  0%] Built target copy_dlls
[  0%] Building CXX object
Core/UI/CMakeFiles/UI.dir/Source/Animations/AnimationManager.cpp.o
In file included from
/home/fe/frontend/Core/UI/Source/Animations/AnimationManager.cpp:27:
In file included from /home/fe/frontend/Core/UI/Source/Main/stdinc.h:292:
In file included from /home/fe/frontend/Core/UI/Source/Logs/ErrorLog.h:18:
/home/fe/frontend/Core/UI/Source/Logs/LogLevels.h:18:9: warning:
scoped enumerations are a C++11 extension [-Wc++11-extensions]

How do I get C++11 working?
-- 

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


[CMake] C# project integration with CMake 3.1

2015-01-15 Thread Robert Dailey
I have a managed C++ (CLI) project that I build using CMake. I have
another C# project (Visual Studio 2013) that I maintain outside of
CMake that needs to reference the managed C++ DLL output by CMake.
What is the best approach for this?

The C# project is technically a completely separate product (tool) and
wouldn't be in the same solution with the CMake projects.

I've read that the C# project can be setup for use with
configure_file() and then output somewhere in the binary dir. However,
updates to the project (settings modifications through VIsual Studio,
and adding C# files) would be lost, as they would not affect the
original file that was used by configure_file(). If configure_file()
is the best option, how do I overcome the issue of updating the visual
studio project? Might not matter anyway since this will require the C#
project to be accessible to CMake which it may not be in the future
(once the Tool is moved into its own Git repository as a separate
product, which will happen soon).

I've also thought of creating an install project for the managed C++
project. This would definitely allow the tool to be disconnected, but
how do I create a predictable install path for the C# project? Each
developer may have their own drive letters on Windows, or maybe set
CMAKE_INSTALL_PREFIX to something other than Program Files.

Any advice is greatly appreciated. I'm pretty much blocked on this.
-- 

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] Removing compiler options

2014-12-16 Thread Robert Dailey
I still really need help with this. It's a blocker at this point for
me. Help is greatly appreciated; thanks in advance.

On Sun, Nov 9, 2014 at 10:02 PM, Robert Dailey rcdailey.li...@gmail.com wrote:
 When setting up a CLR project through CMake, it becomes important to
 be able to *remove* compiler options at the project level. For
 example, the following need to be removed (MSVC12):

 /RTC1
 /EHsc

 There is no remove_compile_options() (which would be convenient).
 Any reason why this doesn't exist?

 Right now I'm trying to remove these via CMAKE_CXX_FLAGS locally but
 this doesn't work unless I forcefully change the cache. But this is a
 permanent operation that affects *all* projects, which I do not want.
 This is crazy, I'm hoping there is a better way. I'm using CMake 3.1
 RC1. Can anyone help me figure out how to remove compiler options on a
 per-project basis?

 Here is what I'm doing:

 function( add_clr_library target_name references )
 set( source_files ${ARGN} )

 set( default_references
 System
 System.Core
 System.Data
 System.Drawing
 #System.Xml
 #WindowsBase
 )

 if( CMAKE_CXX_FLAGS_DEBUG MATCHES /RTC1 )
 string( REGEX REPLACE /RTC(su|[1su]) 
 CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
 endif()

 if( CMAKE_CXX_FLAGS MATCHES /EHsc )
 string( REPLACE /EHsc  CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
 endif()

 add_library( ${target_name} SHARED ${source_files} )

 list( APPEND references ${default_references} )

 set_target_properties( ${target_name} PROPERTIES
 VS_DOTNET_REFERENCES ${references}
 VS_DOTNET_TARGET_FRAMEWORK_VERSION v4.5
 COMPILE_FLAGS /clr /EHa
 DEBUG_POSTFIX d
 )
 endfunction()
-- 

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


[CMake] Removing compiler options

2014-11-09 Thread Robert Dailey
When setting up a CLR project through CMake, it becomes important to
be able to *remove* compiler options at the project level. For
example, the following need to be removed (MSVC12):

/RTC1
/EHsc

There is no remove_compile_options() (which would be convenient).
Any reason why this doesn't exist?

Right now I'm trying to remove these via CMAKE_CXX_FLAGS locally but
this doesn't work unless I forcefully change the cache. But this is a
permanent operation that affects *all* projects, which I do not want.
This is crazy, I'm hoping there is a better way. I'm using CMake 3.1
RC1. Can anyone help me figure out how to remove compiler options on a
per-project basis?

Here is what I'm doing:

function( add_clr_library target_name references )
set( source_files ${ARGN} )

set( default_references
System
System.Core
System.Data
System.Drawing
#System.Xml
#WindowsBase
)

if( CMAKE_CXX_FLAGS_DEBUG MATCHES /RTC1 )
string( REGEX REPLACE /RTC(su|[1su]) 
CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
endif()

if( CMAKE_CXX_FLAGS MATCHES /EHsc )
string( REPLACE /EHsc  CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
endif()

add_library( ${target_name} SHARED ${source_files} )

list( APPEND references ${default_references} )

set_target_properties( ${target_name} PROPERTIES
VS_DOTNET_REFERENCES ${references}
VS_DOTNET_TARGET_FRAMEWORK_VERSION v4.5
COMPILE_FLAGS /clr /EHa
DEBUG_POSTFIX d
)
endfunction()
-- 

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] Copying DLLs to output directory

2014-11-01 Thread Robert Dailey
I've solved the problem that way in the past.

What you do is copy the .user file and make the environment setup
driven by configure_file() in CMake. That way at CMake configure time
you can create a .user file for each .VCPROJ that has PATH setup to
point to third party BIN directories as needed. These will work when
you debug.

However, this only benefits visual studio. If I use nmake on Windows
or want to use some other IDE on Windows, these methods won't work but
copying the DLL there will always work. It has added benefits:

1. You can run the executable from the output directory
2. You can zip up the output directory to send adhoc builds to other people.


On Sat, Nov 1, 2014 at 8:54 AM, Michael Jackson
mike.jack...@bluequartz.net wrote:
 The thing I could never figure out is how to set the PATH for the Visual 
 Studio Project/Solution. That is what I need. If I only had a single version 
 of Qt on my system it would be very straight forward. Just set the PATH 
 environment variable using the standard windows mechanism for doing that and 
 you are set. Alas, that isn't the case. I have at least 4 different versions 
 of Qt on my system at any one time. So tell me how to, in the CMake file, to 
 tell the Visual Studio generated solution to add 
 C:/Developer/x64/Qt-4.8.6/bin to my PATH and I would gladly rip out all my 
 code. I also need a mechanism to install all those DLL's into an 
 redistributable package (which my scripts ensure). Maybe I am just that far 
 behind the times. One of those if it aint broke don't fix it.

 Looking forward to the answer
 Mike Jackson

 On Oct 31, 2014, at 3:51 PM, Bill Somerville b...@classdesign.com wrote:

 On 31/10/2014 19:42, Michael Jackson wrote:
 Never said it was pretty, but here is the code I use for Qt4 based 
 projects. I think I had to revamp a lot of this for Qt5. I call it like so:

 CMP_COPY_QT4_RUNTIME_LIBRARIES( QtCore;QtGui;QtNetwork)
 This seems an awful lot of messing around when qt-project.org already dump 
 all the debug and release libraries into the installation bin directory so 
 all you need is to ensure that the installation bin directory is on your 
 PATH when you run or debug executables, just like you have to to build using 
 the tools like moc, qmake, dumpcpp, qrc, etc..

 IMHO put he Qt bin directory on PATH for debugging and use BundleUtils 
 FixupBundle to make deployable kits. No need to do any manual or scripted 
 copying of libraries at all.

 Regards
 Bill.
 --

 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

 --

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

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] Copying DLLs to output directory

2014-10-31 Thread Robert Dailey
I like this idea but it doesn't seem like it will work for targets
with multiple DLLs... for example boost. It has several DLLs. I don't
want to define 1 target for each DLL either. Sometimes that doesn't
make sense.

On Wed, Oct 29, 2014 at 10:45 AM, Hendrk Sattler
p...@hendrik-sattler.de wrote:
 Am 2014-10-28 18:25, schrieb Robert Dailey:

 I have a third party library like OpenSSL prebuilt for each platform
 and in my own structure in version control. I have a CMake script that
 creates an INTERFACE library target for it. I setup the include
 directories and link targets. However, I don't see a way to configure
 DLLs in the interface library target. How would you do this, and what
 would CMake do to these targets to make sure they are copied to the
 output directory of the executable I run from Visual Studio for
 debugging?


 I have this for ZLib:
 if ( ZLIB_FOUND )
   if ( WIN32 )
 get_filename_component( ZLIB_LIBDIR ${ZLIB_LIBRARY} PATH )
 get_filename_component ( ZLIB_BASENAME ${ZLIB_LIBRARY} NAME_WE )
 get_filename_component ( ZLIB_LIBDIR_BASE ${ZLIB_LIBDIR} PATH )
 find_file ( ZLIB_DLL
 ${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
   HINTS
 ${ZLIB_LIBDIR_BASE}
   PATH_SUFFIXES
 bin
   NO_DEFAULT_PATH
 )
 mark_as_advanced ( ZLIB_DLL )
 if ( ZLIB_DLL )
   add_library ( zlib SHARED IMPORTED GLOBAL )
   set_property ( TARGET zlib PROPERTY IMPORTED_IMPLIB ${ZLIB_LIBRARY}
 )
   set_property ( TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_DLL} )
 else ( ZLIB_DLL )
   add_library ( zlib STATIC IMPORTED GLOBAL )
   set_property ( TARGET zlib PROPERTY IMPORTED_LOCATION
 ${ZLIB_LIBRARY} )
 endif ( ZLIB_DLL )
   else( WIN32 )
 add_library ( zlib UNKNOWN IMPORTED GLOBAL )
 set_property ( TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARY}
 )
   endif( WIN32 )
   set_property ( TARGET zlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES
 ${ZLIB_INCLUDE_DIR}
   )

   set ( ZLIB_LIBRARIES zlib )
   set ( ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} )
 endif ( ZLIB_FOUND )

 The .lib goes into IMPORTED_IMPLIB and the .dll goes into IMPORTED_LOCATION.
 The way to find the .dll from the location of the .lib might differ for
 different libraries.
 For ZLib, the base name is the same.

 Later, you can use this imported target:
   add_custom_command ( TARGET myTarget POST_BUILD
 COMMAND ${CMAKE_COMMAND} -E copy_if_different $TARGET_FILE:zlib
 $TARGET_FILE_DIR:myTarget
   )
 Now, zlib.dll is in the same directory as myTarget.dll.

 HS

 On Tue, Oct 28, 2014 at 12:21 AM, Hendrik Sattler
 p...@hendrik-sattler.de wrote:

 Hi,

 you can use generator expression in a post build rule to copy the dll
 file to the same target dir as the target you link it with. The easiest way
 to do this is to properly define all 3rd party libraries as imported targets
 that contains both, the lib and the dll file.
 Sadly, the FindQt4 on Windows doesn't do this and thus make life harder
 than needed. CMake configuration files should always do this right.

 OTOH, you could also write a wrapper batch file or change VS properties
 to modify PATH to include all libraries before the regular path.

 HS


 Am 28. Oktober 2014 02:55:08 MEZ, schrieb Robert Dailey
 rcdailey.li...@gmail.com:

 This actually used to be a very difficult problem to solve. However,
 to debug in visual studio it's essential.

 If I have DLLs located in third party directories OR from targets that
 I depend on, those must all be copied to the directory of the
 executable I'm debugging in order for those DLLs to be found and
 loaded.

 Using CMake 3.0.2, I hope this task is simpler, especially with the
 introduction of a nice suite of generator expressions. Can anyone
 recommend a good way to do this?


 --

 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

 --

 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

Re: [CMake] Copying DLLs to output directory

2014-10-31 Thread Robert Dailey
If it were only a matter of style / visual annoyance, I wouldn't mind.
However it complicates dependency management when you have to specify
ZZ_QT_LIB1, ZZ_QT_LIB2, etc... instead of just QT when calling
target_link_libraries().

Unless you do it differently...

On Fri, Oct 31, 2014 at 2:28 PM, Michael Jackson
mike.jack...@bluequartz.net wrote:
 It sucks, but I do that with Qt's libraries. One target for each library. I 
 prefix the target with ZZ_ so that in IDEs like Visual Studio and Xcode 
 those targets fall to the bottom of the list. I also group them in folders if 
 Visual Studio will allow it. I use the copy if different argument to the 
 CMake command for the copy. Seems to work.

 Mike Jackson

 On Oct 31, 2014, at 3:11 PM, Robert Dailey rcdailey.li...@gmail.com wrote:

 I like this idea but it doesn't seem like it will work for targets
 with multiple DLLs... for example boost. It has several DLLs. I don't
 want to define 1 target for each DLL either. Sometimes that doesn't
 make sense.

 On Wed, Oct 29, 2014 at 10:45 AM, Hendrk Sattler
 p...@hendrik-sattler.de wrote:
 Am 2014-10-28 18:25, schrieb Robert Dailey:

 I have a third party library like OpenSSL prebuilt for each platform
 and in my own structure in version control. I have a CMake script that
 creates an INTERFACE library target for it. I setup the include
 directories and link targets. However, I don't see a way to configure
 DLLs in the interface library target. How would you do this, and what
 would CMake do to these targets to make sure they are copied to the
 output directory of the executable I run from Visual Studio for
 debugging?


 I have this for ZLib:
 if ( ZLIB_FOUND )
  if ( WIN32 )
get_filename_component( ZLIB_LIBDIR ${ZLIB_LIBRARY} PATH )
get_filename_component ( ZLIB_BASENAME ${ZLIB_LIBRARY} NAME_WE )
get_filename_component ( ZLIB_LIBDIR_BASE ${ZLIB_LIBDIR} PATH )
find_file ( ZLIB_DLL
 ${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
  HINTS
${ZLIB_LIBDIR_BASE}
  PATH_SUFFIXES
bin
  NO_DEFAULT_PATH
)
mark_as_advanced ( ZLIB_DLL )
if ( ZLIB_DLL )
  add_library ( zlib SHARED IMPORTED GLOBAL )
  set_property ( TARGET zlib PROPERTY IMPORTED_IMPLIB ${ZLIB_LIBRARY}
 )
  set_property ( TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_DLL} )
else ( ZLIB_DLL )
  add_library ( zlib STATIC IMPORTED GLOBAL )
  set_property ( TARGET zlib PROPERTY IMPORTED_LOCATION
 ${ZLIB_LIBRARY} )
endif ( ZLIB_DLL )
  else( WIN32 )
add_library ( zlib UNKNOWN IMPORTED GLOBAL )
set_property ( TARGET zlib PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARY}
 )
  endif( WIN32 )
  set_property ( TARGET zlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES
${ZLIB_INCLUDE_DIR}
  )

  set ( ZLIB_LIBRARIES zlib )
  set ( ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} )
 endif ( ZLIB_FOUND )

 The .lib goes into IMPORTED_IMPLIB and the .dll goes into IMPORTED_LOCATION.
 The way to find the .dll from the location of the .lib might differ for
 different libraries.
 For ZLib, the base name is the same.

 Later, you can use this imported target:
  add_custom_command ( TARGET myTarget POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $TARGET_FILE:zlib
 $TARGET_FILE_DIR:myTarget
  )
 Now, zlib.dll is in the same directory as myTarget.dll.

 HS

 On Tue, Oct 28, 2014 at 12:21 AM, Hendrik Sattler
 p...@hendrik-sattler.de wrote:

 Hi,

 you can use generator expression in a post build rule to copy the dll
 file to the same target dir as the target you link it with. The easiest 
 way
 to do this is to properly define all 3rd party libraries as imported 
 targets
 that contains both, the lib and the dll file.
 Sadly, the FindQt4 on Windows doesn't do this and thus make life harder
 than needed. CMake configuration files should always do this right.

 OTOH, you could also write a wrapper batch file or change VS properties
 to modify PATH to include all libraries before the regular path.

 HS


 Am 28. Oktober 2014 02:55:08 MEZ, schrieb Robert Dailey
 rcdailey.li...@gmail.com:

 This actually used to be a very difficult problem to solve. However,
 to debug in visual studio it's essential.

 If I have DLLs located in third party directories OR from targets that
 I depend on, those must all be copied to the directory of the
 executable I'm debugging in order for those DLLs to be found and
 loaded.

 Using CMake 3.0.2, I hope this task is simpler, especially with the
 introduction of a nice suite of generator expressions. Can anyone
 recommend a good way to do this?


 --

 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

Re: [CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!

2014-10-30 Thread Robert Dailey
Why are quotations required for generator expressions using lists now?
Is there a technical reason for it? I think it's intuitive that it
worked without them.

It's never been clear in CMake when to use quotes or not outside of
the fact that if you're passing a parameter to a function with a space
in it, quotes will be necessary.

On Wed, Oct 29, 2014 at 3:52 PM, Daniel Schepler
dschep...@scalable-networks.com wrote:
 Thanks for the pointers, that does answer my question.  I would just set
 CXX_STANDARD to 11 and leave CXX_STANDARD_REQUIRED unset.

 --

 Daniel



 From: David Cole [mailto:dlrd...@aol.com]
 Sent: Wednesday, October 29, 2014 11:38 AM
 To: Daniel Schepler
 Cc: cmake@cmake.org


 Subject: Re: [CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!



 I think your question about CXX_STANDARD is answered in the CXX_STANDARD
 docs:

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



 If you MUST have it, you can set this property to ON:

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



 (Although I've not used it myself -- not sure what happens if the compiler
 does not support the standard. Hopefully, an error at CMake time... try it
 and let us know if it works for you.)





 HTH,

 David C.





 On Wed, Oct 29, 2014 at 2:15 PM, Daniel Schepler
 dschep...@scalable-networks.com wrote:

 (Whoops, accidentally sent this via private email before.)

 My question was about this part of the example:

 add_executable(consumer_with consumer_with.cpp)
 target_link_libraries(consumer_with foo)
 set_property(TARGET consumer_with CXX_STANDARD 11)

 add_executable(consumer_no consumer_no.cpp)
 target_link_libraries(consumer_no foo)

 The question is: how do I detect whether CXX_STANDARD 11 is available before
 running the set_property(TARGET consumer_with CXX_STANDARD 11) line?
 --
 Daniel



 -Original Message-
 From: Robert Maynard [mailto:robert.mayn...@kitware.com]
 Sent: Wednesday, October 29, 2014 10:43 AM
 To: Daniel Schepler
 Cc: CMake MailingList
 Subject: Re: [CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!

 You can find the known compile features that can be detected at:
 http://www.cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html

 At the end of the compile-features manual page (
 http://www.cmake.org/cmake/help/v3.1/manual/cmake-compile-features.7.html
 ) there is a section on how to mark a library as having conditional support
 on C++11 features.


 On Wed, Oct 29, 2014 at 12:58 PM, Daniel Schepler
 dschep...@scalable-networks.com wrote:
 Where would I find the list of available C++ language features?  For
 instance, I would suppose there's one for auto, one for move
 constructors/assignment operators, and one for = delete of default
 constructors/destructors et al.  These are probably the ones we'd be most
 interested in here, for the moment.  (Though with our requirements to
 support older C++ compilers, we might not actually be able to use auto, as
 the fallback would need the full type anyway.)  Also, is there a portability
 macro provided for the = delete feature?

 Also, how would I mark a target so that it activates C++11 features if
 available, but falls back to old C++ if not?  I do see the section on
 detecting compiler features, but it's not clear to me how exactly how I'd
 make the target use CXX_STANDARD 11 only if available.
 --
 Daniel

 --

 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

 --

 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




 --

 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 

Re: [CMake] Copying DLLs to output directory

2014-10-28 Thread Robert Dailey
I have a third party library like OpenSSL prebuilt for each platform
and in my own structure in version control. I have a CMake script that
creates an INTERFACE library target for it. I setup the include
directories and link targets. However, I don't see a way to configure
DLLs in the interface library target. How would you do this, and what
would CMake do to these targets to make sure they are copied to the
output directory of the executable I run from Visual Studio for
debugging?

On Tue, Oct 28, 2014 at 12:21 AM, Hendrik Sattler
p...@hendrik-sattler.de wrote:
 Hi,

 you can use generator expression in a post build rule to copy the dll file to 
 the same target dir as the target you link it with. The easiest way to do 
 this is to properly define all 3rd party libraries as imported targets that 
 contains both, the lib and the dll file.
 Sadly, the FindQt4 on Windows doesn't do this and thus make life harder than 
 needed. CMake configuration files should always do this right.

 OTOH, you could also write a wrapper batch file or change VS properties to 
 modify PATH to include all libraries before the regular path.

 HS


 Am 28. Oktober 2014 02:55:08 MEZ, schrieb Robert Dailey 
 rcdailey.li...@gmail.com:
This actually used to be a very difficult problem to solve. However,
to debug in visual studio it's essential.

If I have DLLs located in third party directories OR from targets that
I depend on, those must all be copied to the directory of the
executable I'm debugging in order for those DLLs to be found and
loaded.

Using CMake 3.0.2, I hope this task is simpler, especially with the
introduction of a nice suite of generator expressions. Can anyone
recommend a good way to do this?

-- 

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


[CMake] Refer to all debug or release targets with generator expressions

2014-10-27 Thread Robert Dailey
I know that when defining link libraries, I can do this:

$$CONFIG:Debug:${my_debug_libs}

The debug libraries will be the same for all debug targets. Likewise
with Release targets. Is there a way to refer to *all* release targets
using generator expressions? There are 3 release configurations that
ship with CMake by default for IDEs like Visual Studio. It would be
redundant for me to specify a generator expression for each and every
configuration. It'd be simpler to somehow map my release libs to all
release configurations somehow since they do not differ.

Any ideas on how to do this?
-- 

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] Refer to all debug or release targets with generator expressions

2014-10-27 Thread Robert Dailey
I forgot to give a more concrete example. Consider this:

add_library( Foo INTERFACE )
target_link_libraries( Foo INTERFACE
$$CONFIG:Debug:${lib_debug}
$$CONFIG:Release:${lib_release}
$$CONFIG:RelWithDebInfo:${lib_release}
$$CONFIG:MinSizeRel:${lib_release}
)

Must I do it like this for each and every configuration?

On Mon, Oct 27, 2014 at 7:10 PM, Robert Dailey rcdailey.li...@gmail.com wrote:
 I know that when defining link libraries, I can do this:

 $$CONFIG:Debug:${my_debug_libs}

 The debug libraries will be the same for all debug targets. Likewise
 with Release targets. Is there a way to refer to *all* release targets
 using generator expressions? There are 3 release configurations that
 ship with CMake by default for IDEs like Visual Studio. It would be
 redundant for me to specify a generator expression for each and every
 configuration. It'd be simpler to somehow map my release libs to all
 release configurations somehow since they do not differ.

 Any ideas on how to do this?
-- 

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


[CMake] Copying DLLs to output directory

2014-10-27 Thread Robert Dailey
This actually used to be a very difficult problem to solve. However,
to debug in visual studio it's essential.

If I have DLLs located in third party directories OR from targets that
I depend on, those must all be copied to the directory of the
executable I'm debugging in order for those DLLs to be found and
loaded.

Using CMake 3.0.2, I hope this task is simpler, especially with the
introduction of a nice suite of generator expressions. Can anyone
recommend a good way to do this?
-- 

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] Refer to all debug or release targets with generator expressions

2014-10-27 Thread Robert Dailey
That's a cute solution. Never thought of it. Generator expressions are
really advanced  handy now. I like it.

On Mon, Oct 27, 2014 at 7:14 PM, Daniel Schepler
dschep...@scalable-networks.com wrote:
 I think this should work:

 $$NOT:$CONFIG:Debug:${my_release_libs}
 --
 Daniel

 -Original Message-
 From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Robert Dailey
 Sent: Monday, October 27, 2014 5:12 PM
 To: CMake
 Subject: Re: [CMake] Refer to all debug or release targets with generator 
 expressions

 I forgot to give a more concrete example. Consider this:

 add_library( Foo INTERFACE )
 target_link_libraries( Foo INTERFACE
 $$CONFIG:Debug:${lib_debug}
 $$CONFIG:Release:${lib_release}
 $$CONFIG:RelWithDebInfo:${lib_release}
 $$CONFIG:MinSizeRel:${lib_release}
 )

 Must I do it like this for each and every configuration?

 On Mon, Oct 27, 2014 at 7:10 PM, Robert Dailey rcdailey.li...@gmail.com 
 wrote:
 I know that when defining link libraries, I can do this:

 $$CONFIG:Debug:${my_debug_libs}

 The debug libraries will be the same for all debug targets. Likewise
 with Release targets. Is there a way to refer to *all* release targets
 using generator expressions? There are 3 release configurations that
 ship with CMake by default for IDEs like Visual Studio. It would be
 redundant for me to specify a generator expression for each and every
 configuration. It'd be simpler to somehow map my release libs to all
 release configurations somehow since they do not differ.

 Any ideas on how to do this?
 --

 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

-- 

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-25 Thread Robert Dailey
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?

On Sat, Oct 25, 2014 at 1:08 AM, Stephen Kelly steve...@gmail.com wrote:
 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
-- 

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 Robert Dailey
What is the Filters target here? How is it created? Would I just
create a target called Boost and configure it as needed?

On Fri, Oct 24, 2014 at 2:43 PM, Robert Maynard
robert.mayn...@kitware.com wrote:
 As far as I am aware the Boost find module doesn't support writing out
 import targets.

 As far as setting up interface libraries for imported tagets you want to use
 the
 IMPORTED_LINK_INTERFACE_LIBRARIES and
 IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG properties.

 Here is an example:

 set_target_properties(Filters PROPERTIES
   IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
 Common;/usr/local/lib/libzmq.3.dylib
 )

 Note that Common in this example is another imported target.

 On Thu, Oct 23, 2014 at 12:53 PM, Robert Dailey rcdailey.li...@gmail.com
 wrote:

 Thanks for the reply!

 Basically the boost library I have is precompiled and in my own unique
 structure. I do not plan to distribute the CMake scripts I write, they
 are for personal / internal usage only.

 You suggested a find module, but will this also generate a custom
 target for boost? That's important so that when I do
 target_link_libraries(), I can pass in boost and everything is
 handled for me. I do not want to be working with libs  header files
 directly in each executable or library I define that has a dependency
 on boost.

 Thanks again.

 On Thu, Oct 23, 2014 at 4:59 AM, Johannes Zarl johannes.z...@jku.at
 wrote:
  Hi,
 
  Assuming you are not a boost developer / your changes won't be
  upstreamed,
  then creating a BoostConfig.cmake file won't do you much good. If
  someone wants
  to use your project, he/she will have to patch the locally installed
  boost
  version to include a BoostConfig.cmake file.
 
  You might want to have a look into the FindBoost[1] module of cmake.
 
  XXXConfig.cmake files are intended to be written by the creator of a
  package,
  FindXXX.cmake packages are intended as a workaround when a package does
  not
  contain an XXXConfig.cmake file and are usually written by a consumer of
  a
  package.
 
  HTH,
Johannes
 
  [1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html
 
  On Friday 17 October 2014 00:18:34 Robert Dailey wrote:
  I have a local package of boost built on Windows. It is always
  relative to the root of my project at a consistent structure and
  location. I wanted to define an import target for this and thought it
  might be best to define a BoostConfig.cmake package config file at the
  root of the boost lib directory. Is this the right approach? The code
  is below.
 
  Note that I do not have this working just yet because I don't know how
  to properly setup the interface link libraries. Could use some
  guidance here too... thanks.
 
  add_library( Boost STATIC IMPORTED GLOBAL )
 
  file( GLOB boost_debug_libs
  ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib
  ) file( GLOB boost_release_libs
  ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib )
 
  set_target_properties( Boost PROPERTIES
  IMPORTED_LOCATION_DEBUG lib/win32/debug
  IMPORTED_LOCATION_RELEASE lib/win32/release
  INTERFACE_INCLUDE_DIRECTORIES include
  INTERFACE_LINK_LIBRARIES
  $$CONFIG:Debug:${boost_debug_libs}
  $$CONFIG:Release:${boost_release_libs}
  )
 
  set( Boost_INCLUDE_DIRS include )
  set( Boost_LIBRARIES Boost )
 
  --
 
  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
 --

 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


-- 

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

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

2014-10-23 Thread Robert Dailey
Thanks for the reply!

Basically the boost library I have is precompiled and in my own unique
structure. I do not plan to distribute the CMake scripts I write, they
are for personal / internal usage only.

You suggested a find module, but will this also generate a custom
target for boost? That's important so that when I do
target_link_libraries(), I can pass in boost and everything is
handled for me. I do not want to be working with libs  header files
directly in each executable or library I define that has a dependency
on boost.

Thanks again.

On Thu, Oct 23, 2014 at 4:59 AM, Johannes Zarl johannes.z...@jku.at wrote:
 Hi,

 Assuming you are not a boost developer / your changes won't be upstreamed,
 then creating a BoostConfig.cmake file won't do you much good. If someone 
 wants
 to use your project, he/she will have to patch the locally installed boost
 version to include a BoostConfig.cmake file.

 You might want to have a look into the FindBoost[1] module of cmake.

 XXXConfig.cmake files are intended to be written by the creator of a package,
 FindXXX.cmake packages are intended as a workaround when a package does not
 contain an XXXConfig.cmake file and are usually written by a consumer of a
 package.

 HTH,
   Johannes

 [1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html

 On Friday 17 October 2014 00:18:34 Robert Dailey wrote:
 I have a local package of boost built on Windows. It is always
 relative to the root of my project at a consistent structure and
 location. I wanted to define an import target for this and thought it
 might be best to define a BoostConfig.cmake package config file at the
 root of the boost lib directory. Is this the right approach? The code
 is below.

 Note that I do not have this working just yet because I don't know how
 to properly setup the interface link libraries. Could use some
 guidance here too... thanks.

 add_library( Boost STATIC IMPORTED GLOBAL )

 file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib
 ) file( GLOB boost_release_libs
 ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib )

 set_target_properties( Boost PROPERTIES
 IMPORTED_LOCATION_DEBUG lib/win32/debug
 IMPORTED_LOCATION_RELEASE lib/win32/release
 INTERFACE_INCLUDE_DIRECTORIES include
 INTERFACE_LINK_LIBRARIES
 $$CONFIG:Debug:${boost_debug_libs}
 $$CONFIG:Release:${boost_release_libs}
 )

 set( Boost_INCLUDE_DIRS include )
 set( Boost_LIBRARIES Boost )

 --

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

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-22 Thread Robert Dailey
Can anyone help me with this? It would be much appreciated. Thank you.

On Fri, Oct 17, 2014 at 12:18 AM, Robert Dailey
rcdailey.li...@gmail.com wrote:
 I have a local package of boost built on Windows. It is always
 relative to the root of my project at a consistent structure and
 location. I wanted to define an import target for this and thought it
 might be best to define a BoostConfig.cmake package config file at the
 root of the boost lib directory. Is this the right approach? The code
 is below.

 Note that I do not have this working just yet because I don't know how
 to properly setup the interface link libraries. Could use some
 guidance here too... thanks.

 add_library( Boost STATIC IMPORTED GLOBAL )

 file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib )
 file( GLOB boost_release_libs
 ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib )

 set_target_properties( Boost PROPERTIES
 IMPORTED_LOCATION_DEBUG lib/win32/debug
 IMPORTED_LOCATION_RELEASE lib/win32/release
 INTERFACE_INCLUDE_DIRECTORIES include
 INTERFACE_LINK_LIBRARIES
 $$CONFIG:Debug:${boost_debug_libs}
 $$CONFIG:Release:${boost_release_libs}
 )

 set( Boost_INCLUDE_DIRS include )
 set( Boost_LIBRARIES Boost )
-- 

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


[CMake] Interface include directories

2014-10-16 Thread Robert Dailey
I'm ramping up on CMake 3.0 and I like that you've added
INTERFACE_INCLUDE_DIRECTORIES. Is this automatic when I add a
dependency on another target? For example, suppose I have two targets
A and B. And in my target link libraries for B, I specify A. B now
depends on A. Will I also inherit its interface include directories or
do I have to do that manually?
-- 

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


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

2014-10-16 Thread Robert Dailey
I have a local package of boost built on Windows. It is always
relative to the root of my project at a consistent structure and
location. I wanted to define an import target for this and thought it
might be best to define a BoostConfig.cmake package config file at the
root of the boost lib directory. Is this the right approach? The code
is below.

Note that I do not have this working just yet because I don't know how
to properly setup the interface link libraries. Could use some
guidance here too... thanks.

add_library( Boost STATIC IMPORTED GLOBAL )

file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib )
file( GLOB boost_release_libs
${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib )

set_target_properties( Boost PROPERTIES
IMPORTED_LOCATION_DEBUG lib/win32/debug
IMPORTED_LOCATION_RELEASE lib/win32/release
INTERFACE_INCLUDE_DIRECTORIES include
INTERFACE_LINK_LIBRARIES
$$CONFIG:Debug:${boost_debug_libs}
$$CONFIG:Release:${boost_release_libs}
)

set( Boost_INCLUDE_DIRS include )
set( Boost_LIBRARIES Boost )
-- 

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


[CMake] Generator expressions for optimized/debug configurations

2014-08-12 Thread Robert Dailey
I just installed CMake 3.0 and I'm trying out the new generator
expressions for the target_compile_definitions() command.

I am doing this:

target_compile_definitions( ${project_name}
PRIVATE ${general_defs}
PRIVATE $$CONFIG:debug:${debug_defs}
PRIVATE $$CONFIG:release:${release_defs}
)

The problem here is that there are many release configurations
provided by CMake by default. I would like a way to target optimized
and unoptimized configurations, regardless of name.

I'm working on a generic CMake framework (written in CMake language)
that hides away some details of using CMake directly for complex
tasks. As such I can't really know from a generic level which
configurations (by name) will exist. Users could add more or less. The
best I can do from the framework level is target optimized or
unoptimized configs.

Any way to do this with 3.0?

Thanks in advance.
-- 

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 for Android projects

2014-05-08 Thread Robert Dailey
So basically I am thinking of doing this:

1. Build my NDK libraries using the android cmake toolchain file as if
I'm just building normal C++ libraries on Linux with the CMake
provided makefiles in the binary output directory.
2. Create a Java project using the 'android create project' tool and
check that into version control. The 'libs' directory will be empty.
3. When building the NDK libraries, install them to the
corresponding libs directory for that java project (I may need to
install the same library multiple times if multiple java projects
depend on it).
4. Run 'ant' by hand to build the java project.

Likewise I think I can import all projects into eclipse: Import the
cmake build directory, and then each project in the source tree for
the java side. That way I can work with it all together in the same
IDE.

Does this sound feasible or am I missing steps?

On Wed, May 7, 2014 at 10:10 PM, J Decker d3c...@gmail.com wrote:
 by putting them in a directory lib/cputype



 On Wed, May 7, 2014 at 5:19 PM, Robert Dailey rcdailey.li...@gmail.com
 wrote:

 How do I tell my android Java project where the *.so files are so it
 can package them into the APK for dynamic loading when I call
 System.loadlibrary() on the SO files?

 On Tue, May 6, 2014 at 6:59 PM, Eric Wing ewmail...@gmail.com wrote:
  So I have 4 examples I actually tried to document.
  These all use my fork/derivative of the Android-CMake toolchain, which
  I believe comes from OpenCV. (It had grown stale with later NDKs and I
  hit problems). All of these rely heavily on the external NDK module
  system (NDK_MODULE_PATH).
 
  The first and easiest (most self contained) is:
  https://bitbucket.org/ewing/hello-android-almixer
  This one invokes ant via shell scripts outside CMake.
 
  I then recently got SDL building with CMake using the same techniques.
  https://bitbucket.org/ewing/sdl_android_cleanup
  This one doesn't invoke ant because it builds only a library. There
  was actually an intermediate project I helped build after ALmixer that
  this also drew from, JavaScriptCore, and I documented my procedure
  here:
 
  https://github.com/appcelerator/hyperloop/wiki/Building-JavaScriptCore-for-Android
 
 
  Once you have SDL built, and you set your NDK_MODULE_PATH directly, I
  have an Ant example and Gradle example. The ant one is just like
  Hello-Android-ALmixer.
  https://bitbucket.org/ewing/helloandroidsdl-ant
  https://bitbucket.org/ewing/helloandroidsdl-gradle
 
  The Gradle one is a lot of hacks. Google is ditching Ant/Eclipse for
  Gradle/IntelliJ, but their NDK support is even worse in the latter
  right now.
 
  Again, once you leave the NDK, all these things live outside CMake. I
  think it would be interesting to make CMake handle all of this, but I
  can't visualize it yet. But I hope others might be able to build on my
  work, like how I've built on Android-CMake.
 
  An aside, I noticed Gradle is painfully slow. Depending on how one
  does CMake integration, I'm not sure I want it. Just to invoke it and
  for it to figure out no real work needs to be done is measured in
  seconds for me.
 
 
  Thanks,
  Eric
 
 
 
  On 5/6/14, J Decker d3c...@gmail.com wrote:
  This is a page on building to android; mostly it's about my library,
  but
  names can be replaced where required
 
  https://code.google.com/p/c-system-abstraction-component-gui/wiki/BuildingForAndroid
 
  I went wit the separate cmake projects because I end up with multiple
  android projects from the same libraries; but really it could be
  appended
  all-together
 
 
  On Tue, May 6, 2014 at 2:32 PM, Robert Dailey
  rcdailey.li...@gmail.comwrote:
 
  Well to be clear, the NDK libraries are compiled in eclipse after I
  generate eclipse makefiles in CMake. Ideally, I want the CMake script
  to also configure ant execution so that it builds java and links in
  the NDK libraries. You say just use the libraries, but I'm not sure
  what this looks like as far as CMake script is concerned.
 
  Also I think we're using the android glue stuff in our existing
  project, but I'm not really sure what android glue is or if it is
  relevant to the CMake setup.
 
  On Tue, May 6, 2014 at 2:45 PM, J Decker d3c...@gmail.com wrote:
   If you've built the sources into libs, you can just use the lib; my
  sources
   are much too complex of a tree for ndk to support to build as
   sources..
  
   The java sources are compiled at the 'ant debug/release' step...
   there
  is a
   step before that I do that is 'android.bat update project --target
   android-14 --path' which makes a few other files from the
   build.xml.
  
  
   On Tue, May 6, 2014 at 8:42 AM, Robert Dailey
   rcdailey.li...@gmail.com
   wrote:
  
   There is also the question of how to handle the NDK sources and
   integrate them into the eclipse workspace. For example, I believe
   NDK
   sources must be under the 'jni' directory, but they won't be
   structured that way in the source tree. So I'm not sure if the jni

<    1   2   3   4   5   6   7   8   9   >