Re: [CMake] include_extenal_msproject() dependency behavior change between 3.13.4 and 3.14.0-rc2 (possible bug in rc2)

2019-02-26 Thread nick

Hi Craig,

Thanks for the info. I've verified that the revision you pointed me to 
(24b6e4830d9027e63db7dfafa500aaeb652d3a4c) is where the behavior broke 
(I built CMake using the revision directly before this one and 
everything still works fine). I'm no expert with CMake development - 
could someone chime in on whether what I am seeing is expected or 
whether something has inadvertently been broken?


Testing this is actually quite simple. There is no need to even have 
valid external vcproj files on the file system - CMake does not appear 
to care if they exist or not when generating the solution. The most 
trivial test I can give to reproduce the behavior is:


./CMakeLists.txt:
cmake_minimum_required(VERSION 3.4)
project(frontend_test)
add_subdirectory(deps "${CMAKE_CURRENT_BINARY_DIR}/ext_deps" 
EXCLUDE_FROM_ALL)

add_executable(frontend1 main.c)
target_link_libraries(frontend1 foo1_cmake)

./main.c:
/* nothing - unimportant for the test */

./deps/CMakeLists.txt:
cmake_minimum_required(VERSION 3.4)
add_library(foo1_cmake STATIC IMPORTED GLOBAL)
include_external_msproject(foo1_cmake_extern "foo1.vcproj")
add_dependencies(foo1_cmake foo1_cmake_extern)
set_property(TARGET foo1_cmake PROPERTY IMPORTED_LOCATION_DEBUG 
"foo1.lib")

add_library(foo2_cmake STATIC IMPORTED GLOBAL)
include_external_msproject(foo2_cmake_extern "foo2.vcproj")
add_dependencies(foo2_cmake foo2_cmake_extern)
set_property(TARGET foo2_cmake PROPERTY IMPORTED_LOCATION_DEBUG 
"foo2.lib")


Invoking CMake before revision 24b6e4830d9027e63db7dfafa500aaeb652d3a4c 
and opening the solution will show that Visual Studio would like to open 
foo1_cmake_extern (and it will show as unavailable in the solution 
explorer on account of the file not actually existing).


Invoking CMake at or after revision 
24b6e4830d9027e63db7dfafa500aaeb652d3a4c and opening the solution will 
show that Visual Studio would like to open foo1_cmake_extern AND 
foo2_cmake_extern (and both will show as unavailable in the solution 
explorer on account of the file not actually existing).


Just as an FYI for the mailing list (I don't actually care about this): 
I needed to update on my machine CMake (I was previously running version 
3.6) to build CMake. This might be acceptable - but I figured that CMake 
should have used cmake_version_minimum to indicate the version I was 
using was not new enough. I did not investigate, but 3.6 bombed out with 
the following:


C:\cmakegit\cmake\build> cmake .. -G "Visual Studio 14 2015 Win64"
CMake Error at Tests/RunCMake/CMakeLists.txt:279 (if):
  if given arguments:

"(" "CMAKE_CXX_COMPILER_VERSION" "VERSION_GREATER_EQUAL" 
"19.0.24215.1" "AND" "CMAKE_CXX_COMPILER_VERSION" "VERSION_LESS" "19.10" 
")" "OR" "CMAKE_CXX_COMPILER_VERSION" "VERSION_GREATER_EQUAL" 
"19.10.25017"


  Unknown arguments specified

Nick Appleton

On 2019-02-26 19:44, Craig Scott wrote:

If you're able to build CMake from sources yourself, you may want to
check if the changes from this merge request [2] are what has led to
the change you're seeing. That relates to how the EXCLUDE_FROM_ALL
target property is initialised when a target is created.

On Tue, Feb 26, 2019 at 2:20 PM  wrote:


Hello,

We have a fairly large CMake project which uses
include_extenal_msproject() when we are producing Visual Studio
solutions to bring in projects produced using another build metadata

generator. We've noticed most of our Visual Studio builds have
started
failing after switching to CMake 3.14.0-rc2 (not sure where betweenn

3.13.4 and 3.14.0-rc2 this issue was introduced).

An example of how the behavior differs can be realised with the
following example:

dependencies/CMakeLists.txt:

# several duplications of the following block exist replacing fooN
with
foo1, foo2, foo3, etc.
add_library(fooN_cmake STATIC IMPORTED GLOBAL)
if(MSVC)
include_external_msproject(fooN_cmake_extern "fooN.vcproj")
else()
# other external things happen here using ExternalProject_add to
end
up creating fooN_cmake_extern for non-VS/non-Windows builds.
endif()
add_dependencies(fooN_cmake fooN_cmake_extern)
set_property(TARGET fooN_cmake PROPERTY
INTERFACE_INCLUDE_DIRECTORIES
"path to foo include files")
set_property(TARGET fooN_cmake PROPERTY IMPORTED_LOCATION_DEBUG
"path to
foo static library")
# ... more properties possibly set

frontend1/CMakeLists.txt:

add_subdirectory(../dependencies
"${CMAKE_CURRENT_BINARY_DIR}/ext_deps"
EXCLUDE_FROM_ALL)
add_executable(frontend1 main.c)
target_link_libraries(frontend1 foo1_cmake foo2_cmake)

frontend2/CMakeLists.txt:

add_subdirectory(../dependencies
"${CMAKE_CURRENT_BINARY_DIR}/ext_deps"
EXCLUDE_FROM_ALL)
add_executable(frontend2 main.c)
target_link_libraries(frontend2 foo3_cmake foo2_cmake)

The old behavio

[CMake] include_extenal_msproject() dependency behavior change between 3.13.4 and 3.14.0-rc2 (possible bug in rc2)

2019-02-25 Thread nick

Hello,

We have a fairly large CMake project which uses 
include_extenal_msproject() when we are producing Visual Studio 
solutions to bring in projects produced using another build metadata 
generator. We've noticed most of our Visual Studio builds have started 
failing after switching to CMake 3.14.0-rc2 (not sure where betweenn 
3.13.4 and 3.14.0-rc2 this issue was introduced).


An example of how the behavior differs can be realised with the 
following example:


dependencies/CMakeLists.txt:

# several duplications of the following block exist replacing fooN with 
foo1, foo2, foo3, etc.

add_library(fooN_cmake STATIC IMPORTED GLOBAL)
if(MSVC)
  include_external_msproject(fooN_cmake_extern "fooN.vcproj")
else()
  # other external things happen here using ExternalProject_add to end 
up creating fooN_cmake_extern for non-VS/non-Windows builds.

endif()
add_dependencies(fooN_cmake fooN_cmake_extern)
set_property(TARGET fooN_cmake PROPERTY INTERFACE_INCLUDE_DIRECTORIES 
"path to foo include files")
set_property(TARGET fooN_cmake PROPERTY IMPORTED_LOCATION_DEBUG "path to 
foo static library")

# ... more properties possibly set

frontend1/CMakeLists.txt:

add_subdirectory(../dependencies "${CMAKE_CURRENT_BINARY_DIR}/ext_deps" 
EXCLUDE_FROM_ALL)

add_executable(frontend1 main.c)
target_link_libraries(frontend1 foo1_cmake foo2_cmake)

frontend2/CMakeLists.txt:

add_subdirectory(../dependencies "${CMAKE_CURRENT_BINARY_DIR}/ext_deps" 
EXCLUDE_FROM_ALL)

add_executable(frontend2 main.c)
target_link_libraries(frontend2 foo3_cmake foo2_cmake)

The old behavior: we could invoke CMake using a source directory of 
frontend1 or frontend2 to get Visual Studio solutions. Only the Visual 
Studio projects which are imported using include_extenal_msproject() 
that are dependencies of that particular frontend are included in the 
solution i.e. the VS solution for frontend1 will not include foo3_cmake 
as part of the build at all. I expect this due to the use of 
EXCLUDE_FROM_ALL.


The new behavior: all frontends will include every single project 
defined using include_extenal_msproject that CMake encounters. They will 
all attempt to be built regardless of if there is a dependency. I would 
only have expected this behavior if EXCLUDE_FROM_ALL was *not* set when 
using add_subdirectory().


Could someone help me to understand if the behavior change is expected 
or if this is just a bug?


Thanks!

Nick Appleton
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio

2019-01-21 Thread nick

Hi Scott,

Yes, I can invoke msbuild directly on the CMake generated solution 
using:


msbuild theproject.sln /p:Platform=Win32

And everything builds fine. I cannot get the same behaviour using CMake 
--build - is there a way to determine exactly the arguments CMake is 
invoking msbuild with?


On 2019-01-22 03:01, Scott Bloom wrote:

Can you make it work by running msbuild directly?

What about building using visual studio from the command line?

Scott

-Original Message-
From: CMake  On Behalf Of 
n...@appletonaudio.com

Sent: Sunday, January 20, 2019 21:02
To: cmake@cmake.org
Subject: [CMake] Different behavior between building using "cmake
--build" and building in Visual Studio

Hello,

I have a CMake project which is generating Visual Studio (VS2017)
solutions which can be compiled using the Visual Studio IDE but cannot
be built from the command line using "cmake --build".

The project contains a shared library which links against two static
libraries. The two static libraries are non-CMake projects with
.vcproj files which are generated using another (proprietary) build
system. They are being included in the project on Windows using the
include_external_msproject() command. These two projects do not have
the standard configuration names ("Debug","Release",etc) and their
configurations are mapped to the main CMake project's configurations
using MAP_IMPORTED_CONFIG_XXX properties. This all works very well
using the VS IDE.

There are two things that happen which I find surprising when I run
"cmake --build":

1) It doesn't seem to automatically decide on the correct platform
toolset version to use. So running "cmake.exe --build . --config
Debug"
ends up resulting in a build log containing lots of errors about
missing tools. I can fix this by manually specifiying the toolset
version as:
"cmake.exe --build . --config Debug -- -property:PlatformToolset=v140"
(if anyone can hint to why this happens, I would be interested - but
it is secondary to the following issue) which results in:

2) The following issues in the build tool log:

"MY_DEVELOPMENT_PATH\PATH1\build\ALL_BUILD.vcxproj" (default target) 
(1)

->
"MY_DEVELOPMENT_PATH\PATH2\library_1.vcxproj" (default target) (3) ->
(PrepareForBuild target) ->
   C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(349,5):
error MSB8013: This project doesn't contain the Configuration and
Platform combination of Debug|Win32.
[MY_DEVELOPMENT_PATH\PATH2\dependent_library_1.vcxproj]


"MY_DEVELOPMENT_PATH\PATH1\build\ALL_BUILD.vcxproj" (default target) 
(1)

->
"MY_DEVELOPMENT_PATH\PATH3\library_2.vcxproj" (default target) (4) ->
   C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(349,5):
error MSB8013: This project doesn't contain the Configuration and
Platform combination of Debug|Win32.
[MY_DEVELOPMENT_PATH\PATH3\dependent_library_2.vcxproj]

Where library_1 and library_2 correspond to the two static libraries.
Given the output, my guess is that the mapped configurations are not
being honoured anymore (while they are definitely being honoured when
the project is built inside Visual Studio). I would have assumed that
CMake would invoke msbuild/devenv on the created solution and things
would work, but it does not seem to be happening. Could anyone provide
me with some information as to whether this is a bug in CMake or if I
am missing something bigger here?

Thanks!

Nick
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For
more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Different behavior between building using "cmake --build" and building in Visual Studio

2019-01-20 Thread nick

Hello,

I have a CMake project which is generating Visual Studio (VS2017) 
solutions which can be compiled using the Visual Studio IDE but cannot 
be built from the command line using "cmake --build".


The project contains a shared library which links against two static 
libraries. The two static libraries are non-CMake projects with .vcproj 
files which are generated using another (proprietary) build system. They 
are being included in the project on Windows using the 
include_external_msproject() command. These two projects do not have the 
standard configuration names ("Debug","Release",etc) and their 
configurations are mapped to the main CMake project's configurations 
using MAP_IMPORTED_CONFIG_XXX properties. This all works very well using 
the VS IDE.


There are two things that happen which I find surprising when I run 
"cmake --build":


1) It doesn't seem to automatically decide on the correct platform 
toolset version to use. So running "cmake.exe --build . --config Debug" 
ends up resulting in a build log containing lots of errors about missing 
tools. I can fix this by manually specifiying the toolset version as: 
"cmake.exe --build . --config Debug -- -property:PlatformToolset=v140" 
(if anyone can hint to why this happens, I would be interested - but it 
is secondary to the following issue) which results in:


2) The following issues in the build tool log:

"MY_DEVELOPMENT_PATH\PATH1\build\ALL_BUILD.vcxproj" (default target) (1) 
->

"MY_DEVELOPMENT_PATH\PATH2\library_1.vcxproj" (default target) (3) ->
(PrepareForBuild target) ->
  C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(349,5): 
error MSB8013: This project doesn't contain the Configuration and 
Platform combination of Debug|Win32. 
[MY_DEVELOPMENT_PATH\PATH2\dependent_library_1.vcxproj]



"MY_DEVELOPMENT_PATH\PATH1\build\ALL_BUILD.vcxproj" (default target) (1) 
->

"MY_DEVELOPMENT_PATH\PATH3\library_2.vcxproj" (default target) (4) ->
  C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(349,5): 
error MSB8013: This project doesn't contain the Configuration and 
Platform combination of Debug|Win32. 
[MY_DEVELOPMENT_PATH\PATH3\dependent_library_2.vcxproj]


Where library_1 and library_2 correspond to the two static libraries. 
Given the output, my guess is that the mapped configurations are not 
being honoured anymore (while they are definitely being honoured when 
the project is built inside Visual Studio). I would have assumed that 
CMake would invoke msbuild/devenv on the created solution and things 
would work, but it does not seem to be happening. Could anyone provide 
me with some information as to whether this is a bug in CMake or if I am 
missing something bigger here?


Thanks!

Nick
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Mapping configurations and include_external_msproject()

2018-03-08 Thread nick

Hi,

I'm using CMake for a project which (on Windows) uses 
include_external_msproject() to import Visual Studio project files which 
were generated by another build system. These project files do not 
contain the usual "Debug" and "Release" configurations, but have a large 
set of configurations which map over a set of parameters. In my project, 
I would like to be able to say that my "Release" build corresponds to a 
"_yyy_release" variant of the sub-project. The old set of posts 
below appear to be asking for the same thing:


https://cmake.org/pipermail/cmake/2016-February/062762.html

Currently, I can't seem to find a way to do this. It looks like the 
MAP_IMPORTED_CONFIG_* variables are what I want, but it does not look 
like they work with include_external_msproject(). 
https://cmake.org/cmake/help/v3.9/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.html


Does anyone have any advice?

Thanks!

Nick
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Question regarding CUDA support in CMake 3.8.0-rc2

2017-03-16 Thread Nick Henderson
Thank you!

Setting:

set(CMAKE_CUDA_FLAGS "-arch compute_30 ${CMAKE_CUDA_FLAGS}")

did the trick.

Is there any documentation or example projects related to the new CUDA
support?

CUDA support is great to have and will simplify my build system!  Thank you.



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Question-regarding-CUDA-support-in-CMake-3-8-0-rc2-tp7595171p7595174.html
Sent from the CMake mailing list archive at Nabble.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] Question regarding CUDA support in CMake 3.8.0-rc2

2017-03-15 Thread Nick Henderson
Hello!

I am testing out the CUDA support in CMake 3.8.0-rc2.

When running `make VERBOSE=1` in the build directory, I get a warning
generated related to the GPU architecture flags for nvcc:

```
[ 80%] Linking CUDA device code
/home/nwh/git/foobar/build/exec/CMakeFiles/exec.dir/cmake_device_link.o
cd /home/nwh/git/foobar/build/exec && /usr/local/bin/cmake -E
cmake_link_script CMakeFiles/exec.dir/dlink.txt --verbose=1
/usr/local/cuda/bin/nvcc   -Xcompiler=-fPIC -shared -dlink
CMakeFiles/exec.dir/exec.cc.o -o CMakeFiles/exec.dir/cmake_device_link.o
../libfoobar.a 
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are
deprecated, and may be removed in a future release (Use
-Wno-deprecated-gpu-targets to suppress warning).
```

I don't get the warning when the executable source is being compiled because
an up-to-date architecture is specified:

```
[ 60%] Building CUDA object exec/CMakeFiles/exec.dir/exec.cc.o
cd /home/nwh/git/foobar/build/exec && /usr/local/cuda/bin/nvcc  
-I/home/nwh/git/foobar  -arch compute_30 -std=c++11 -x cu -c
/home/nwh/git/foobar/exec/exec.cc -o CMakeFiles/exec.dir/exec.cc.o
```

Link to sample project: https://github.com/nwh/foobar

Questions:

* Is this a problem?
* What is the purpose of cmake_device_link.o?

Thanks,
Nick



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Question-regarding-CUDA-support-in-CMake-3-8-0-rc2-tp7595171.html
Sent from the CMake mailing list archive at Nabble.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


Re: [CMake] CMake library installations and pkg-config

2016-09-01 Thread nick

On 2016-08-31 23:32, Konstantin Tokarev wrote:

31.08.2016, 16:22, "Nick Appleton" <n...@appletonaudio.com>:

Hi,

I’ve been recently doing a bit of work for an open source project 
trying to extend it’s support for CMake. I’ve been trying to get CMake 
to be able to replicate most of the functionality which can be 
achieved with the existing autoconf-based infrastructure (and have had 
pretty good success) but am struggling to figure out how to get CMake 
to generate pkg-config files on unix-ey systems. I’ve done quite a lot 
of searching, but have not found anything which provides a good 
solution for our use case.


Do you consider contributing to
https://api.kde.org/ecm/module/ECMGeneratePkgConfigFile.html ?



Hi Konstantin,

Thanks for the reply and pointing me at the ECM repository.

I was hoping that this would be something that CMake would be able to do 
without requiring an external package - particularly since CMake 
provides support for finding packages on the system with pkg-config 
files. I think adding documentation to our project which says "if you 
want to install portaudio into the host system in a way compatible with 
autotools-based projects, you will need to get this other repository" 
seems a little bit much to me.


Cheers,

Nick
--

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 library installations and pkg-config

2016-08-31 Thread Nick Appleton
Hi,

I’ve been recently doing a bit of work for an open source project trying to 
extend it’s support for CMake. I’ve been trying to get CMake to be able to 
replicate most of the functionality which can be achieved with the existing 
autoconf-based infrastructure (and have had pretty good success) but am 
struggling to figure out how to get CMake to generate pkg-config files on 
unix-ey systems. I’ve done quite a lot of searching, but have not found 
anything which provides a good solution for our use case.

The project is called portaudio (a cross-platform, C, real-time audio library) 
and at present there is one CMakeLists.txt file which does everything (I’ve 
tried to keep it clean), you can see it here: 
https://app.assembla.com/spaces/portaudio/git/source/cmake_updates/CMakeLists.txt

It looks for various audio libraries which may be present on the system using 
find_package() and associates them with the library which it defines using 
target_link_libraries(). This is all great when my CMake project includes 
portaudio (via add_subdirectory() and target_link_libraries() with one of the 
portaudio library targets), but if I want “make install”-like functionality so 
that others can use a portaudio installation without requiring CMake, I would 
like to be able to generate a pkg-config file which contains the necessary 
linker arguments to pass when linking against the library. The generation of 
the pkg-config file is straight-forward using the configure_file() function, 
but I am struggling to find a way to: given a CMake target, create a variable 
containing the set of linker paths and library names to use in the pkg-config 
file.

Can anyone give me some hints as to whether this is possible?

Cheers,

Nick

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

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

2016-04-25 Thread Nick Deubert
On Fri, Apr 22, 2016 at 5:08 PM, Alan W. Irwin
<ir...@beluga.phys.uvic.ca> wrote:
> On 2016-04-22 14:59-0400 Nick Deubert wrote:
>
>> Hey everyone, I am trying to build and link some 32bit binaries on
>> Ubuntu 15.10 64bit, but no matter what combination of arguments I give
>> FIND_LIBRARY I cannot get it to use the 32bit libs. I have been
>> scouring the mailing lists and came up with all these things to try
>> but nothing has worked so far. I am using cmake 3.0.2. Please let me
>> know what I am missing. Thanks in advance for your help.
>
>
> CMake 3.0.2 is pretty old, and there were some find and other issues
> for early CMake-3 versions.  I don't know whether any of those issues
> are relevant to the issue you are discussing. Nevertheless, as an
> experiment (and to make sure your eventual solution works for the
> latest CMake) I would suggest you try building and using the latest
> released version of CMake, 3.5.2, to see if that makes any difference.
>
> Alan

Ok I upgraded to 3.2.2 which is the latest ubuntu 15.10 offers (I will
try 16.04 w/3.5.1 soon), but I get the same issue. Is my syntax all
correct as far as you can tell?
Thanks,
Nick
-- 

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] Finding 32bit libs on 64bit Ubuntu install

2016-04-22 Thread Nick Deubert
Hey everyone, I am trying to build and link some 32bit binaries on
Ubuntu 15.10 64bit, but no matter what combination of arguments I give
FIND_LIBRARY I cannot get it to use the 32bit libs. I have been
scouring the mailing lists and came up with all these things to try
but nothing has worked so far. I am using cmake 3.0.2. Please let me
know what I am missing. Thanks in advance for your help.
Nick

The relevant part of my cmake file:

 Set(CFLAGS "-m32")
 Set(CXXFLAGS "-m32")
 Set(CMAKE_C_FLAGS "-m32")
 Set(CMAKE_CXX_FLAGS "-m32")
 Set(CMAKE_SHARED_LINKER_FLAGS "-m32")
 Set(FIND_LIBRARY_USE_LIB64_PATHS OFF)

 MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
 MESSAGE( STATUS "CFLAGS: " ${CFLAGS} )
 MESSAGE( STATUS "CXXFLAGS: " ${CXXFLAGS} )
 MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
 MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
 MESSAGE( STATUS "CMAKE_SHARED_LINKER_FLAGS: " ${CMAKE_SHARED_LINKER_FLAGS} )
 MESSAGE( STATUS "FIND_LIBRARY_USE_LIB64_PATHS: "
${FIND_LIBRARY_USE_LIB64_PATHS} )

 FIND_LIBRARY(DL_LIBRARY NAMES dl  PATHS  ${LIB_PATH}
NO_DEFAULT_PATH)
 FIND_LIBRARY(NL_LIBRARY NAMES nl  PATHS  ${LIB_PATH}
NO_DEFAULT_PATH)
 FIND_LIBRARY(PTHREAD_LIBRARYNAMES pthread PATHS  ${LIB_PATH}
NO_DEFAULT_PATH)

MESSAGE(STATUS "DL_LIBRARY is ${DL_LIBRARY}")
MESSAGE(STATUS "NL_LIBRARY is ${NL_LIBRARY}")
MESSAGE(STATUS "PTHREAD_LIBRARY is ${PTHREAD_LIBRARY}")

The output I get:

-- CMAKE_LIBRARY_PATH: /lib/i386-linux-gnu
-- CFLAGS: -m32
-- CXXFLAGS: -m32
-- CMAKE_C_FLAGS: -m32
-- CMAKE_CXX_FLAGS: -m32
-- CMAKE_SHARED_LINKER_FLAGS: -m32
-- FIND_LIBRARY_USE_LIB64_PATHS: OFF
-- DL_LIBRARY is DL_LIBRARY-NOTFOUND
-- NL_LIBRARY is NL_LIBRARY-NOTFOUND
-- PTHREAD_LIBRARY is PTHREAD_LIBRARY-NOTFOUND

Without NO_DEFAULT_PATH:

-- DL_LIBRARY is /usr/lib/x86_64-linux-gnu/libdl.so
-- NL_LIBRARY is /lib/x86_64-linux-gnu/libnl.so
-- PTHREAD_LIBRARY is /usr/lib/x86_64-linux-gnu/libpthread.so

Proof that I have the 32bit libs installed:

$ ls -l /lib/i386-linux-gnu/*pthread*
-rwxr-xr-x 1 root root 137044 Feb 16 14:06
/lib/i386-linux-gnu/libpthread-2.21.so*
lrwxrwxrwx 1 root root 18 Feb 16 14:06
/lib/i386-linux-gnu/libpthread.so.0 -> libpthread-2.21.so*
$ ls -l /lib/i386-linux-gnu/*libnl*
-rw-r--r-- 1 root root 165936 Jul 15  2015 /lib/i386-linux-gnu/libnl-3.a
lrwxrwxrwx 1 root root 19 Jul 15  2015
/lib/i386-linux-gnu/libnl-3.so -> libnl-3.so.200.21.0
lrwxrwxrwx 1 root root 19 Jul 15  2015
/lib/i386-linux-gnu/libnl-3.so.200 -> libnl-3.so.200.21.0
-rw-r--r-- 1 root root 132852 Jul 15  2015
/lib/i386-linux-gnu/libnl-3.so.200.21.0
$ ls -l /lib/i386-linux-gnu/*libdl*
-rw-r--r-- 1 root root 13808 Feb 16 14:06 /lib/i386-linux-gnu/libdl-2.21.so
lrwxrwxrwx 1 root root13 Feb 16 14:06
/lib/i386-linux-gnu/libdl.so.2 -> libdl-2.21.so
-- 

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] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-04 Thread Nick Lewis
Brad

Thank you for looking at adding this feature to 'next'. I am not familiar
with git format-patch but i hope you can make use of the attached patch for
​​Help/command/install.rst

Best regards
Nick​​

On Wed, Feb 3, 2016 at 9:17 PM, Brad King <brad.k...@kitware.com> wrote:

> On 02/03/2016 02:31 PM, Brad King wrote:
> >  install: Add EXCLUDE_FROM_ALL option (#14921)
> >  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b6c4729
> >
> >  Tests: Add cases for install() command EXCLUDE_FROM_ALL option
> >  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=670fa897
>
> I've had to revert it from 'next' pending some corrections to how
> the test infrastructure checks the installation results to work
> more portably.  I'll respond again once that is fixed and the
> topic draft is restored.  Meanwhile please work on the documentation
> updates.
>
> Thanks,
> -Brad
>
>


-- 
Nick Lewis
nick.le...@amag.com
+44 1684 277137 <+441684277137>
www.amag.com
AMAG Technology, Challenge House, International Drive, Tewkesbury Business
Park, TEWKESBURY, GL20 8UQ, U.K.

-- 



This company is part of the G4S group of companies. This communication 
contains information which may be confidential, personal and/or privileged. 
It is for the exclusive use of the intended recipient(s). If you are not 
the intended recipient(s), please note that any distribution, forwarding, 
copying or use of this communication or the information in it is strictly 
prohibited. Any personal views expressed in this e-mail are those of the 
individual sender and the Company does not endorse or accept responsibility 
for them. Prior to taking any action based upon this e-mail message, you 
should seek appropriate confirmation of its authenticity. This message has 
been checked for viruses on behalf of the Company.
commit dafc81cb0f2334a913631239f7dd3f1538f71c48
Author: Nick Lewis <nick.le...@usa.g4s.com>
Date:   Thu Feb 4 09:01:33 2016 +

Improve EXCLUDE_FROM_ALL documentation in Help/command/install.rst

diff --git a/Help/command/install.rst b/Help/command/install.rst
index 5e98971..bc257bb 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -50,6 +50,10 @@ signatures that specify them.  The common options are:
   created.  The default component name may be controlled with the
   :variable:`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable.
 
+``EXCLUDE_FROM_ALL``
+  Specify that the file is excluded from a full installation and only
+  installed as part of a component-specific installation
+
 ``RENAME``
   Specify a name for an installed file that may be different from the
   original file.  Renaming is allowed only when a single file is
@@ -173,7 +177,7 @@ Installing Files
   [PERMISSIONS permissions...]
   [CONFIGURATIONS [Debug|Release|...]]
   [COMPONENT ]
-  [RENAME ] [OPTIONAL])
+  [RENAME ] [OPTIONAL] [EXCLUDE_FROM_ALL])
 
 The ``FILES`` form specifies rules for installing files for a project.
 File names given as relative paths are interpreted with respect to the
@@ -207,7 +211,8 @@ Installing Directories
   [DIRECTORY_PERMISSIONS permissions...]
   [USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER]
   [CONFIGURATIONS [Debug|Release|...]]
-  [COMPONENT ] [FILES_MATCHING]
+  [COMPONENT ] [EXCLUDE_FROM_ALL]
+  [FILES_MATCHING]
   [[PATTERN  | REGEX ]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
 
@@ -282,7 +287,7 @@ Custom Installation Logic
 ::
 
   install([[SCRIPT ] [CODE ]]
-  [COMPONENT ] [...])
+  [COMPONENT ] [EXCLUDE_FROM_ALL] [...])
 
 The ``SCRIPT`` form will invoke the given CMake script files during
 installation.  If the script file name is a relative path it will be
@@ -307,7 +312,8 @@ Installing Exports
   [PERMISSIONS permissions...]
   [CONFIGURATIONS [Debug|Release|...]]
   [EXPORT_LINK_INTERFACE_LIBRARIES]
-  [COMPONENT ])
+  [COMPONENT ]
+  [EXCLUDE_FROM_ALL])
 
 The ``EXPORT`` form generates and installs a CMake file containing code to
 import targets from the installation tree into another project.
-- 

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] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-01 Thread Nick Lewis
There is currently no way to exclude a component install() from a full
installation. Current workarounds using OPTIONAL do not work reliably
because they depend on previous builds and on the order of the execution of
the
build and install commands for the components and the default target

Let us take an example of a project that has some tests in a component that
need to be installed into a dedicated test package. The user expectation is
that the result could be achieved by typing the following:

 make
 make tests
 make install
 DESTDIR=/testpkgs make install-tests

However this results in test components in the default installation as well
as the testpkg

Judging by questions on the mail list, users typically try to overcome this
problem by adding the EXCLUDE_FROM_ALL keyword to the install() command but
this is currently unsupported. The patch uploaded to the issue tracker
provides support for it.

Brad has further suggested that the install(EXCLUDE_FROM_ALL) should be
implicitly set when installing components built with
add_executable/library(EXCLUDE_FROM_ALL)

I welcome your views on these ideas

https://cmake.org/Bug/view.php?id=14921

Best Regards
Nick

-- 
Nick Lewis
nick.le...@amag.com
+44 1684 277137 <+441684277137>
www.amag.com
AMAG Technology, Challenge House, International Drive, Tewkesbury Business
Park, TEWKESBURY, GL20 8UQ, U.K.

-- 



This company is part of the G4S group of companies. This communication 
contains information which may be confidential, personal and/or privileged. 
It is for the exclusive use of the intended recipient(s). If you are not 
the intended recipient(s), please note that any distribution, forwarding, 
copying or use of this communication or the information in it is strictly 
prohibited. Any personal views expressed in this e-mail are those of the 
individual sender and the Company does not endorse or accept responsibility 
for them. Prior to taking any action based upon this e-mail message, you 
should seek appropriate confirmation of its authenticity. This message has 
been checked for viruses on behalf of the Company.
-- 

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] How to link the output of a custom command (VS2013) when the output is an obj file, since LinkObjects is hardcoded to false?

2015-09-02 Thread Nick Georghiou
Hi,

 

I have the custom command provided below which successfully creates
mydll.obj in the correct intermediate directory. However the LinkObjects
property of the custom command within Visual Studio 2013 is set to false and
therefore the object file is not linked. Upon inspection of the CMake code,
it seems that the LinkObjects property is hardcoded to false and there is no
cmake option to specify otherwise.

 

Is there another way to get the object file to link that I am missing. Any
help on this would be greatly appreciated.

 

---

 

My custom command:

 

add_custom_command(

OUTPUT "$(IntDir)mydll.obj" 

COMMAND ml64.exe /c /nologo /Fo"$(IntDir)mydll.obj" /Zi "%(FullPath)" 

MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/mydll.asm)

 

---

 

CMake code in file cmVisualStudio10TargetGenerator.cxx:

 

if(this->LocalGenerator->GetVersion()

>
cmGlobalVisualStudioGenerator::VS10)

  {

  // VS >= 11 let us turn off linking of custom command outputs.

  this->WritePlatformConfigTag("LinkObjects", i->c_str(), 3);

  (*this->BuildFileStream ) << "false\n";

  }

}

 

 

-- 

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 link the output of a custom command (VS2013) when the output is an obj file, since LinkObjects is hardcoded to false?

2015-09-02 Thread Nick Georghiou
Hi,

 

Thanks for the quick reply. I enabled asm language and it now links. 

 

Apologies for the noob question; 

 

Thanks Nick

 

From: Hendrik Sattler [mailto:p...@hendrik-sattler.de] 
Sent: Wednesday, 2 September 2015 8:13 PM
To: ngeorgh...@iprimus.com.au; cmake@cmake.org
Subject: Re: [CMake] How to link the output of a custom command (VS2013) when 
the output is an obj file, since LinkObjects is hardcoded to false?

 

Hi,

why don't you just add the asm file to your add_library() call and enable the 
ASM language?

HS



Am 2. September 2015 09:21:11 MESZ, schrieb Nick Georghiou 
<ngeorgh...@iprimus.com.au>:

Hi,

 

I have the custom command provided below which successfully creates mydll.obj 
in the correct intermediate directory. However the LinkObjects property of the 
custom command within Visual Studio 2013 is set to false and therefore the 
object file is not linked. Upon inspection of the CMake code, it seems that the 
LinkObjects property is hardcoded to false and there is no cmake option to 
specify otherwise.

 

Is there another way to get the object file to link that I am missing. Any help 
on this would be greatly appreciated.

 

---

 

My custom command:

 

add_custom_command(

OUTPUT "$(IntDir)mydll.obj" 

COMMAND ml64.exe /c /nologo /Fo"$(IntDir)mydll.obj" /Zi "%(FullPath)" 

MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/mydll.asm)

 

---

 

CMake code in file cmVisualStudio10TargetGenerator.cxx:

 

if(this->LocalGenerator->GetVersion()

> cmGlobalVisualStudioGenerator::VS10)

  {

  // VS >= 11 let us turn off linking of custom command outputs.

  this->WritePlatformConfigTag("LinkObjects", i->c_str(), 3);

  (*this->BuildFileStream ) << "false\n";

  }

}

 

 

-- 

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-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2015-07-17 Thread Nick Lewis
There is currently no way to exclude a component install() from a full
installation. Current workarounds using OPTIONAL do not work reliably
because
they depend on previous builds and on the order execution of the build
and
install commands for the components and the default target

Steps to Reproduce:
make
make tests
make install
DESTDIR=/testpkgs make install-tests

This results in test components in the default installation as well as
the
testpkg

Judging by questions on the mail list, users typically try to overcome
this
problem by adding the unsupported EXCLUDE_FROM_ALL keyword to the install
command

  http://www.cmake.org/Bug/view.php?id=14921

Interesting proposal.  I think a change along these lines could also
improve a
case mentioned in the install() command documentation:

 http://www.cmake.org/cmake/help/v3.0/command/install.html
 Installing a target with the EXCLUDE_FROM_ALL target property set to
TRUE has
undefined behavior.

That refers to the use case when a target build is EXCLUDE_FROM_ALL and
so is
not created by make and may then be missing when make install is
issued.
This looks intended to support the same use case by making the install
rule
excluded from the default installation too.  Perhaps install(TARGETS)
should
activate ExcludeFromAll when the corresponding property is set on the
target.


Rebased patch on 3.2.2. Still no automatic setting of
install(EXCLUDE_FROM_ALL)
based on the setting of add_executable(EXCLUDE_FROM_ALL) though

Thanks for working on this.  I think it will be better discussed on the
cmake-developers mailing list:

 http://www.cmake.org/mailman/listinfo/cmake-developers

That allows for design discussion with a broader audience than the issue

-- 



This company is part of the G4S group of companies. This communication 
contains information which may be confidential, personal and/or privileged. 
It is for the exclusive use of the intended recipient(s). If you are not 
the intended recipient(s), please note that any distribution, forwarding, 
copying or use of this communication or the information in it is strictly 
prohibited. Any personal views expressed in this e-mail are those of the 
individual sender and the Company does not endorse or accept responsibility 
for them. Prior to taking any action based upon this e-mail message, you 
should seek appropriate confirmation of its authenticity. This message has 
been checked for viruses on behalf of the Company.
-- 

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] install target added with add_subdirectory(EXCLUDE_FROM_ALL)

2015-04-15 Thread Nick Tasios

Hello everyone,

I recently started using cmake and I'm having some trouble setting-up my 
project. I've searched quite a lot and couldn't find a clear answer.


The project has a top level CMakeLists.txt which builds the executable. 
In my project, I have included  external libraries which I add using 
add_subdirectory. Most of these already came with a CMakeLists.txt file, 
and some have multiple targets, i.e. to build shared or static 
libraries, etc. In the project, though, I want to be able to choose only 
a specific target to build, i.e. I might only want to build the shared 
libraries. To do this, I add the option EXCLUDE_FROM_ALL when calling 
add_subdirectory, and just add the target to the target link libraries 
of the top-level executable.


This works fine, only in the install step I would like for the built 
libraries to move to where the executable is. From my understanding, the 
install directive of the sub projects is ignored, because install 
depends on all and these sub projects are excluded from it.


So the question is, if there is a clean way to compile only the targets 
(libraries) that are needed by the executable, and be able to install 
these in the directory the executable is being installed. The method 
needs to work cross-platform.


Cheers!
--

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 generates Makefiles that don't parallelize as much as they could.

2014-07-30 Thread Nick Overdijk
Here's the sample code:
https://github.com/NickNick/cmake-interface-includes/commits/master . The
second commit breaks the build. I sort of understand why it does, but that
means I can't use the INTERFACE-trick, so to say, even with static
libraries.

Thanks for linking the other bug.


On Mon, Jul 28, 2014 at 4:19 PM, Brad King brad.k...@kitware.com wrote:

 On 07/24/2014 05:47 PM, Nick Overdijk wrote:
  I'm using target_include_directories of A to get some include
  directories into B well, so I can't use
  target_link_libraries(A INTERFACE B),

 Can you clarify this with sample code please?

  and I can't seem to use the OBJECT-way neither since B's sources
  won't compile without A's INTERFACE_INCLUDE_DIRECTORIES...

 Usage requirements were designed with target_link_libraries as
 the main way to propagate them, but OBJECT libraries do not allow
 use with target_link_libraries.  This is an open problem with the
 design of the two features.  See also discussion here:

  http://www.cmake.org/Bug/view.php?id=14970

 -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-developers] CMake generates Makefiles that don't parallelize as much as they could.

2014-07-30 Thread Nick Overdijk
True, I was just bothered by it when we got distcc running with a good
amount of cores. Thanks for your effort. :) I'll try and make something
with the things I've learned (I'm thinking of making some functions that
propagate usage requirements yet link with INTERFACE or something along
those lines, of course only usable for static libs).


On Wed, Jul 30, 2014 at 4:51 PM, Brad King brad.k...@kitware.com wrote:

 On 07/30/2014 05:31 AM, Nick Overdijk wrote:
  https://github.com/NickNick/cmake-interface-includes/commits/master

 Thanks.  For reference, the summary is:

  cmake_minimum_required(VERSION 2.8.12)
  project(FOO CXX)
  add_library(foo foo/foo.cpp)
  target_include_directories(foo INTERFACE foo)
  add_library(bar bar/bar.cpp)
  target_link_libraries(bar foo) # reduces parallel compilation
  #target_link_libraries(bar INTERFACE foo) # compiles bar without foo reqs

 With CMake 3.0 you might be able to hack something up with INTERFACE
 libraries, but that will increase complexity.

 The INTERFACE workaround commented out in the above example is really
 only good when no usage requirements need to be propagated.  Otherwise,
 I think you're stuck with the reduced parallelism until CMake can be
 taught to detect when it is safe to drop such dependencies as I
 explained earlier.  FWIW, I've been building large projects this way
 for years and rarely been bothered by this.  Usually each library has
 so many sources that parallelism within each target is enough.

 -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-developers] CMake generates Makefiles that don't parallelize as much as they could.

2014-07-24 Thread Nick Overdijk
I'm using target_include_directories of A to get some include directories
into B well, so I can't use target_link_libraries(A INTERFACE B), and I
can't seem to use the OBJECT-way neither since B's sources won't compile
without A's INTERFACE_INCLUDE_DIRECTORIES... Any suggestions?


On Wed, Jul 23, 2014 at 3:19 PM, Nick Overdijk n...@astrant.net wrote:

 Crystal clear. Another layer of indirection eh? I'll see if I can work
 with that... Thanks for the explanation.


 On Wed, Jul 23, 2014 at 3:14 PM, Brad King brad.k...@kitware.com wrote:

 On 07/23/2014 09:07 AM, Nick Overdijk wrote:
  Oh wait, since a is in the interface of b, b will always be
  accompanied by a, even though it's not a dependency.
  Is that how it works?

 Yes.  If B is a static library then it does not really link so
 its dependencies are only ever used transitively when something
 else links to B.  If B really links as a shared library though
 then see the following.

 If target B links to target A then CMake will not compile objects
 in B until A is done.  As explained in my previous link this is
 because we allow A to contain custom commands that generate
 headers used by B.  The VS and Xcode IDE build systems offer only
 this granularity since they organize compilation and linking rules
 of a single target together.  The Makefile generator was designed
 this way too.  Only the Ninja generator has a chance of increasing
 parallelism if the extra ordering dependencies were dropped.  We've
 thought about how to do extra analysis to determine when there is
 no such custom command to drop them but have not implemented anything
 yet.

 You might be able to use OBJECT libraries to increase parallelism
 for all generators and with no changes to CMake:

  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  add_library(Aobjs OBJECT a1.c a2.c)
  add_library(Bobjs OBJECT b1.c b2.c)
  add_library(Cobjs OBJECT c1.c c2.c)
  set(dummy_c dummy.c) # needed for VS 6 and Xcode
  add_library(A SHARED $TARGET_OBJECTS:Aobjs ${dummy_c})
  add_library(B SHARED $TARGET_OBJECTS:Bobjs ${dummy_c})
  add_library(C SHARED $TARGET_OBJECTS:Cobjs ${dummy_c})
  target_link_libraries(B PUBLIC A)
  target_link_libraries(C PUBLIC B)

 This way the object compilations will be completely independent
 of one another and of the linking and ordering dependencies.

 -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] CMake generates Makefiles that don't parallelize as much as they could.

2014-07-23 Thread Nick Overdijk
Hey guys,

With this https://github.com/NickNick/cmake-dependency-waiting code here,
why do b wait for a and c wait for b to be build? The object files could
all be build in parallel right? Not doing it is making my distcc-cluster
less and less useful the more nodes I add. Is there a way to fix or work
around this?

Cheers,
-- 

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] CMake generates Makefiles that don't parallelize as much as they could.

2014-07-23 Thread Nick Overdijk
Thanks for the quick reply, but what if c needs b and b needs a? Adding
INTERFACE will then break the build of course, right, since b isn't
really linked to a... Or am I mistaken?


On Wed, Jul 23, 2014 at 2:36 PM, Brad King brad.k...@kitware.com wrote:

 On 07/23/2014 08:00 AM, Nick Overdijk wrote:
  With this https://github.com/NickNick/cmake-dependency-waiting code
 here, why do b wait for a and c wait for b to be build? The object files
 could all be build in parallel right? Not doing it is making my
 distcc-cluster less and less useful the more nodes I add. Is there a way to
 fix or work around
  this?

 See here:

  http://www.cmake.org/Bug/view.php?id=14726#c35021
  http://www.cmake.org/Bug/view.php?id=14726#c35023

 -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-developers] CMake generates Makefiles that don't parallelize as much as they could.

2014-07-23 Thread Nick Overdijk
Oh wait, since a is in the interface of b, b will always be accompanied by
a, even though it's not a dependency. Is that how it works?


On Wed, Jul 23, 2014 at 2:58 PM, Nick Overdijk n...@astrant.net wrote:

 Thanks for the quick reply, but what if c needs b and b needs a? Adding
 INTERFACE will then break the build of course, right, since b isn't
 really linked to a... Or am I mistaken?


 On Wed, Jul 23, 2014 at 2:36 PM, Brad King brad.k...@kitware.com wrote:

 On 07/23/2014 08:00 AM, Nick Overdijk wrote:
  With this https://github.com/NickNick/cmake-dependency-waiting code
 here, why do b wait for a and c wait for b to be build? The object files
 could all be build in parallel right? Not doing it is making my
 distcc-cluster less and less useful the more nodes I add. Is there a way to
 fix or work around
  this?

 See here:

  http://www.cmake.org/Bug/view.php?id=14726#c35021
  http://www.cmake.org/Bug/view.php?id=14726#c35023

 -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-developers] CMake generates Makefiles that don't parallelize as much as they could.

2014-07-23 Thread Nick Overdijk
Crystal clear. Another layer of indirection eh? I'll see if I can work with
that... Thanks for the explanation.


On Wed, Jul 23, 2014 at 3:14 PM, Brad King brad.k...@kitware.com wrote:

 On 07/23/2014 09:07 AM, Nick Overdijk wrote:
  Oh wait, since a is in the interface of b, b will always be
  accompanied by a, even though it's not a dependency.
  Is that how it works?

 Yes.  If B is a static library then it does not really link so
 its dependencies are only ever used transitively when something
 else links to B.  If B really links as a shared library though
 then see the following.

 If target B links to target A then CMake will not compile objects
 in B until A is done.  As explained in my previous link this is
 because we allow A to contain custom commands that generate
 headers used by B.  The VS and Xcode IDE build systems offer only
 this granularity since they organize compilation and linking rules
 of a single target together.  The Makefile generator was designed
 this way too.  Only the Ninja generator has a chance of increasing
 parallelism if the extra ordering dependencies were dropped.  We've
 thought about how to do extra analysis to determine when there is
 no such custom command to drop them but have not implemented anything
 yet.

 You might be able to use OBJECT libraries to increase parallelism
 for all generators and with no changes to CMake:

  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  add_library(Aobjs OBJECT a1.c a2.c)
  add_library(Bobjs OBJECT b1.c b2.c)
  add_library(Cobjs OBJECT c1.c c2.c)
  set(dummy_c dummy.c) # needed for VS 6 and Xcode
  add_library(A SHARED $TARGET_OBJECTS:Aobjs ${dummy_c})
  add_library(B SHARED $TARGET_OBJECTS:Bobjs ${dummy_c})
  add_library(C SHARED $TARGET_OBJECTS:Cobjs ${dummy_c})
  target_link_libraries(B PUBLIC A)
  target_link_libraries(C PUBLIC B)

 This way the object compilations will be completely independent
 of one another and of the linking and ordering dependencies.

 -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] Patch: Add EXCLUDE_FROM_ALL to install() command

2014-05-15 Thread Lewis, Nick
There is currently no way to exclude a specific install from a full 
installation. Users often attempt to do so by adding EXCLUDE_FROM_ALL as per 
add_executable()/add_library(). This patch adds support for EXCLUDE_FROM_ALL to 
the install() command so that users can exclude it from a full installation.

Best Regards
Nick

Nick Lewis
nick.le...@usa.g4s.commailto:nick.le...@usa.g4s.com
+44 1684 277137tel:+441684277137
www.g4stechnology.comhttp://www.g4stechnology.com/
New Challenge House, International Drive, Tewkesbury, Gloucestershire, GL20 
8UQ, UK

P Please consider the environment before printing this email



The details of this company are as follows:
G4S Technology Limited, Registered Office: Challenge House, International 
Drive, Tewkesbury, Gloucestershire GL20 8UQ, Registered in England No. 2382338.

This communication may contain information which is confidential, personal 
and/or privileged.

It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, 
forwarding, copying or use of this communication or the information in it is 
strictly prohibited.

Any personal views expressed in this e-mail are those of the individual sender 
and the company does not endorse or accept responsibility for them.

Prior to taking any action based upon this e-mail message, you should seek 
appropriate confirmation of its authenticity.

This e-mail has been scanned for all viruses by MessageLabs.


cmake_install_exclude.patch
Description: cmake_install_exclude.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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] cmake-2.8.12: generator expression error when linker flags have comma

2013-10-20 Thread Nick Hutchinson
target_link_libraries() is supposed to work for linker flags as well:

cmake version 2.8.12
  target_link_libraries
   Link a target to given libraries.

 target_link_libraries(target [item1 [item2 [...]]]
   [[debug|optimized|general] item] ...)

   Specify libraries or flags to use when linking a given target.  The
   named target must have been created in the current directory by a
   command such as add_executable or add_library.  The remaining
   arguments specify library names or flags.


On 20 Oct 2013, at 09:13, Rolf Eike Beer e...@sf-mail.de wrote:

 Am Samstag, 19. Oktober 2013, 18:01:55 schrieb Jed Brown:
 I just upgraded from cmake-2.8.11.2 to 2.8.12 and now get errors when a
 comma ',' appears in a linker flag.  Test case below.  Note that this is
 but one of many reasons for a comma to appear in linker flags.
 
 https://gist.github.com/jedbrown/7062540
 
$ mkdir build  cd build
$ cmake -DDEP_LIBS:STRING='-Wl,--start-group -llapack -lblas
 -Wl,--end-group' ..
 
 target_link_libraries(foo ${DEP_LIBS})
 
 target_link_libraries is about libraries. No wonder it breaks if you pass 
 other stuff in there. I wonder if using FindBLAS and FindLAPACK would help 
 you 
 out of that.
 
 Eike--
 
 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://www.cmake.org/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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Faking a library

2013-10-19 Thread Nick Hutchinson
As of 2.8.12, you can set target properties on an imported library to
specify its include directories, compile options etc, and these will be
automatically propagated to any other target that links to it via
target_link_libraries(). No more tedious faffing about with global
variables like GTEST_INCLUDE_DIRS, GTEST_LIBRARIES etc. It's really quite
nice.

Check the 2.8.12 CMake docs for target properties that start with
INTERFACE.

Nick


On 19 October 2013 08:59, Magnus Therning mag...@therning.org wrote:

 On Sat, Oct 19, 2013 at 11:28:53AM +0400, Игорь Пашев wrote:
  2013/10/19 Magnus Therning mag...@therning.org:
   Is it possible to put the include path in some property on the library
   as well, to avoid using a separate variable for that?
 
  SET_TARGET_PROPERTIES (target PROPERTIES VARIABLE-NAME
 VARIABLE-VALUE)

 Of course, but then how do I use it conveniently?

 Would it be possible, by choosing a good property name, to simply do

 target_include_directories(one_test PRIVATE
 target
 )

 Or would I have to

 get_target_property(INC_DIR target variable-name)
 target_include_directories(one_test PRIVATE
 ${INC_DIR}
 )

 in which case using a property wouldn't give me very much.

 /M

 --
 Magnus Therning  OpenPGP: 0xAB4DFBA4
 email: mag...@therning.org   jabber: mag...@therning.org
 twitter: magthe   http://therning.org/magnus

 The British have the perfect temperament to be hackers--technically
 skilled, slightly disrespectful of authority, and just a touch of
 criminal behavior.
  -- Mary Ann Davidson, Oracle's Security Chief

 --

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

Re: [CMake] find_package(mpi) language specification

2013-09-05 Thread Nick Overdijk
You can pass the QUIET parameter to find_package... that'll at least shut it 
up. Perhaps easiest in your case.

On 2013-05-09, at 18:22:25 , Andrew Corrigan wrote:

 Hello,
 
 My C++ code only uses the MPI C library. 
 
 1. Is there a way to tell find_package(MPI) to only look for the C version?
 2. If not, can FindMPI.cmake be changed to support this (just like with Boost 
 you can specify only the components you need)
 3. If not, can that warning message  Could NOT find MPI_CXX missing: 
 MPI_CXX_LIBRARIES MPI_CXX_INCLUDE_PATH be suppressed?  It is *extremely* 
 confusing to users.
 
 More info:
 
 The language-specific detection for MPI that was added a few versions ago has 
 been a huge help in avoiding linking with the deprecated MPI C++ library.  I 
 still have a problem, and that is find_package(MPI) still attempts to find 
 the MPI C++ library.
 
 When it is not found, which is more often than not the case on the various 
 HPC systems this code runs on, the warning Could NOT find MPI_CXX missing: 
 MPI_CXX_LIBRARIES MPI_CXX_INCLUDE_PATH is issued.  I do not want CMake to 
 even try to detect the C++ version of MPI, and this has been a major source 
 of confusion for users of this code, since they think that something has gone 
 wrong and report it to me. In response to this, I added the following 
 clarification, but despite this, users remain confused.
 
 if(NOT MPI_CXX_FOUND)
 message(STATUS == MPI_CXX_* IS NOT REQUIRED)
 message(STATUS == IGNORE ANY WARNING REGARDING MPI_CXX_*)
 end
 
 
 Thanks,
 Andrew Corrigan
 
 --
 
 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://www.cmake.org/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://www.cmake.org/mailman/listinfo/cmake


[CMake] Sharing sources between two targets

2013-04-22 Thread Nick Gnedin


Folks,

I am using CMake to create 2 targets - a stand-alone executable and a 
library that can be imported by Python. Both share most of the sources. 
If I just specify them as two separate targets, each will compile all 
the sources, so most of the source files end up compiled twice.


Is there a way to share the compiled sources between the two targets? I 
can create an intermediate library, but that is less convenient since 
the executable will then depend on it. What I would really like is to 
have a self-contained executable and a separate library that use the 
same object files.


Many thanks for any hint,

Nick Gnedin
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Sharing sources between two targets

2013-04-22 Thread Nick Gnedin


That doubles the size of the executable, because if I do something like 
that:


ADD_LIBRARY(temp STATIC ${sources})
TARGET_LINK_LIBRARIES(temp outside_deps)

ADD_EXECUTABLE(code main.cpp)
TARGET_LINK_LIBRARIES(code temp)

then TARGET_LINK_LIBRARIES(...) also add outside_deps as link libraries 
for code, so they end up included twice.




On 04/22/2013 01:50 PM, Jean-Christophe Fillion-Robin wrote:

Hi Nick,

What about creating a static library that would be linked against both
the executable and the library ?

Hth
Jc


On Mon, Apr 22, 2013 at 2:45 PM, Nick Gnedin ngne...@gmail.com
mailto:ngne...@gmail.com wrote:


Folks,

I am using CMake to create 2 targets - a stand-alone executable and
a library that can be imported by Python. Both share most of the
sources. If I just specify them as two separate targets, each will
compile all the sources, so most of the source files end up compiled
twice.

Is there a way to share the compiled sources between the two
targets? I can create an intermediate library, but that is less
convenient since the executable will then depend on it. What I would
really like is to have a self-contained executable and a separate
library that use the same object files.

Many thanks for any hint,

Nick Gnedin
--

Powered by www.kitware.com http://www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/__opensource/opensource.html
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/__CMake_FAQ
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/__listinfo/cmake
http://www.cmake.org/mailman/listinfo/cmake




--
+1 919 869 8849

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Sharing sources between two targets

2013-04-22 Thread Nick Gnedin


Indeed everything works that way, many thanks, guys.



On 04/22/2013 02:09 PM, David Cole wrote:

No, it doesn't double anything.

Without the outside_deps, the executable wouldn't link if it needed
something from them.

With them, it will link, and be as small a size as the linker can make
it. (Assuming a release build, where the linker leaves out what it
doesn't need...)



-Original Message-
From: Nick Gnedin ngne...@gmail.com
Cc: CMake ML cmake@cmake.org
Sent: Mon, Apr 22, 2013 2:55 pm
Subject: Re: [CMake] Sharing sources between two targets



That doubles the size of the executable, because if I do something like
that:

ADD_LIBRARY(temp STATIC ${sources})
TARGET_LINK_LIBRARIES(temp outside_deps)

ADD_EXECUTABLE(code main.cpp)
TARGET_LINK_LIBRARIES(code temp)

then TARGET_LINK_LIBRARIES(...) also add outside_deps as link libraries
for code, so they end up included twice.



On 04/22/2013 01:50 PM, Jean-Christophe Fillion-Robin wrote:

Hi Nick,

What about creating a static library that would be linked against both
the executable and the library ?

Hth
Jc


On Mon, Apr 22, 2013 at 2:45 PM, Nick Gnedin ngne...@gmail.com
mailto:ngne...@gmail.com wrote:


 Folks,

 I am using CMake to create 2 targets - a stand-alone executable

and

 a library that can be imported by Python. Both share most of the
 sources. If I just specify them as two separate targets, each will
 compile all the sources, so most of the source files end up

compiled

 twice.

 Is there a way to share the compiled sources between the two
 targets? I can create an intermediate library, but that is less
 convenient since the executable will then depend on it. What I

would

 really like is to have a self-contained executable and a separate
 library that use the same object files.

 Many thanks for any hint,

 Nick Gnedin
 --

 Powered by www.kitware.com http://www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/__opensource/opensource.html
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/__CMake_FAQ
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/__listinfo/cmake
 http://www.cmake.org/mailman/listinfo/cmake




--
+1 919 869 8849

--

Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake




--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Updated code in header file ignored?

2013-03-17 Thread Nick Overdijk
Howdy,

I have a header file, vertices.hpp with some not-inline function-definitions 
(yes really defs not decls), and a project, beamer. Sometimes when I change 
vertices.hpp, the changes don't reflect in the binary. I was wondering why this 
is, so I grepped a bit in my build-dir:

./motor/CMakeFiles/motor.dir/CXX.includecache:1224:vertices.hpp
./motor/CMakeFiles/motor.dir/CXX.includecache:1225:/Users/nick/Documents/Code/new-onegame/motor/basic/vertices.hpp
./motor/CMakeFiles/motor.dir/CXX.includecache:1241:/Users/nick/Documents/Code/new-onegame/motor/basic/vertices.hpp
./motor/CMakeFiles/motor.dir/depend.internal:438: 
/Users/nick/Documents/Code/new-onegame/motor/basic/vertices.hpp
./motor/CMakeFiles/motor.dir/depend.internal:558: 
/Users/nick/Documents/Code/new-onegame/motor/basic/vertices.hpp
./motor/CMakeFiles/motor.dir/depend.make:437:motor/CMakeFiles/motor.dir/basic/mesh.cpp.o:
 ../motor/basic/vertices.hpp
./motor/CMakeFiles/motor.dir/depend.make:557:motor/CMakeFiles/motor.dir/basic/resource_cache.cpp.o:
 ../motor/basic/vertices.hpp
./src/CMakeFiles/beamer.dir/CXX.includecache:116:vertices.hpp
./src/CMakeFiles/beamer.dir/CXX.includecache:117:../src/../motor/basic/vertices.hpp
./src/CMakeFiles/beamer.dir/CXX.includecache:1462:vertices.hpp

And that's all mentions of vertices.hpp in beamer. Shouldn't I see vertices.hpp 
also in the depend.make or something?

Any other tips/suggestions/questions are more more more than welcome since this 
has been annoying me for quite some time.

Thanks in advance, 
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FInd threads - iOS

2013-03-14 Thread Nick Overdijk
You should install boost in /usr/local with ./b2 install, then more packages 
will find it. Did you do this or not?

Anyway, I just did this:

git clone git://github.com/SOCI/soci.git
cd soci
cd src
mkdir build
cd build
cmake ..

And it worked for me. So what did you do exactly?

On 2013-14-03, at 18:52:08 , Casey Basichis wrote:

 Hi,
 
 I'm tryng to build SOCI on iOS.  I was able to enter my boost path in my 
 ~/.profile to get that running, but I'm getting stuck on finding threads.
 
 -- Could NOT find Threads (missing:  Threads_FOUND) 
 CMake Error at core/CMakeLists.txt:22 (message): 
   No thread library found 
 
 Is there a way to set a path manually to a threading library like I did with 
 boost?  What can I do to get this building?
 
 Thanks,
 Casey
 
 -- 
 Casey James Basichis
 Composer - Adventure Time - Cartoon Network
 http://www.caseyjamesbasichis.com
 caseybasic...@gmail.com
 310.387.7540
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Build several targets using cmake --build dir

2013-03-14 Thread Nick Overdijk
You can only 'cmake' a single-target. If you want to have more targets, create 
more directories: for each target one.

On 2013-14-03, at 19:07:36 , John Drescher wrote:

 I use cmake 2.8.10 on windows.
 
 
 
 I would like to build several targets with cmake --build dir so  the
 underlying build tool to do parallel jobs.
 
 
 
 Currently it only seems to be possible to build one target at a time, using
 --target .
 (http://www.cmake.org/cmake/help/v2.8.10/cmake.html#opt:--builddir)
 
 
 
 Can someone tell me how I could achieve that with current cmake version?
 
 
 I execute more than 1 cmake --build at the same time on windows. I
 actually do this in a program called runjobs
 
 http://www.codeproject.com/Articles/25810/Run-All-Jobs-at-Once-Utility
 
 John
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FInd threads - iOS

2013-03-14 Thread Nick Overdijk
Hmm, well I think you're missing some variables. The buildscript up on the site 
could use some updates, but that should be your ticket.

On 2013-14-03, at 19:10:08 , Casey Basichis wrote:

 Hi,
 
 I followed your instructions.
 
 I also modified the make files a bit according to this - 
 http://ares.lids.mit.edu/redmine/projects/forest-game/wiki/Building_soci_for_iOS
 Though I'm not using their scripts.
 
 I compiled to 386:Arm7 fat target.  Here are the errors I get.  The thread 
 bits are at the bottom.  Everything else seem ok - though the printed out 
 data suggest the compiler is not clang, it seems to be using it.
 
 cmake 
 -DIOS_INCLUDE_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include
  -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_OSX_ARCHITECTURES=i386;armv7 
 -DSOCI_EMPTY=OFF -DSOCI_MYSQL=OFF -DSOCI_ODBC=OFF -DSOCI_ORACLE=OFF 
 -DSOCI_POSTGRESQL=OFF -DSOCI_SQLITE3=ON -DSOCI_TESTS=OFF ../
 
 -- The C compiler identification is Clang 4.2.0
 -- The CXX compiler identification is Clang 4.2.0
 -- Check for working C compiler: /usr/bin/cc
 -- Check for working C compiler: /usr/bin/cc -- works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - failed
 -- Check for working CXX compiler: /usr/bin/clang++
 -- Check for working CXX compiler: /usr/bin/clang++ -- works
 -- Detecting CXX compiler ABI info
 -- Detecting CXX compiler ABI info - failed
 -- Configuring SOCI: 
 -- SOCI_VERSION = 3.2.0 
 -- SOCI_ABI_VERSION = 3.2 
 -- SOCI_PLATFORM_NAME   = x86 
 -- SOCI_COMPILER_NAME   = gcc-4.2.1 
 -- SOCI_STATIC  = ON 
 -- SOCI_TESTS   = OFF 
 -- Looking for SOCI dependencies: 
 -- Boost: 
 -- Boost_RELEASE_VERSION= 1.52.0 
 -- Boost_INCLUDE_DIR= /Prog/Frameworks/boost_1_52_0 
 -- Boost_LIBRARIES  =  
 -- MySQL: 
 -- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION
 -- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION - Failed
 -- MySQL not found.
 -- MySQL Embedded not found.
 -- WARNING: 
 -- MySQL not found, some libraries or features will be disabled. 
 -- See the documentation for MySQL or manually set these variables: 
 -- MYSQL_INCLUDE_DIR= MYSQL_INCLUDE_DIR-NOTFOUND 
 -- MYSQL_LIBRARIES  = MYSQL_LIBRARIES-NOTFOUND 
 -- ODBC: 
 -- ODBC_INCLUDE_DIR = /usr/include 
 -- ODBC_LIBRARIES   = /usr/lib/libiodbc.dylib 
 -- Oracle: 
 -- WARNING: 
 -- Oracle not found, some libraries or features will be disabled. 
 -- See the documentation for Oracle or manually set these variables: 
 -- ORACLE_INCLUDE_DIR   =  
 -- ORACLE_LIBRARIES =  
 -- PostgreSQL: 
 -- POSTGRESQL_INCLUDE_DIR   = /usr/include 
 -- POSTGRESQL_LIBRARIES = /usr/lib/libpq.dylib 
 -- POSTGRESQL_VERSION   = 9.1.4 
 -- SQLite3: 
 -- SQLITE3_INCLUDE_DIR  = /usr/include 
 -- SQLITE3_LIBRARIES= /usr/lib/libsqlite3.dylib 
 -- Firebird: 
 -- WARNING: 
 -- Firebird not found, some libraries or features will be disabled. 
 -- See the documentation for Firebird or manually set these variables: 
 -- FIREBIRD_INCLUDE_DIR = FIREBIRD_INCLUDE_DIR-NOTFOUND 
 -- FIREBIRD_LIBRARIES   = FIREBIRD_LIBRARIES-NOTFOUND 
 -- FIREBIRD_VERSION =  
 -- DB2: 
 -- WARNING: 
 -- DB2 not found, some libraries or features will be disabled. 
 -- See the documentation for DB2 or manually set these variables: 
 -- DB2_INCLUDE_DIR  = DB2_INCLUDE_DIR-NOTFOUND 
 -- DB2_LIBRARIES= DB2_LIBRARY-NOTFOUND 
 -- Configuring SOCI core library: 
 -- Looking for include file pthread.h
 -- Looking for include file pthread.h - not found
 -- Could NOT find Threads (missing:  Threads_FOUND) 
 CMake Error at core/CMakeLists.txt:22 (message):
   No thread library found
 
 
 -- Configuring incomplete, errors occurred!
 
 
 
 
 On Thu, Mar 14, 2013 at 11:01 AM, Nick Overdijk n...@astrant.net wrote:
 You should install boost in /usr/local with ./b2 install, then more packages 
 will find it. Did you do this or not?
 
 Anyway, I just did this:
 
 git clone git://github.com/SOCI/soci.git
 cd soci
 cd src
 mkdir build
 cd build
 cmake ..
 
 And it worked for me. So what did you do exactly?
 
 On 2013-14-03, at 18:52:08 , Casey Basichis wrote:
 
 Hi,
 
 I'm tryng to build SOCI on iOS.  I was able to enter my boost path in my 
 ~/.profile to get that running, but I'm getting stuck on finding threads.
 
 -- Could NOT find Threads (missing:  Threads_FOUND) 
 CMake Error at core/CMakeLists.txt:22 (message): 
   No thread library found 
 
 Is there a way

Re: [CMake] Setting XCode Runtime Search Path

2013-02-19 Thread Nick Overdijk
Dakon, Don't know his real name, sorry, wrote something for this, you can get 
it here:

git://anongit.kde.org/scratch/dakon/cmake-cxx11

On 2013-20-02, at 01:17:28 , Alexey Petruchik wrote:

 Hi, I'm doing this by adding:
 set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS 
 @executable_path/../Frameworks)
 to my CMakeLists.txt. Not sure that this is the way it should be done but at 
 least it works ;)
 
 Regards, Alexey
 
 
 On Wed, Feb 20, 2013 at 1:13 AM, Darrell Blake darrell.bl...@gmail.com 
 wrote:
 Is there any way to set the XCode Runtime Search Path linker setting? I've 
 got a framework that was built using @rpath so I'm having to set the Runtime 
 Search Path setting to @executable_path/../Frameworks so it can be found. I 
 just wondered if there was any way to set it from CMake.
 
 Darrell
 
 
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
 
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Best way to 'pull through' dependencies of External projects?

2013-02-14 Thread Nick Overdijk
I don't really get your specific problem... CMake can find and install ITK and 
DCMTK just fine here? (I had to manipulate the linker-order of DCMTK a bit but 
that's almost to be expected, sadly).

You're saying that when you find_package(DCMTK) it's libraries doesn't include 
some library it needs?

On 2013-14-02, at 16:45:12 , Kent Williams wrote:

 The specific problem I'm trying to solve:
 
 Build DCMTK library, along with libraries upon which it depends, for use by 
 ITK as a 'system library'
 
 The problem: Setting up the External Projects is simple enough; the problem 
 is that the revision/configuration of TIFF -- 3.9.4 -- by default requires 
 ZLib.
 
 DCMTK builds against this external TIFF library just fine.
 
 What doesn't happen?  The TIFF's ZLib dependency doesn't get propogated to 
 builds that depend on DCMTK, so Zlib is not on the DCMTK library list.
 
 This wouldn't be a problem if TIFF and DCMTK were proper CMake builds. If 
 they were when they export their libraries, find_package would carry along 
 the dependencies of the imported libraries.
 
 There doesn't appear to be either an elegant or a quick  dirty solution to 
 this. The problem is that until DCMTK creates proper CMake config files that 
 clue in ITK to DCMTK's own dependencies, ITK's own CMake config files will 
 not reflect those dependencies.
 
 Suggestions?
 
 Oh, and by the way I am trying to get DCMTK to generate proper configuration 
 files for find_package(NO_MODULE): 
 https://github.com/InsightSoftwareConsortium/DCMTK/tree/AddProperConfig
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Best way to 'pull through' dependencies of External projects?

2013-02-14 Thread Nick Overdijk
So patch FindDCMTK/FindTIFF in such a way that it add zlib to the dependencies, 
use that, and send the patch to your local maintainer?

On 2013-14-02, at 17:01:53 , Kent Williams wrote:

 @Nick find_package(DCMTK) does an OK job.  The specific issue I ran into is 
 that TIFF depends on Zlib and that dependency isn't pulled through into 
 DCMTK's dependencies.
 
 The FindDCMTK.cmake that is in the current CMake distro has issues.  
 
 @Ansis -- if all I cared about was getting one package built, I would do what 
 you suggest.  But I am trying to build robust CMake infrastructure here, that 
 will be useful beyond the one project I'm starting with.
 
 
 
 On Thu, Feb 14, 2013 at 9:54 AM, Ansis Māliņš ansis.mal...@gmail.com wrote:
 If I guessed right, your problem is linker errors when building your project. 
 My solution is to just manually add whatever extra target_link_libraries are 
 needed to shut the linker up and move on.
 
 
 On Thu, Feb 14, 2013 at 5:48 PM, Nick Overdijk n...@astrant.net wrote:
 I don't really get your specific problem... CMake can find and install ITK 
 and DCMTK just fine here? (I had to manipulate the linker-order of DCMTK a 
 bit but that's almost to be expected, sadly).
 
 You're saying that when you find_package(DCMTK) it's libraries doesn't 
 include some library it needs?
 
 On 2013-14-02, at 16:45:12 , Kent Williams wrote:
 
 The specific problem I'm trying to solve:
 
 Build DCMTK library, along with libraries upon which it depends, for use by 
 ITK as a 'system library'
 
 The problem: Setting up the External Projects is simple enough; the problem 
 is that the revision/configuration of TIFF -- 3.9.4 -- by default requires 
 ZLib.
 
 DCMTK builds against this external TIFF library just fine.
 
 What doesn't happen?  The TIFF's ZLib dependency doesn't get propogated to 
 builds that depend on DCMTK, so Zlib is not on the DCMTK library list.
 
 This wouldn't be a problem if TIFF and DCMTK were proper CMake builds. If 
 they were when they export their libraries, find_package would carry along 
 the dependencies of the imported libraries.
 
 There doesn't appear to be either an elegant or a quick  dirty solution to 
 this. The problem is that until DCMTK creates proper CMake config files that 
 clue in ITK to DCMTK's own dependencies, ITK's own CMake config files will 
 not reflect those dependencies.
 
 Suggestions?
 
 Oh, and by the way I am trying to get DCMTK to generate proper configuration 
 files for find_package(NO_MODULE): 
 https://github.com/InsightSoftwareConsortium/DCMTK/tree/AddProperConfig
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
 
 
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
 
 

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Dependency for launching an application

2013-02-08 Thread Nick Overdijk
Can't you only launch parent.exe in VS and remove the dependency?

On 2013-08-02, at 12:19:56 , Andreas Haferburg wrote:

 In our build, we have two executables, parent.exe launches child.exe as a 
 child process. ATM the build is set up with add_dependencies(parent child). 
 So when using F5 in Visual Studio, child.exe is built first, then parent.exe, 
 then parent.exe is launched. Is it possible to set this up such that 
 child.exe and parent.exe are built in parallel before launching parent?
 
 Regards
 Andreas
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Dependency for launching an application

2013-02-08 Thread Nick Overdijk
Well cmake will take care of that if you target_link_library(common), right?

On 2013-08-02, at 12:50:13 , Andreas Haferburg wrote:

 Right, sorry. I should have mentioned that they both depend on some library 
 common.lib. When that library has to be rebuilt, both exes need to be 
 rebuilt, too.
 
 Andreas
 
 
 On 08.02.2013 12:21, Nick Overdijk wrote:
 Can't you only launch parent.exe in VS and remove the dependency?
 
 On 2013-08-02, at 12:19:56 , Andreas Haferburg wrote:
 
 In our build, we have two executables, parent.exe launches child.exe as a 
 child process. ATM the build is set up with add_dependencies(parent child). 
 So when using F5 in Visual Studio, child.exe is built first, then 
 parent.exe, then parent.exe is launched. Is it possible to set this up such 
 that child.exe and parent.exe are built in parallel before launching parent?
 
 Regards
 Andreas
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
 
 
 
 -- 
 Scopis GmbH
 Blücherstr. 22
 10961 Berlin
 Germany
 
 E-Mail: ahaferb...@scopis.com
 Tel.: +49 (30) 201 69 38 0
 Fax.: +49 (30) 201 69 38 20
 Internet: www.scopis.com
 
 HRB 128315 Berlin Charlottenburg
 USt-IdNr.: DE272721463
 Steuernummer: 29/014/02034
 Geschäftsführer:  Bartosz Kosmecki
 
 Diese E-mail, einschließlich der Anhänge, ist ausschließlich für den oben 
 genannten Adressaten bestimmt und beinhaltet vertrauliche und/oder gesetzlich 
 geschützte Informationen. Jedem anderen Empfänger ist die Vervielfältigung, 
 Weitergabe oder Veröffentlichung untersagt. Falls Sie diese Mitteilung 
 irrtümlicherweise erhalten haben, bitten wir um sofortige Information an den 
 Absender und Vernichtung der E-mail.
 
 This e-mail, including the attachments, is for the exclusive use of the 
 above-named addresses and contains confidential information and/or 
 information protected by law. Any other recipient is prohibited from 
 duplicating, passing on to third parties, or publishing this information. If 
 by error you are the recipient of this communication please inform the sender 
 immediately and permanently delete this e-mail.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Dependency for launching an application

2013-02-08 Thread Nick Overdijk
I'm probably missing something, but why

 add_dependencies(parent child)

? That doesn't make sense. Parent is not using anything from child. You can 
just leave that line away and everything will be fine right?

On 2013-08-02, at 16:24:21 , Andreas Haferburg wrote:

 Yes, that's pretty much the setup we have: The common (static) library 
 contains almost all obj's, and the two exe projects only have a small 
 main.obj and link against the library. I'd like to eliminate the build(=link) 
 time of child.exe by having the linker link both exes at the same time.
 
 Regards,
 Andreas
 
 
 On 08.02.2013 15:41, Patrick Johnmeyer wrote:
 On Fri, Feb 8, 2013 at 8:16 AM, Andreas Haferburg ahaferb...@scopis.com
 mailto:ahaferb...@scopis.com wrote:
 
What happens is that common is built, then child, then parent, then 
 parent is executed.
What I'd like to happen is that common is built, then child+parent are 
 being built concurrently,
and as soon as both are done, parent is executed.
 
 
 Unfortunately that's just not how dependencies work. If parent is dependent 
 on child, then child
 will build before parent in serial. And since they are both dependent on 
 common, you essentially
 have a linear dependency in your example.
 
 You could break this up by creating a new target that is dependent on child 
 and parent, and
 eliminate parent's direct dependency on child. This will allow child and 
 parent to be built
 simultaneously. You would then need to do something with this new target 
 so that it will cause
 parent to be run.
 
 You may be able to improve build times (assuming that is the driver) by 
 invoking the compiler flag
 for parallel compilation. Another option may be to convert the majority of 
 child and parent to
 another library, with small simple executable projects that invoke those 
 libraries. This moves the
 dependencies around in a way that you *may* get better build performance ... 
 but everything I say is
 speculative without knowing the nitty gritty of your project -- build times 
 per project, full
 dependency graph, etc.
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMAKE_lang_COMPILER_ID not set on Darwin

2013-01-30 Thread Nick Overdijk
We use this

if(CMAKE_C_COMPILER MATCHES clang OR CMAKE_CXX_COMPILER MATCHES clang)
set(COMPILING_WITH_CLANG True)
elseif(CMAKE_C_COMPILER MATCHES .*gcc.* OR CMAKE_CXX_COMPILER MATCHES 
.*g[+][+].*)
set(COMPILING_WITH_GCC True)
endif()

In our project

On 2013-30-01, at 14:42:05 , Thomas Nilsson wrote:

 I was looking for a way to identify the compiler as clang to know if I should 
 pass it a clang specific flag (-x c++).
 
 On Darwin default compiler is Clang used through /usr/bin/cc and and 
 /usr/bin/c++. The identification is clearly signaled as Clang 4.1.0 but 
 CMAKE_CXX_COMPILER_ID is not set. Obviously CMAKE_CXX_COMPILER is set to 
 /usr/bin/c++.
 
 Given my belief that CMAKE_CXX_COMPILER_ID will not be implemented soon, what 
 are my options?
 
 Thomas
 
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CLANG_CXX_LIBRARY

2013-01-24 Thread Nick Overdijk
CXXFLAGS=flags to your compiler here cmake 

or 

cmake -DCMAKE_CXX_FLAGS=flags to your compiler here


On 2013-24-01, at 13:02:58 , ambreen haleem wrote:

 Hi,
 
 I want to set clang_cxx_library parameter in cmake. Does not seems to be 
 working by passing through linker. Is there a way I can do that?
 
 Regards
 Ambreen
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Why does ExternalProject require root access?

2013-01-20 Thread Nick Overdijk
I use add_subdirectory to add bullet and sdl.. Could you try that? I've never 
worked with ExternalProject_Add and wouldn't really know what it does.

On 2013-20-01, at 22:26:44 , Ansis Māliņš wrote:

 The line
 ExternalProject_Add(bullet PREFIX ${PROJECT_SOURCE_DIR})
 fails with
 Install the project...
 -- Install configuration: Release
 CMake Error at cmake_install.cmake:38 (FILE):
   file cannot create directory: /usr/local/lib/pkgconfig.  Maybe need
   administrative privileges.
 
 Why? How do I avoid needing root for building my project?
 
 What I'm trying to do: Build several projects (bullet, ogre, btogre, sdl, 
 mygame) into one thing. ExternalProject seems like the correct way to do that.
 
 Lubuntu Linux 12.04
 CMake 2.8.7
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Why does ExternalProject require root access?

2013-01-20 Thread Nick Overdijk
You don't use find_package when add_subdirectory, just 
target_link_library(target name by Bullet).

I'm not sure if this is frowned upon or not, but it does work, and shouldn't 
change that often or anything. Strictly speaking it's a bit dirty though.

Thing is, why is bullet build by you? Do you need it in this repository, and to 
be build by your root cmake? If not, just build it, install it, and use 
find_package. It's a lot cleaner.

On 2013-20-01, at 23:33:05 , Ansis Māliņš wrote:

  I use add_subdirectory to add bullet and sdl.. Could you try that?
 That's what I tried initially, but another external project dependent on 
 Bullet, btOgre, failed to find_package(Bullet). I think it's because when 
 CMake configures btOgre it expects Bullet binaries to be built and installed 
 already.
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] cmake system library

2013-01-12 Thread Nick Overdijk
You could install boost to /usr/local if you're on linux/OSX? That's the 
standard location for non-system libs, CMake-Modules will look there.

On 2013-12-01, at 13:04:50 , peterle oberwi wrote:

 Hi,
 
 I want to use Boost library in my project. But there is one version installed 
 in the system, but not the version I want to use in my project. Therefore I 
 build the version and installed to a directory in my home. When I want to use 
 this version it's very anyoing, because cmake find the system version. My 
 solution is to give a path to the find_package command and use my own modifed 
 cmake module to use my version. Is there an easier solution to use non-system 
 libraries without modifying the cmake module or to set specific variables 
 e.g. there are libraries like qt which have no variables which can be set.
 
 regards 
 
 peter
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CMAKE_INCLUDE_SYSTEM_FLAG_CXX set to -I by default?

2013-01-12 Thread Nick Overdijk
When I use include_directories(SYSTEM $path), it still includes stuff with -I. 
Through 
http://stackoverflow.com/questions/3371127/use-isystem-instead-of-i-with-cmake 
I found out I should change some variable, but this seems like a bug in CMake? 
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] swig - how do I set compile flags on the generated files?

2012-11-27 Thread Nick Overdijk
Aren't you the one generating those names?

http://www.swig.org/Doc1.3/Introduction.html#Introduction%5Fbuild%5Fsystem

On 2012-28-11, at 01:11:24 , Miller Henry wrote:

 Our normal coding standards requires zero warnings with –wall –wextra  
 (gcc/clang), but often the swig generated file has warnings.   We don’t mind 
 turning these warnings off for the generated file, but we still want to see 
 them for other files in the project.  However I’m stumped on how to do this.
  
 Currently I have
  
 ADD_DEFINITIONS(-Wno-unused-parameter …)
  
 which works but it disables the warning for non-generated files as well.
  
 I understand the right way to do this is by:
  
 Set_source_files_property(filename PROPERTIES COMPILE_FLAGS 
 “-Wno-unused-parameter  …”)
  
 However I don’t have filename.  Instead I have myInputfile.i, which gets 
 turns into something like myInputFilePYTHON_wrap.cxx.  Of course I can 
 generate this name, but that seems fragile: if cmake desides to change the 
 file mangling in the future I need to change my algorithm. 
  
 So the question is either: is there are good way to get the generated 
 filename, or is there a different way I should be doing this?
  
  
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] swig - how do I set compile flags on the generated files?

2012-11-27 Thread Nick Overdijk
I had a derp, sorry about that. Obviously you don't, hah. 

You can put all the swig-generated files in a directory, and then perhaps set 
the properties with a glob?

On 2012-28-11, at 02:22:00 , Nick Overdijk wrote:

 Aren't you the one generating those names?
 
 http://www.swig.org/Doc1.3/Introduction.html#Introduction%5Fbuild%5Fsystem
 
 On 2012-28-11, at 01:11:24 , Miller Henry wrote:
 
 Our normal coding standards requires zero warnings with –wall –wextra  
 (gcc/clang), but often the swig generated file has warnings.   We don’t mind 
 turning these warnings off for the generated file, but we still want to see 
 them for other files in the project.  However I’m stumped on how to do this.
  
 Currently I have
  
 ADD_DEFINITIONS(-Wno-unused-parameter …)
  
 which works but it disables the warning for non-generated files as well.
  
 I understand the right way to do this is by:
  
 Set_source_files_property(filename PROPERTIES COMPILE_FLAGS 
 “-Wno-unused-parameter  …”)
  
 However I don’t have filename.  Instead I have myInputfile.i, which gets 
 turns into something like myInputFilePYTHON_wrap.cxx.  Of course I can 
 generate this name, but that seems fragile: if cmake desides to change the 
 file mangling in the future I need to change my algorithm. 
  
 So the question is either: is there are good way to get the generated 
 filename, or is there a different way I should be doing this?
  
  
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
 

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Bug fix requests for the *next* release of CMake...

2012-11-11 Thread Nick Hutchinson
http://public.kitware.com/Bug/view.php?id=13574


On 8/11/2012, at 5:39 PM, cmake-requ...@cmake.org wrote:

 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
 David Cole
 Sent: mercredi 7 novembre 2012 20:41
 To: cmake; CMake Developers
 Subject: [CMake] Bug fix requests for the *next* release of CMake...
 
 Hi all,
 
 Replies requested. Short replies only. Read on. Just a short reply with bug 
 numbers or links to the bugs is all we need here.
 
 Example one-line reply:
 
  http://public.kitware.com/Bug/view.php?id=13571
 
 Please move specific discussions into the bugs themselves or start a new 
 thread to talk about it... Replies on this thread should just be a collector 
 for bug numbers.
 
 We are aiming for approximately quarterly releases from now on, scheduling 
 them every 3 to 4 months. The next release of CMake will likely be version 
 2.8.11, scheduled to have an rc1 release candidate on Wed. January 9, 2013 
 -- just 9 weeks from today.
 
 If you have a particular issue that you think should be fixed for inclusion 
 in 2.8.11, please bring it up within the next two weeks.
 Ideally, each issue will be discussed as needed on the mailing list to come 
 to any consensus about what should be done to fix it, and then an entry in 
 the bug tracker may be used to keep it on the radar screen, and to track 
 activity related to it. You can see what's already on the roadmap for this 
 release here:
 
  http://public.kitware.com/Bug/roadmap_page.php?version_id=103
 
 Patches are always welcome. Patches that include testing of any new features, 
 or tests that prove a bug is really fixed on the dashboards, (basically any 
 patch with testing) is preferred over a patch with no testing. Also, if you 
 are *adding* code, then you also probably need to add *tests* of that code, 
 so that the coverage percentage stays as is or rises.
 
 Please discuss issues here as needed, and add notes to existing issues in the 
 bug tracker that you are interested in seeing fixed -- we will be looking at 
 the mailing list and activity in the bug tracker to help prioritize the bug 
 fixes that will occur in the near future.
 
 
 Thanks,
 David Cole
 Kitware, Inc.
 
 
 P.S. - as a nice summary of what we accomplished in the CMake 2.8.10 release, 
 see here:
 http://public.kitware.com/Bug/changelog_page.php?version_id=100 -- it 
 currently lists 58 issues that we resolved: nice job, everybody!
 
 (Many of those were specifically addressed because somebody asked for it 
 right here on the mailing list... Don't be shy!)
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake
 
 
 

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Incoherent compiler detection in MacOSX 10.7.4

2012-10-03 Thread Nick Overdijk
I'm not sure where it was, but CMake prefers gcc over cc, and cxx over g++. You 
can force it by setting CC=clang.

On 2012-03-10, at 09:27:28 , Pere Mato Vila wrote:

 In my Mac system (10.7.4) with Xcode (4.4.1)  CMake finds by default the GNU 
 compiler for C and Clang for C++. This posses problems later when building my 
 package.  The package can be built correctly either with Clang or with GCC 
 but not in a mixed mode. See the cmake output:  
 
 -- The C compiler identification is GNU 4.2.1
 -- The CXX compiler identification is Clang 4.0.0
 -- Checking whether C compiler has -isysroot
 -- Checking whether C compiler has -isysroot - yes
 -- Checking whether C compiler supports OSX deployment target flag
 -- Checking whether C compiler supports OSX deployment target flag - yes
 -- Check for working C compiler: /Developer/usr/bin/gcc
 -- Check for working C compiler: /Developer/usr/bin/gcc -- works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - done
 -- Check for working CXX compiler: /usr/bin/c++
 -- Check for working CXX compiler: /usr/bin/c++ -- works
 -- Detecting CXX compiler ABI info
 -- Detecting CXX compiler ABI info - done
 
 
 The question is how this is possible? What is the logic to detect the 
 compiler used by CMake? I know that I can force a given compiler with the 
 CMAKE_XXX_COMPILER or by defining the environment variables CXX and CC but it 
 would be nice that  the proper selection is done without any user 
 intervention. 
 
 % which cc c++
 /usr/bin/cc
 /usr/bin/c++
 
 % ls -ls /usr/bin/cc
 8 lrwxr-xr-x  1 root  wheel  5 Aug 22 09:09 /usr/bin/cc - clang
 % ls -ls /usr/bin/c++
 8 lrwxr-xr-x  1 root  wheel  7 Aug 22 09:09 /usr/bin/c++ - clang++
 
 -
 Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
  e-mail: pere.m...@cern.ch  tel: +41 22 76 78696
  fax:  +41 22 76 68792gsm: +41 76 48 70855
 
 
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Boost

2012-08-08 Thread Nick Overdijk
Try again with this example:

http://stackoverflow.com/questions/3897839/how-to-link-c-program-with-boost-using-cmake


On 2012-08-08, at 12:52:06 , Sumit Adhikari wrote:

 I am searching boost like as follows :
 
 # Boost Library Search
 find_package (Boost)
 if (Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})
   set(LIBS ${LIBS} ${Boost_LIBRARIES})
 else()
message(FATAL_ERROR Boost Not Found)
 endif (Boost_FOUND)
 
 I see the boost library has been found but include_directories, 
 link_directories and LIBS are not updated. Is this because I do not have 
 boost.pc in my system ?
 
 Any other way to resolve this ?
 
 Regards,
 
 -- 
 Sumit Adhikari,
 Institute of Computer Technology,
 Faculty of Electrical Engineering,
 Vienna University of Technology,
 Gußhausstraße 27-29,1040 Vienna
 --
 
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Boost

2012-08-08 Thread Nick Overdijk
No, as far as I know you need to specify the components for boost always. I
know of some find_boost that just put everything in there when you didn't
name components, but as a rule, just specifiy the components. ;-)

On Wed, Aug 8, 2012 at 1:29 PM, Sumit Adhikari sumit.adhik...@gmail.comwrote:

 Thanks for the reply. But is this is a Bug ?


 Regards,
 Sumit


 On Wed, Aug 8, 2012 at 1:28 PM, Nick Overdijk n...@astrant.net wrote:

 Try again with this example:


 http://stackoverflow.com/questions/3897839/how-to-link-c-program-with-boost-using-cmake


 On 2012-08-08, at 12:52:06 , Sumit Adhikari wrote:

 I am searching boost like as follows :

 # Boost Library Search
 find_package (Boost)
 if (Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})
   set(LIBS ${LIBS} ${Boost_LIBRARIES})
 else()
message(FATAL_ERROR Boost Not Found)
 endif (Boost_FOUND)

 I see the boost library has been found but include_directories,
 link_directories and LIBS are not updated. Is this because I do not have
 boost.pc in my system ?

 Any other way to resolve this ?

 Regards,

 --
 Sumit Adhikari,
 Institute of Computer Technology,
 Faculty of Electrical Engineering,
 Vienna University of Technology,
 Gußhausstraße 27-29,1040 Vienna
  --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake





 --
 Sumit Adhikari,
 Institute of Computer Technology,
 Faculty of Electrical Engineering,
 Vienna University of Technology,
 Gußhausstraße 27-29,1040 Vienna

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [cmake-developers] [CMake] xcode project and static library dependencies

2011-01-19 Thread Nick Kledzik
 
 BTW, it might make more sense to move this to the cmake-developers mailing 
 list.
 
I've transfered this thread to the developer list.  See below for continuation..


On Jan 18, 2011, at 12:42 PM, Bill Hoffman wrote:

 On 1/18/2011 2:40 PM, Brad King wrote:
 On 1/18/2011 2:12 PM, Nick Kledzik wrote:
 When I use cmake to create a Makefile, the resulting main executable
 is placed in the build directory tree next to the Makefile.
 
 This is where CMake puts files in single-configuration generators.
 
 When I use cmake to create a xcode project, the resulting main
 executable is placed  in a subdirectory named Debug of the build
 directory tree.
 
 This is where CMake puts files in multi-configuration generators.
 
 Both of the above are expected default behaviors.  Both can be
 changed by CMake properties like RUNTIME_OUTPUT_DIRECTORY and
 its per-configuration equivalent.  All CMake generators must
 honor these.
 
 None of these locations are the native location
 where Xcode would put a build result.
 
 Xcode has settings like CONFIGURATION_BUILD_DIR to control
 where the build outputs go.  This already works.  Is there
 some reason your changes cannot use these?
 
 My understanding is that the main problem with the current generator
 is all the extra build phases and OTHER_LDFLAGS stuff used to deal
 with link line ordering and static libraries.  This is what Bill
 summarized:
 
 On 1/13/2011 3:41 PM, Bill Hoffman wrote:
 - have a static library show up more than once on a link line
 - be able to specify the order of static libraries on the link line
 - be able to relink and executable when a static library that it
 depends on is rebuilt.
 
 I'm more interested in a solution to implementation issues like these
 than in interface details like where output files go.
 
 -Brad
 
 So, for Xcode and VS IDE, CMake will place things in directories like Debug, 
 Release.
 
 For example, you should get something like this:
 
 ${RUNTIME_OUTPUT_DIRECTORY}/Debug/myexe
 
 Xcode does support building multiple configurations like Debug, Release, etc. 
  Where is the native location for those files?
As I said, it is per-user xcode settings.  You cannot infer the location from 
source tree cmake has access to. 

At build time, the location is known within xcode.  So, I added a copy-file 
phase to have xocde copy the resulting binary from the native location to the 
standard location the cmake expects.  There is little overhead for this.

I've now have a patch which:
1) preserves link order
2) builds libraries into the xcode native location
4) removes pre and post shell script phases previously used to fix dependency 
problems
3) xcode projects now have proper dependencies

WIth this cmake patch, I can build CMake.xcodeproject, open it in xcode, 
build-all, set the current target to be cmake, make a source change, hit 
build, and have xcode just compile that one file, re-archive the library, then 
re-link cmake tool.  I also debugged all this in Xcode by setting arguments for 
the cmake tool and hitting the build-and-debug within xcode!

Attached is the patch from cmake-2.8.3 sources:


cmake-xcode.patch
Description: Binary data


This cmake also creates an xcode project that builds LLVM.  It is still not 
quite optimal because there are a bunch of cases where custom rules cause a 
custom make file to be generated which is executed from within xcode via a 
shell script phase.  Xcode does not now which files the script might modify, so 
xcode has to be conservative and re-check all timestamps.  There are ways to 
add custom scripts with specified input and output files in xcode.  I may get 
to fixing that someday...


How does one run the test suite?  I saw the instructions about building cmake 
for make, then executing make Experimental.  I did that and all 184 or 184 
tests passed.  But it looks like this is running the cmake generated makefiles 
- not cmake generated xcode projects.

-Nick



  



___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] xcode project and static library dependencies

2011-01-18 Thread Nick Kledzik
On Jan 18, 2011, at 5:30 AM, Bill Hoffman wrote:
 I have changes that cause cmake to produce an Xcode project in which the
 targets do not have the extra phases, and the dependencies are set up such
 that incremental builds work efficiently!
 
 But I'm having some impedance mismatches between where Xcode want the
 build results to be and where cmake wants them.  Xcode (like many makefiles)
 has the concept of a normal build and an install build.  But when cmake
 runs it builds some test programs using the xcodebuild command line, but
 does not specify the install action but then expects to find the resulting
 executable in the install location.
 
 I'm sure I could change TryCompileCode() to add install to the
 xcodebuild line, but it seems like lots of other cmake scripts will have the
 same expectations.  I playing with trying to get Xcode to always do an
 install.  I tried creating xcode projects with the initial (not install)
 locations being where cmake wants them, but xcode seems to not do the
 internal dependency analysis properly when the intermediate results are not
 within BUILD_PRODUCTS_DIR.
 
 What is the cmake model for where the results of a build go?
 
 Putting the results where the native tool expects them is fine. CMake makes
 no guarantees about where build products go. If a native tool has no
 expectations, we try to hide build results underneath the CMakeFiles/
 directories in the build tree to avoid cluttering a developer's view of the
 build tree with stuff they mostly don't need to see...
 I don't think there are any hard requirements w.r.t. build products
 locations. Although where libraries and executables end up is important for
 the CMake generated install rules to work.
 Feel free to change things around experimentally if that makes it easy to
 work with newer Xcode versions. The test suite will very likely tell us if
 things have gone awry.
 
 
 That is not entirely true
 
 Things like EXECUTABLE_OUTPUT_PATH and target location properties have
 to work without an extra install step. What do you mean CMake expects
 to find things in install locations?  CMake does need to be able to
 find executables after the build is run.  It also needs to be able to
 place them via location properties.


Take for example a simple test case that just builds one source file into an 
executable via
  ADD_EXECUTABLE(main main.c)
When I use cmake to create a Makefile, the resulting main executable is placed 
in the build directory tree next to the Makefile.
When I use cmake to create a xcode project, the resulting main executable is 
placed  in a subdirectory named Debug of the build directory tree.

The method cmCoreTryCompile::FindOutputFile() seems to know about this because 
it looks for executables in the build directory then in build directory/Debug 
and build directory/Release.

None of these locations are the native location where Xcode would put a build 
result.  So, I need to create xcode projects that place/copy the resulting 
executables somewhere that cmake universe expects.

Now I am wondering if I should add a copy-files-phase in the executable target 
to copy the resulting binary to the build directory.  That would make xcode 
output be like Makefile output.

-Nick


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] xcode project and static library dependencies

2011-01-18 Thread Nick Kledzik

On Jan 18, 2011, at 11:23 AM, David Cole wrote:
 
  That is not entirely true
 
  Things like EXECUTABLE_OUTPUT_PATH and target location properties have
  to work without an extra install step. What do you mean CMake expects
  to find things in install locations?  CMake does need to be able to
  find executables after the build is run.  It also needs to be able to
  place them via location properties.
 
 
 Take for example a simple test case that just builds one source file into an 
 executable via
  ADD_EXECUTABLE(main main.c)
 When I use cmake to create a Makefile, the resulting main executable is 
 placed in the build directory tree next to the Makefile.
 When I use cmake to create a xcode project, the resulting main executable is 
 placed  in a subdirectory named Debug of the build directory tree.
 
 The method cmCoreTryCompile::FindOutputFile() seems to know about this 
 because it looks for executables in the build directory then in build 
 directory/Debug and build directory/Release.
 
 None of these locations are the native location where Xcode would put a 
 build result.  So, I need to create xcode projects that place/copy the 
 resulting executables somewhere that cmake universe expects.
 
 Now I am wondering if I should add a copy-files-phase in the executable 
 target to copy the resulting binary to the build directory.  That would make 
 xcode output be like Makefile output.
 
 -Nick
 
 
 
 Where does the Xcode equivalent of add_executable(main main.c) naturally go?


It depends on some global xcode settings.  Some users have a one location in 
which all projects put their final projects.  Some users have a build/Debug and 
build/Release directory next to the xcode project file.  

That is why I'm thinking that if cmake's model is to have the final executable 
put into cmakes build directory, that I should just let xcode build it where 
the user wants, then copy it to where cmake wants.  That way both models are 
happy.

-Nick




___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] xcode project and static library dependencies

2011-01-17 Thread Nick Kledzik
On Jan 13, 2011, at 1:57 PM, Bill Hoffman wrote:
 On 1/13/2011 4:49 PM, Nick Kledzik wrote:
 On Jan 13, 2011, at 12:41 PM, Bill Hoffman wrote:
 This is because Xcode provides no way to order static libraries as
 far as I can tell, or to repeat them.   Also, no way to depend on a
 static library or a file directly, forcing the makefile usage.
 This may have changed, so, if you can so native Xcode projects that
 can do the following we can change cmake:
 
 - have a static library show up more than once on a link line
 This is unnecessary.  Unlike most unix linkers, the Xcode linker
 repeatedly iterators over all archives on the command line.  You
 never need to add the same archive more than once on the command
 line.
 
 That was not true when I implemented this the first time.  We have a test in 
 CMake that counts on library ordering and it failed.
 
 - be able to specify the order of static libraries on the link
 line
 The order that the libraries appear in the PBXFrameworksBuildPhase is
 the order that they are passed to the linker.
 
 OK, sounds good...
 
 - be able to relink an executable when a static library that it
 depends on is rebuilt.
 This is normal behavior for the Xccde build system.  If one target
 depends on the product of another target, the build system follows
 the chain and builds everything needed for the target requested to be
 built.
 
 If you can get all the CMake tests to pass with these changes, I would be 
 very happy to get rid of the extra stuff.  It may have changed, but when I 
 first did the implementation, it was required to do it the way it is. That 
 said, I have not revisited this stuff since Xcode 1.5, so things may have 
 changed for the better.
I have changes that cause cmake to produce an Xcode project in which the 
targets do not have the extra phases, and the dependencies are set up such that 
incremental builds work efficiently!

But I'm having some impedance mismatches between where Xcode want the build 
results to be and where cmake wants them.  Xcode (like many makefiles) has the 
concept of a normal build and an install build.  But when cmake runs it 
builds some test programs using the xcodebuild command line, but does not 
specify the install action but then expects to find the resulting executable 
in the install location.

I'm sure I could change TryCompileCode() to add install to the xcodebuild 
line, but it seems like lots of other cmake scripts will have the same 
expectations.  I playing with trying to get Xcode to always do an install.  I 
tried creating xcode projects with the initial (not install) locations being 
where cmake wants them, but xcode seems to not do the internal dependency 
analysis properly when the intermediate results are not within 
BUILD_PRODUCTS_DIR.

What is the cmake model for where the results of a build go?

-Nick




___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] xcode project and static library dependencies

2011-01-13 Thread Nick Kledzik
I'm a long time Xcode user and recently used cmake to create an Xcode project 
for LLVM.  I really like the idea the CMake can produce native projects for 
different platforms, but in my case, the resulting xcode project was very slow 
to use.  

To investigate, I created a small cmake example project with a static library 
and a main executable that uses the library.   The generated Xcode project does 
not encode the static library as a link library of the main executable.  
Instead the static library is slipped in via OTHER_LDFLAGS.  Thus, Xcode does 
not know that if a source file of the static library is changed, that the main 
executable needs to be relinked.  

The generated Xcode project also has extra shell script phases (CMake ReRun, 
and CMAKE PostBuild Rules).  I'm not sure why they are there, but they slow 
down large builds (like llvm).  But they do have the side effect of causing 
Xcode to re-evaluate the mod times of files, which in a way, compensates for 
missing static library dependency.

I'd like to contribute to making the xcode project generator better, but would 
like to understand why the current implementation works as it does.  

-Nick

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] add_dependency on a custom target

2010-09-15 Thread Nick Davidson
Dear List,

I'm using a file glob to extract a list of xml files to pass to a custom
target to generate
a pot file with getttext, most of the heavy lifting is handled by a
Macro.

include(FindMsgfmt)
macro (MakePot BIN_NAME CPP_SOURCES XML_SOURCES)
 set(CPP_SRCS ${CPP_SOURCES})
 set(XML_SRCS ${XML_SOURCES})
 set(POT_FILE ${BIN_NAME}.pot)
 if (XGETTEXT_FOUND)
 message(STATUS Adding Target Potfile: ${POT_FILE})
 if (XML_SRCS)
 add_custom_target(${POT_FILE} ALL
 COMMAND ${XGETTEXT_EXECUTABLE} --language=C++ --force-po
-kN_ -kNN_:1,2 -o
 ${POT_FILE} ${CPP_SRCS}
 COMMAND ${XGETTEXT_EXECUTABLE} --language=Glade --force-po
-j -o
 ${POT_FILE} ${XML_SRCS} )
 else (XML_SRCS) add_custom_target(${POT_FILE} ALL
 COMMAND ${XGETTEXT_EXECUTABLE} --language=C++ --force-po
-kN_ -kNN_:1,2 -o
 ${POT_FILE} ${CPP_SRCS})
 endif(XML_SRCS)
 add_dependencies(${POT_FILE} ${XML_SOURCES} ${CPP_SRCS})
 else (XGETTEXT_FOUND)
 message(STATUS Cannot find xgettext)
 endif(XGETTEXT_FOUND)
endmacro (MakePot POT_NAME) 

The only problem is, if the list of xml files changes (e.g. a deletion)
the cmake
cache doesn't get regenerated and thus the xml files are not reglobbed
and so the
custom command fails.

Any suggestions?

Thanks,

Nick Davidson

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_dependency on a custom target

2010-09-15 Thread Nick Davidson
Whoops, forgot to reply on list, sorry!

 From: cmake-boun...@cmake.org
 [mailto:cmake-boun...@cmake.org] On Behalf Of Andreas Pakulat
 Sent: 15 September 2010 13:03
 To: cmake@cmake.org
 Subject: Re: [CMake] add_dependency on a custom target
 
 On 15.09.10 12:34:43, Nick Davidson wrote:
  Dear List,
  
  I'm using a file glob to extract a list of xml files to pass to a 
  custom target to generate a pot file with getttext, most of
 the heavy
  lifting is handled by a Macro.
  
  include(FindMsgfmt)
  macro (MakePot BIN_NAME CPP_SOURCES XML_SOURCES)
   set(CPP_SRCS ${CPP_SOURCES})
   set(XML_SRCS ${XML_SOURCES})
   set(POT_FILE ${BIN_NAME}.pot)
   if (XGETTEXT_FOUND)
   message(STATUS Adding Target Potfile: ${POT_FILE})
   if (XML_SRCS)
   add_custom_target(${POT_FILE} ALL
   COMMAND ${XGETTEXT_EXECUTABLE} --language=C++
 --force-po
  -kN_ -kNN_:1,2 -o  ${POT_FILE} ${CPP_SRCS}
   COMMAND ${XGETTEXT_EXECUTABLE} --language=Glade 
  --force-po -j -o  ${POT_FILE} ${XML_SRCS} )
   else (XML_SRCS) 
 add_custom_target(${POT_FILE} ALL
   COMMAND ${XGETTEXT_EXECUTABLE} --language=C++
 --force-po
  -kN_ -kNN_:1,2 -o  ${POT_FILE} ${CPP_SRCS})
   endif(XML_SRCS)
   add_dependencies(${POT_FILE} ${XML_SOURCES} ${CPP_SRCS})
   else (XGETTEXT_FOUND)
   message(STATUS Cannot find xgettext)
   endif(XGETTEXT_FOUND)
  endmacro (MakePot POT_NAME)
  
  The only problem is, if the list of xml files changes (e.g. a
  deletion) the cmake cache doesn't get regenerated and thus the xml 
  files are not reglobbed and so the custom command fails.
  
  Any suggestions?
 
 Don't use a glob (list the files individually) or remember to touch 
 the cmakelists.txt file after adding new files. I don't think there's 
 a way to have cmake re-run when calling just make within 
 cmakelists.txt.

Ok, but why doesn't adding the files as dependencies work? 
The glob is stored in the cache - fine, there isn't a way for Cmake to
automatically figure out what files it should check to see if anything
has changed. Having added those files as dependencies of the target that
uses the glob manually then surely it's just a list of files?


Is there a fundamental difference between a list variable made from
a globbed set of files and a list made from a manually specified set?

 
 Andreas
 
 --

Nickd

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to change CMake's expected output filename

2010-09-08 Thread Nick Foster

Hi there,

I'm using CMake with SDCC. Currently, support for SDCC in CMake does not also 
include dialects for its various assemblers. So I've created one, for the 
asx8051 assembler. The problem is that the asx8051 assembler shows nonstandard 
behavior, and does not let you arbitrarily name the output. Instead, if you 
compile myfile.a51, it produces myfile.rel. No option to change that.

CMake tells the linker to then look for an output file named 
source_filenameCMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION, which ends up 
looking for myfile.a51.rel. I can add whatever arbitrary extension I want, but 
I need to strip the .a51 from CMake's expected output filename so it knows to 
look for myfile.rel. Should I create a custom command which moves myfile.rel to 
myfile.a51.rel? It seems unnecessarily Byzantine. Is there an easier way?

Thanks,
Nick
  
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CPack - Mac OS X Universal dmg

2010-06-21 Thread Nick Bolton
Dave,

On 20 June 2010 18:02, Dave Partyka dave.part...@kitware.com wrote:
 When configuring your build set CMAKE_OSX_ARCHITECTURES  to both the
 architectures you wish to build. For example 'i386;ppc'. This will produce
 libraries/executables with both architectures embedded in them. You can
 check this by just running the 'file' command on any of the
 libraries/executables.

Thanks, the change worked like a charm:

http://code.google.com/p/synergy-plus/source/detail?r=649

Here's the new output:

home-ws-5:release-1.3.6 nick$ file bin/synergyc
bin/synergyc: Mach-O universal binary with 2 architectures
bin/synergyc (for architecture ppc7400):Mach-O executable ppc
bin/synergyc (for architecture i386):   Mach-O executable i386

Nick
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CPack - Mac OS X Universal dmg

2010-06-20 Thread Nick Bolton
Hello,

I would like to build a Mac OS X Universal dmg using cpack, but
currently we're building an i386 - how might we build universal
instead?

Here's our CPack config:
http://code.google.com/p/synergy-plus/source/browse/trunk/cmake/CMakeLists_cpack.txt

Nick
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Converting implicit makefile rules

2009-07-06 Thread Nick Davidson
Dear List,

Is there an idomatic way of converting an implicit makefile rule to a
CMakeLists construct?
Currently I'm resorting to writing a macro which processes list
variables with foreach and adds various linked custom targets but I'm
finding lots of confusion when passing lists as arguments to macros.

I tried the following:

macro (MakeCustomTarget TARGET_FILE CPP XML)
  add_custom_target(TARGET_FILE ALL  
COMMAND process ${TARGET_FILE} ${CPP}
COMMAND process ${TARGET_FILE} ${XML})
  message(STATUS Cannot find xgettext)   
endmacro (MakeCustomTarget TARGET_FILE CPP XML) 

calling MakeCustomTarget(TargetFile ${LIST1} ${LIST2}) where LIST1 and
LIST2 are semi-colon separated lists causes the first two elements of
whatever the LIST1 was to get passed as CPP and XML - I had to resort to
quoting the arguments and then turning them back in to lists with a set.

macro (MakeCustomTarget TARGET_FILE CPP XML)
  set(CPP_LIST ${CPP})
  set(XML_LIST ${XML})
add_custom_target(TARGET_FILE ALL  
COMMAND process ${TARGET_FILE} ${CPP_LIST}
COMMAND process ${TARGET_FILE} ${XML_LIST})
endmacro (MakeCustomTarget TARGET_FILE CPP XML) 

MakePot(project.pot ${LIST1} ${LIST2})

Is this behavior expected? I'm running Debian Lenny and Cmake 2.6-patch0

Thanks,

Nick Davidson


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Creation of Executable JAR

2009-02-20 Thread Nick Ogden
Hi,

Does anyone know of a way to specify additional attributes to be added to a 
Java JAR file manifest? I'm trying to generate an executable JAR file but I 
don't know how to tell CMake to add the Main-Class: classname line to the 
manifest. Any help would be appreciated.

Kind Regards
-- 
Nick Ogden

Email: n...@nickogden.net  PGP: 2598FFE4
Web:   www.nickogden.net


signature.asc
Description: This is a digitally signed message part.
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake Library Issues

2009-02-04 Thread Nick Ogden
Thanks for your help.

It seems that the library cannot be compiled as static, when I tried it as 
dynamic it worked without a problem. I assume that this is due to the  style 
includes as there wouldn't be a search path for a static library since it's 
part of the executable.

Could anyone tell me what the requirements are for static vs dynamic 
compilation?

On Wednesday 04 February 2009 01:34:56 Matthew Woehlke wrote:
 Nick Ogden wrote:
  Hi there,

 I see you found the right list ;-).

 (And I will admit I was lazy and didn't read it before on kde-devel,
 which is why I'm just now answering your actual question.)

  I have a problem with using CMake to compile a library that I'm trying to
  use in an application that I'm writing.
 
  I have the following directory structure:
 
  src/
 
| CMakeLists.txt (1)
| app/
|
|   | CMakeLists.txt (2)
|   | (app source and headers)
|
| libmba/
|
|   | CMakeLists.txt (3)
|   | mba
|   |
|   || (libmba headers)
|   |
|   | (libmba source)
 
  The problem occurs when compiling the library. Make states that it cannot
  find a header file for the library, which is definitely in the 'mba'
  directory. The problem seems to be that the library uses '#include
  mba/' style statements in the header files and as such expects the
  search path to start in the 'libmba' directory. Since some header files
  include other header files, make then seems to look for the directory
  'src/libmba/mba/mba' which of course does not exist. Is there any way of
  preventing this behavior so that the search will always start in the
  'libmba' directory?
  [snip]
  include_directories(${SERVER_SOURCE_DIR}/libmba)
  add_library(mba STATIC ${mba_SRC})

 Hmm... offhand it seems like that should work. You might try running
 'make VERBOSE=1' to see what is being passed to the linker, and also
 check that ${SERVER_SOURCE_DIR} is defined as you expect it to be
 (either add a message(STATUS), or check CMakeCache.txt in your build
 directory). My WAG would be that ${SERVER_SOURCE_DIR} is empty.

 If that doesn't help, posting a reduced test case that shows the same
 problem would be useful.

 --
 Matthew
 Please do not quote my e-mail address unobfuscated in message bodies.

-- 
Nick Ogden

Email: n...@nickogden.net  PGP: 2598FFE4
Web:   www.nickogden.net


signature.asc
Description: This is a digitally signed message part.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Fwd: Fwd: Is it necessary to link a executable file?

2009-02-04 Thread Nick Ogden
That's because a library doesn't need a main() function. It's just a set of 
functions that may be called by applications and is never executed by itself, 
however an executable needs a point of entry and therefore needs a main() 
function.

On Wednesday 04 February 2009 10:51:31 ankit jain wrote:
 2009/2/4 Eric Noulard eric.noul...@gmail.com

  2009/2/4 ankit jain ankitgu...@gmail.com:
   The CMakeLists iam using contains:
  
   PROJECT(hello)
  
   ADD_EXECUTABLE(hello h1.C)
  
   Error iam getting is:
  
   Linking CXX executable hello
   /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crt1.o(.text+0x18):
   In
  
   function `_start':
   : undefined reference to `main'
 
  This is not a CMake error this is a C++ error
  your source file is lacking the main() function thus
  the compiler cannot produce an executable.
 
  I bet that if you search for  undefined reference to `main'  on the Web
  you'll find the answer to such question.
 
  --
  Erk

 But if i replace ADD_EXECUTABLE by ADD_LIBRARY there is no error and a
 library get successfully built.


 AJ

-- 
Nick Ogden

Email: n...@nickogden.net  PGP: 2598FFE4
Web:   www.nickogden.net


signature.asc
Description: This is a digitally signed message part.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake Library Issues

2009-02-04 Thread Nick Ogden
OK, I finally found the problem.

It seems that I was being silly and not being consistent with case in the 
project(X) call and the ${X_SOURCE_DIR} references.

Everything is working as expected now, thanks for your help guys.

On Wednesday 04 February 2009 12:19:11 Michael Jackson wrote:
 I don't think the style of include paths has anything to do with
 whether or not the library will compile as a static or dynamic library.

 What is the output of:
 MESSAGE(SERVER_SOURCE_DIR is ${SERVER_SOURCE_DIR})

 Please post that to the list.

 _
 Mike Jackson  mike.jack...@bluequartz.net
 BlueQuartz Softwarewww.bluequartz.net
 Principal Software Engineer  Dayton, Ohio

 On Feb 4, 2009, at 5:07 AM, Nick Ogden wrote:
  Thanks for your help.
 
  It seems that the library cannot be compiled as static, when I tried
  it as
  dynamic it worked without a problem. I assume that this is due to
  the  style
  includes as there wouldn't be a search path for a static library
  since it's
  part of the executable.
 
  Could anyone tell me what the requirements are for static vs dynamic
  compilation?
 
  On Wednesday 04 February 2009 01:34:56 Matthew Woehlke wrote:
  Nick Ogden wrote:
  Hi there,
 
  I see you found the right list ;-).
 
  (And I will admit I was lazy and didn't read it before on kde-devel,
  which is why I'm just now answering your actual question.)
 
  I have a problem with using CMake to compile a library that I'm
  trying to
  use in an application that I'm writing.
 
  I have the following directory structure:
 
  src/
 
   | CMakeLists.txt (1)
   | app/
   |
   |   | CMakeLists.txt (2)
   |   | (app source and headers)
   |
   | libmba/
   |
   |   | CMakeLists.txt (3)
   |   | mba
   |   |
   |   || (libmba headers)
   |   |
   |   | (libmba source)
 
  The problem occurs when compiling the library. Make states that it
  cannot
  find a header file for the library, which is definitely in the 'mba'
  directory. The problem seems to be that the library uses '#include
  mba/' style statements in the header files and as such
  expects the
  search path to start in the 'libmba' directory. Since some header
  files
  include other header files, make then seems to look for the
  directory
  'src/libmba/mba/mba' which of course does not exist. Is there any
  way of
  preventing this behavior so that the search will always start in the
  'libmba' directory?
  [snip]
  include_directories(${SERVER_SOURCE_DIR}/libmba)
  add_library(mba STATIC ${mba_SRC})
 
  Hmm... offhand it seems like that should work. You might try running
  'make VERBOSE=1' to see what is being passed to the linker, and also
  check that ${SERVER_SOURCE_DIR} is defined as you expect it to be
  (either add a message(STATUS), or check CMakeCache.txt in your build
  directory). My WAG would be that ${SERVER_SOURCE_DIR} is empty.
 
  If that doesn't help, posting a reduced test case that shows the same
  problem would be useful.
 
  --
  Matthew
  Please do not quote my e-mail address unobfuscated in message bodies.
 
  --
  Nick Ogden
 
  Email: n...@nickogden.net  PGP: 2598FFE4
  Web:   www.nickogden.net
  ___
  CMake mailing list
  CMake@cmake.org
  http://www.cmake.org/mailman/listinfo/cmake

 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake

-- 
Nick Ogden

Email: n...@nickogden.net  PGP: 2598FFE4
Web:   www.nickogden.net


signature.asc
Description: This is a digitally signed message part.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CMake Library Issues

2009-02-03 Thread Nick Ogden
Hi there,

I have a problem with using CMake to compile a library that I'm trying to use 
in an application that I'm writing.

I have the following directory structure:

src/
  | CMakeLists.txt (1)
  | app/
  |   | CMakeLists.txt (2)
  |   | (app source and headers)
  | libmba/
  |   | CMakeLists.txt (3)
  |   | mba
  |   || (libmba headers)
  |   | (libmba source)

The problem occurs when compiling the library. Make states that it cannot find 
a header file for the library, which is definitely in the 'mba' directory. The 
problem seems to be that the library uses '#include mba/' style 
statements in the header files and as such expects the search path to start in 
the 'libmba' directory. Since some header files include other header files, 
make 
then seems to look for the directory 'src/libmba/mba/mba' which of course does 
not exist. Is there any way of preventing this behavior so that the search 
will always start in the 'libmba' directory?

The error as reported by make and the relevant CMakeLists.txt file is as 
follows.

Error:

Scanning dependencies of target mba
[  3%] Building C object libmba/CMakeFiles/mba.dir/allocator.c.o
In file included from /.../src/libmba/allocator.c:29:
/.../src/libmba/mba/suba.h:24:27: error: mba/allocator.h: No such file or 
directory
make[2]: *** [libmba/CMakeFiles/mba.dir/allocator.c.o] Error 1
make[1]: *** [libmba/CMakeFiles/mba.dir/all] Error 2
make: *** [all] Error 2
--

CMakeLists.txt (3):

set(mba_SRC allocator.c
bitset.c
cfg.c
csv.c
daemon.c
dbug.c
diff.c
eval.c
hashmap.c
hexdump.c
linkedlist.c
misc.c
msgno.c
path.c
pool.c
shellout.c
stack.c
suba.c
svcond.c
svsem.c
text.c
time.c
varray.c)

include_directories(${SERVER_SOURCE_DIR}/libmba)

add_library(mba STATIC ${mba_SRC})
--

Any help would be greatly appreciated.

Kind Regards
-- 
Nick Ogden

Email: n...@nickogden.net  PGP: 2598FFE4
Web:   www.nickogden.net



signature.asc
Description: This is a digitally signed message part.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] QT4_ADD_RESOURCES not creating cpp on Mac OS X

2006-10-23 Thread Nick Arini

Dear CMake users,

I am trying to get some resources (icon images) compiled in a Qt  
application on Mac OS X (10.4.8 Tiger) with cmake 2.4-patch 3.


I am using version 4.2.0-snapshot-20060910 of Qt.

I have the following in my CMakeLists.txt:

PROJECT(QtApp)


INCLUDE (${CMAKE_ROOT}/Modules/FindQt4.cmake)
INCLUDE(   ${QT_USE_FILE}   )

INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_INCLUDE_PATH}
)

LINK_LIBRARIES (
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
)


# Gather the source files
SET(QtApp_SRCS
main.cpp
)


#SET(QtApp_MOCS
#)

SET(QtApp_RCCS
icons.qrc
)

# generate rules for building source files from the resources
QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS})

#QT4_WRAP_CPP(QtApp_MOC_SRCS ${VTKD_MOCS})

# Create the executable
ADD_EXECUTABLE(QtApp ${QtApp_SRCS} ${QtApp_RCCS_SRCS})

# Link in the appropriate libraries
TARGET_LINK_LIBRARIES(
QtApp ${QT_LIBRARIES}
)

I have a resource file called icons.qrc in my cmake source dir:

!DOCTYPE RCCRCC version=1.0
qresource prefix=/
fileimages/stock_exit-16.png/file
fileimages/stock_new-16.png/file
fileimages/stock_save-16.png/file
fileimages/stock_stop-16.png/file
fileimages/stock_zoom-in-16.png/file
fileimages/stock_exit.png/file
fileimages/stock_new-document-32.png/file
fileimages/stock_save.png/file
fileimages/stock_stop.png/file
fileimages/stock_zoom-in.png/file
fileimages/stock_help-16.png/file
fileimages/stock_open-16.png/file
fileimages/stock_save_as-16.png/file
fileimages/stock_sum-16.png/file
fileimages/stock_zoom-out-16.png/file
fileimages/stock_help.png/file
fileimages/stock_open.png/file
fileimages/stock_save_as.png/file
fileimages/stock_sum.png/file
fileimages/stock_zoom-out.png/file
/qresource

When I run CMake I expect the file qrc_icons.cpp to be created in the  
build directory.


The main.cpp is as follows:

#include QApplication
#include QLabel
#include QIcon

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);
  app.setWindowIcon ( QIcon(:/images/stock_sum.png) );

  QLabel *window = new QLabel(Test);
  window-setPixmap ( QPixmap(:/images/stock_sum.png) );
  window-show();

  return app.exec();
}

the images themselves are in a dir called images in the CMake source  
dir.


Cmake will run fine and the code will compile and execute ok, just  
not with the images as RCC does not seem to run and the qrc_icons.o  
file isnt created.


I tried the very same code (no changes) on Fedora Core 5 with Qt  
version 4.2.1 and CMake version 2.4 patch 3 and everything worked as  
expected (the qrc_icons.o file is created) and the exe runs with the  
images.


So is this a problem with the FindQt4 module on MacOS X or do I need  
to do something extra on Mac? I have the RCC exe in my path and it  
produces the expected output when I run it manually.



Thanks and best regards,

Nick



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake