Re: [CMake] INCLUDE command within a toolchain file is stripping file path if filename is a variable?

2012-05-09 Thread Terrence Meiczinger
Yes, I can confirm it does work under 2.8.7. Ok, I'll have to figure out the 
best way to use 2.8.x. Thanks for your help.

[thunderpig:/src/cmake_foo]$ cmake -P includeTest.cmake
-- INC_COMMON=include_me.cmake
-- I = /src/cmake_foo/include_me.cmake have been included by 
-- I = /src/cmake_foo/include_me.cmake have been included by /src/cmake_foo
-- INC_COMMON=/src/cmake_foo/include_me.cmake
-- I = /src/cmake_foo/include_me.cmake have been included by /src/cmake_foo
-- I = /src/cmake_foo/include_me.cmake have been included by /src/cmake_foo


- Original Message -
From: Eric Noulard 
To: Terrence Meiczinger 
Cc: "cmake@cmake.org" 
Sent: Wednesday, May 9, 2012 4:55 PM
Subject: Re: [CMake] INCLUDE command within a toolchain file is stripping file 
path if filename is a variable?

2012/5/9 Terrence Meiczinger :
> First, thanks for the responses. Ok, so I am running cmake 2.6patch4 on RH 
> 5.5.

OK then you should really consider giving 2.8.x a try.
2.6.4 is more than 3 years old and there won't be any new 2.6.x release.

Moreover I wasn't able to reproduce the error with 2.8.8 (or git master).

> I download the code you attached and ran as suggested...
>
> -> cmake -P includeTest.cmake
> -- INC_COMMON=include_me.cmake
> -- I = /h/tmeiczin/CMAKE/include_me.cmake have been included by
> -- I = /h/tmeiczin/CMAKE/include_me.cmake have been included by 
> /h/tmeiczin/CMAKE
> -- INC_COMMON=/include_me.cmake
> CMake Error at includeTest.cmake:8 (include):
>   include could not find load file:
>
>     /include_me.cmake
>
> I'll have a simple test scenario done shortly.

This is not necessary since my simple example seems to fail as it does
for your case.



-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org

--

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] INCLUDE command within a toolchain file is stripping file path if filename is a variable?

2012-05-09 Thread Eric Noulard
2012/5/9 Terrence Meiczinger :
> First, thanks for the responses. Ok, so I am running cmake 2.6patch4 on RH 
> 5.5.

OK then you should really consider giving 2.8.x a try.
2.6.4 is more than 3 years old and there won't be any new 2.6.x release.

Moreover I wasn't able to reproduce the error with 2.8.8 (or git master).

> I download the code you attached and ran as suggested...
>
> -> cmake -P includeTest.cmake
> -- INC_COMMON=include_me.cmake
> -- I = /h/tmeiczin/CMAKE/include_me.cmake have been included by
> -- I = /h/tmeiczin/CMAKE/include_me.cmake have been included by 
> /h/tmeiczin/CMAKE
> -- INC_COMMON=/include_me.cmake
> CMake Error at includeTest.cmake:8 (include):
>   include could not find load file:
>
>     /include_me.cmake
>
> I'll have a simple test scenario done shortly.

This is not necessary since my simple example seems to fail as it does
for your case.



-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

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] INCLUDE command within a toolchain file is stripping file path if filename is a variable?

2012-05-09 Thread Terrence Meiczinger
First, thanks for the responses. Ok, so I am running cmake 2.6patch4 on RH 5.5.

I download the code you attached and ran as suggested...

-> cmake -P includeTest.cmake
-- INC_COMMON=include_me.cmake
-- I = /h/tmeiczin/CMAKE/include_me.cmake have been included by 
-- I = /h/tmeiczin/CMAKE/include_me.cmake have been included by 
/h/tmeiczin/CMAKE
-- INC_COMMON=/include_me.cmake
CMake Error at includeTest.cmake:8 (include):
  include could not find load file:

    /include_me.cmake

I'll have a simple test scenario done shortly.

--

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] configure_file as a build step?

2012-05-09 Thread Eric Noulard
2012/5/9 Jensen, Erik A :
> That worked, although a little roundabout. Thank you.
>
> Would there be any interest in having an easier way to do this? It seems like 
> it could be usefully in a fair number of situations.
>
> Maybe an additional -E command:
> cmake -E configure_file -D var1=value1 -D var2=value2 --at-only infile outfile

Not that much simpler than the following example.

> Or even a way to run arbitrary CMake commands without a script file:
> cmake -D var1=value1 -D var2=value2 -R "configure_file(infile outfile @ONLY)"
>
> This would make it possible to avoid having a whole other file just to 
> execute one CMake command at build time.
>
> Thoughts?

Is it really simpler than writing your own simple (or complicated)
script once and launching:

cmake -DINFILE=blah.in  -DOUTFILE=blah.out -Dvar1=value1 -Dvar2=value2
-DCOPYONLY=1 -P GenericConfigureFile.cmake

this command may be launched in add_custom_command and you can spare the first
configure_file if you pass all the value you need with -D on the command line.

One option that could be nice would be a way to inherit CMake-time
defined values
at Build-time in order to spare much of "-Dvar1=value1" argument.

Something like a new CMake command that would dump in a file the definition
of the currently defined vars

variables_save(FILE ${CMAKE_CURRENT_BINARY_DIR}/myvarset.cmake)
then you would be able to do
variables_load(FILE /path/to/myvarset.cmake)
and get the previously saved vars defintions.

May be variables_save could take a list of vars as argument:
variables_save(VARS MyVar1 MyVar2 FILE ${CMAKE_CURRENT_BINARY_DIR}/myset.cmake)

I think this should even be doable as CMake macro.
variables_load may simply be
include(/path/to/myvarset.cmake)

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


GenericConfigureFile.cmake
Description: Binary data
--

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] Package installation conundrum

2012-05-09 Thread David Cole
On Wed, May 9, 2012 at 4:01 PM, Alexander Neundorf
 wrote:
> On Wednesday 09 May 2012, Michael Wild wrote:
>
>> On 09.05.2012, at 21:03, Alexander Neundorf 
>> wrote:
>
> ...
>
>> > > # configure the headers into the build tree so the package can be used
>
>> > > # without installing it and not hard-coding the source/build directory
>
>> > > # information into FooConfig.cmake
>
>> > > configure_file(include/foo.h
>
>> > > ${PROJECT_BINARY_DIR}/include/foo.h COPYONLY)
>
>> >
>
>> > The input file should have a suffix which indicates it is a file which
>> > is
>
>> > intended to be configured, usually foo.h.in. Alex
>
>>
>
>> I don't agree, since it's COPYONLY. Besides, with a little more work in
>
>> FooConfig.cmake you can skip that step...
>
> Oh, sorry, I missed the COPYONLY.
>
> Alex
>
>
> --
>
> 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


FYI -- I know we discourage in-source builds heavily but -- we do
still support them, so:

And in such a case where the source and build trees are the same, it's
still important to use a .in extension (or something) on the input
file to make it different from the output file.

Use a .in extension on configure_file inputs unless you also have code
in place to prohibit in-source builds.


David
--

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] INCLUDE command within a toolchain file is stripping file path if filename is a variable?

2012-05-09 Thread Eric Noulard
2012/5/9 Terrence Meiczinger :
> I have a top level cmake toolchain file and I want it to include another 
> file. If I give the include a string filename it works. However, if I try to 
> make the filename a variable, it can no longer find the included file. It 
> appears cmake is stripping the path.
>
>
> The following works fine...
>
> linux-gnu-x86_64.cmake:
>
> include("/src/toolchains/linux-common.cmake")
>
> however, if I do the following it does not..
>
> linux-gnu-x86_64.cmake:
> set(TOOLCHAIN_COMMON "/src/toolchains/linux-common.cmake")
> message(STATUS "TOOLCHAIN_COMMON: ${TOOLCHAIN_COMMON}")
> include("${TOOLCHAIN_COMMON}")
>
>
> It fails:
>
> -> cmake -DCMAKE_TOOLCHAIN_FILE=/src/toolchains/linux-gnu-x86_64.cmake
>
> -- TOOLCHAIN_TOP:  /src/toolchains/linux-gnu-x86_64.cmake
> -- TOOLCHAIN_COMMON: /src/toolchains/linux-common.cmake
> -- The C compiler identification is GNU
> -- The CXX compiler identification is GNU
> -- Check for working C compiler: /usr/bin/gcc
> CMake Error at /src/toolchains/linux-gnu-x86_64.cmake:18 (INCLUDE):
>   include could not find load file:
>
>     /linux-common.cmake
>
> As you can see the from the status output, the path is the same as the first 
> example. However, it appears cmake is stripping it prior to actually 
> including it.
>
> Now, if I change the include as follows, it works... but this seems icky.
>
> include("${${TOOLCHAIN_COMMON}}")
>
> Any insight into why this behavior is occurring?

Woud you be able to reproduce this "include" error outside of a toolchain scope?
Could you try attached example.

put the two files somewhere and run:
cmake -P includeTest.cmake

by the way which version of CMake are you using?


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


include_me.cmake
Description: Binary data


includeTest.cmake
Description: Binary data
--

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] Package installation conundrum

2012-05-09 Thread Alexander Neundorf
On Wednesday 09 May 2012, Michael Wild wrote:
> On 09.05.2012, at 21:03, Alexander Neundorf  wrote:
...
> > > # configure the headers into the build tree so the package can be used
> > > # without installing it and not hard-coding the source/build directory
> > > # information into FooConfig.cmake
> > > configure_file(include/foo.h
> > > ${PROJECT_BINARY_DIR}/include/foo.h COPYONLY)
> > 
> > The input file should have a suffix which indicates it is a file which is
> > intended to be configured, usually foo.h.in. Alex
> 
> I don't agree, since it's COPYONLY. Besides, with a little more work in
> FooConfig.cmake you can skip that step...

Oh, sorry, I missed the COPYONLY.

Alex
--

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] INCLUDE command within a toolchain file is stripping file path if filename is a variable?

2012-05-09 Thread Alexander Neundorf
On Wednesday 09 May 2012, Terrence Meiczinger wrote:
> I have a top level cmake toolchain file and I want it to include another
> file. If I give the include a string filename it works. However, if I try
> to make the filename a variable, it can no longer find the included file.
> It appears cmake is stripping the path.
> 
> 
> The following works fine...
> 
> linux-gnu-x86_64.cmake:
> 
> include("/src/toolchains/linux-common.cmake")
> 
> however, if I do the following it does not..
> 
> linux-gnu-x86_64.cmake:
> set(TOOLCHAIN_COMMON "/src/toolchains/linux-common.cmake")
> message(STATUS "TOOLCHAIN_COMMON: ${TOOLCHAIN_COMMON}")
> include("${TOOLCHAIN_COMMON}")
> 
> 
> It fails:
> 
> -> cmake -DCMAKE_TOOLCHAIN_FILE=/src/toolchains/linux-gnu-x86_64.cmake
> 
> -- TOOLCHAIN_TOP:  /src/toolchains/linux-gnu-x86_64.cmake
> -- TOOLCHAIN_COMMON: /src/toolchains/linux-common.cmake
> -- The C compiler identification is GNU
> -- The CXX compiler identification is GNU
> -- Check for working C compiler: /usr/bin/gcc
> CMake Error at /src/toolchains/linux-gnu-x86_64.cmake:18 (INCLUDE):
>   include could not find load file:
> 
> /linux-common.cmake
> 
> As you can see the from the status output, the path is the same as the
> first example. However, it appears cmake is stripping it prior to actually
> including it.

Strange.

I tried to reproduce it here and was not able to.

I added this to the end of a toolchain file, and test.cmake happily issued its 
message without problems:

set(myDir "/home/alex/src/CMake/tc/test.cmake")
include("${myDir}")

If you look into CMakefiles/CMakeSystem.cmake, there the toolchain file is 
included using include(), nothing special there.

Can you send a simple testcase ?

Alex
--

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] Package installation conundrum

2012-05-09 Thread Michael Wild
On 09.05.2012, at 21:03, Alexander Neundorf  wrote:

> On Wednesday 09 May 2012, Michael Wild wrote:
> > On 05/08/2012 11:13 PM, Dave Abrahams wrote:
> > > on Tue May 08 2012, Alexander Neundorf 
> > >  wrote:
> > >> On Tuesday 08 May 2012, Dave Abrahams wrote:
> > >>> Here's another one!
> > >>>
> > >>> Scenario:
> > >>>
> > >>> * I am running CMake under 0install to build and install libraries
> > >>>
> > >>> * Each library builds a package SomePackage for the library binaries
> > >>> and another package SomePackage-dev for the library headers (and
> > >>> import libraries on Windows)
> > >>>
> > >>> * The FindSomePackage.cmake file is part of the -dev package
> > >>>
> > >>> * After building, 0install moves each package's build products into a
> > >>> mostly-unpredictable subdirectory of its otherwise-read-only "cache"
> > >>> (~/.cache/0install.net/). The subdirectory's name is determined by a
> > >>> hash of the files.
> > >>>
> > >>> * To get this working, I followed the scheme discussed here:
> > >>>
> > >>> http://news.gmane.org/find-root.php?message_id=%3cm2lil6s8jq.fsf%40plut
> > >>> o.l uannocracy.com%3e
> > >>>
> > >>> Summary:
> > >>>
> > >>> 1. Create a 0install "SomePackage-preinstall" package. Building this
> > >>> package involves CMake building and installing both SomePackage and
> > >>> SomePackage-dev into separate subdirectories (main/ and dev/) of
> > >>> some prefix. 0install thereafter moves the whole directory tree
> > >>> into its cache in a directory called sha1=someuglyhash
> > >>>
> > >>> 2. SomePackage's 0installation procedure is to copy
> > >>> sha1=someuglyhash/main/ into its distribution directory (which then
> > >>> ends up in
> > >>> ~/.cache/0install.net/sha1=otheruglyhash)
> > >>>
> > >>> 3. SomePackage-dev's 0installation procedure is to copy
> > >>> sha1=someuglyhash/dev/ into its distribution directory
> > >>>
> > >>> Problem: FindSomePackageConfig.cmake now has the wrong path to the
> > >>> library binaries.
> > >>>
> > >>> Any help most appreciated.
> > >>
> > >> Can you please summarize what you actually want to achieve ?
> > >
> > > Well, I tried to, above.
> > >
> > > In short, I want to create separate main and -dev packages without
> > > building twice, under the constraints imposed by 0install.
> > >
> > >> Do you say that libFoo installs a FindFoo.cmake as part of libFoo-devel
> > >> ?
> > >>
> > >> If that's the case, then this is wrong.
> > >
> > > I'm sorry, that *is* wrong. It installs a FooConfig.cmake as part of
> > > libFoo.devel
> > >
> > >> FindFoo.cmake must be part of the using software, not of the software to
> > >> be searched.
> > >>
> > >> Why do you have to find the installed library in this cache directory
> > >> ?
> > >
> > > Because, in a 0install world, that's where things go when you "install"
> > > them.
> >
> > Ok, how you do it along these lines:
> >
> > CMakeLists.txt:
> > #-- BOF
> >
> > cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
> > project(Foo)
> >
> > set(FOO_VERSION 1.2.3)
> >
> > # initialize (absolute) installation directory variables
> > set(INSTALL_BIN_DIR bin CACHE PATH "Install path for binaries")
> > set(INSTALL_LIB_DIR lib CACHE PATH "Install path for libraries")
> > set(INSTALL_INCLUDE_DIR include CACHE PATH "Install path for headers")
> > # this is for UNIX systems, see docs of find_package() for the search
> > # paths on APPLE and WIN32
> > set(INSTALL_CMAKE_DIR lib/foo-${FOO_VERSION}/cmake CACHE PATH
> > "Install path for CMake files")
> > foreach(t BIN LIB INCLUDE CMAKE)
> > if(NOT IS_ABSOLUTE ${INSTALL_${t}_DIR})
> > set(INSTALL_${t}_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_${t}_DIR})
> > endif()
> > mark_as_advanced(INSTALL_${t}_DIR)
> > endforeach()
> >
> > # configure FooConfig.cmake and friends. FooConfig.cmake must be able
> > # to locate FooExports.cmake and FOO_INCLUDE_DIR relative to its own
> > # directory without using absolute paths.
> > configure_file(cmake/FooConfig.cmake.in
> > ${PROJECT_BINARY_DIR}/FooConfig.cmake @ONLY)
> Please have a lokok at the new macro configure_package_config_file() which is 
> in cmake 2.8.8.
> This helps a lot with writing config files which are relocatable.
> The Config.cmake.in file has to contains a few special variables/macros:
> @PACKAGE_INIT@
> set(FOO_INCLUDE_DIR "@PACKAGE_INSTALL_INCLUDE_DIR@" )
> set(FOO_BIN_DIR "@PACKAGE_INSTALL_BIN_DIR@" )
> i.e. for every FOO_XYZ variable use a @PACKAGE_FOO_XYZ@ variable, and the 
> configure_package_config_file() will replace this with the help of the 
> @PACKAGE_INIT@ macro with a relocatable version.
> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#module:CMakePackageConfigHelpers
> > configure_file(cmake/FooConfigVersion.cmake.in
> > ${PROJECT_BINARY_DIR}/FooConfigVersion.cmake @ONLY)
> >
> > # configure the headers into the build tree so the package can be used
> > # without installing it and not hard-coding the source/build directory
> > # information into FooConfig.cmake
> > configure_file(include/foo.h

Re: [CMake] configure_file as a build step?

2012-05-09 Thread Jensen, Erik A
That worked, although a little roundabout. Thank you.

Would there be any interest in having an easier way to do this? It seems like 
it could be usefully in a fair number of situations.

Maybe an additional -E command:
cmake -E configure_file -D var1=value1 -D var2=value2 --at-only infile outfile

Or even a way to run arbitrary CMake commands without a script file:
cmake -D var1=value1 -D var2=value2 -R "configure_file(infile outfile @ONLY)"

This would make it possible to avoid having a whole other file just to execute 
one CMake command at build time.

Thoughts?

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Michael Wild
Sent: Tuesday, May 01, 2012 10:33 PM
To: cmake@cmake.org
Subject: Re: [CMake] configure_file as a build step?

You can configure_file() a CMake-script which itself then performs the
configure_file() in a custom command. E.g.:


# CMakeLists.txt:
#...
set(FOO "Some text to show up in json_file.json")
set(BAR "More text")
configure_file(configure_json_file.cmake.in
  ${CMAKE_CURRENT_BINARY_DIR}/configure_json_file.cmake @ONLY)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/json_file.json
  COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/configure_json_file.cmake
  DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/configure_json_file.cmake
${CMAKE_CURRENT_SOURCE_DIR}/json_file.json.in
  COMMENT "Configuring json_file.json"
  VERBATIM)

add_custom_target(configure_json ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/json_file.json)
#...
# EOF


# configure_json_file.cmake.in:
set(SRC_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
set(BIN_DIR "@CMAKE_CURRENT_BINARY_DIR@")
set(FOO "@FOO@")
set(BAR "@BAR@")
configure_file(${SRC_DIR}/json_file.json.in
  ${BIN_DIR}/json_file.json @ONLY)
# EOF


HTH

Michael

On 05/02/2012 01:16 AM, Jensen, Erik A wrote:
> I have a JSON file that needs to have some values set based on the
> project's configuration. During development, this file can change rather
> frequently.
> 
>  
> 
> Currently, I am using configure_file to fill in the required values.
> Unfortunately, every time the file is modified, it triggers CMake to do
> a complete configuration and generation step. This slows down rebuilds,
> and is especially problematic when using Visual Studio, where the
> solution has to be reloaded after it is regenerated.
> 
>  
> 
> Is there any way to have the file generated as part of the build instead
> of part of the configuration/generation step?
> 
>  
> 
> Thanks,
> 
> -- Erik 

--

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] Problem with Visual Studio, custom commands, and dependencies. Bug?

2012-05-09 Thread Jensen, Erik A
Part of my build involves generating an archive of several files. To do this, I 
have custom commands for copying each file into a directory (some from the 
source tree, some from the build tree), a custom command for generating the 
archive, and a custom target that depends on the latter custom command. Each 
copy command depends on its source file, and the archive command depends on all 
of the destination files.

This works fine with NMake files, but I have noticed a problem with Visual 
Studio 2010 solution files: when I modify a source file and build, the command 
to copy the file into the directory is run, but the command to build the 
archive is not run unless I run build a second time. It seems that Visual 
Studio checks the dependencies for the archive command before running the copy 
commands, so it doesn't pick up the changed files until a subsequent run.

Is this a known limitation, or a bug in the generated files? It seems like it 
could be solved in this case by also including dependencies of dependencies in 
the generated project files, but I haven't thought about it enough to know if 
that would cause other problems.

Thanks.
-- Erik
--

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] Package installation conundrum

2012-05-09 Thread Alexander Neundorf
On Wednesday 09 May 2012, Michael Wild wrote:
> On 05/08/2012 11:13 PM, Dave Abrahams wrote:
> > on Tue May 08 2012, Alexander Neundorf  wrote:
> >> On Tuesday 08 May 2012, Dave Abrahams wrote:
> >>> Here's another one!
> >>> 
> >>> Scenario:
> >>> 
> >>> * I am running CMake under 0install to build and install libraries
> >>> 
> >>> * Each library builds a package SomePackage for the library binaries
> >>> and another package SomePackage-dev for the library headers (and
> >>> import libraries on Windows)
> >>> 
> >>> * The FindSomePackage.cmake file is part of the -dev package
> >>> 
> >>> * After building, 0install moves each package's build products into a
> >>> mostly-unpredictable subdirectory of its otherwise-read-only "cache"
> >>> (~/.cache/0install.net/). The subdirectory's name is determined by a
> >>> hash of the files.
> >>> 
> >>> * To get this working, I followed the scheme discussed here:
> >>> 
> >>> http://news.gmane.org/find-root.php?message_id=%3cm2lil6s8jq.fsf%40plut
> >>> o.l uannocracy.com%3e
> >>> 
> >>> Summary:
> >>> 
> >>> 1. Create a 0install "SomePackage-preinstall" package. Building this
> >>> package involves CMake building and installing both SomePackage and
> >>> SomePackage-dev into separate subdirectories (main/ and dev/) of
> >>> some prefix. 0install thereafter moves the whole directory tree
> >>> into its cache in a directory called sha1=someuglyhash
> >>> 
> >>> 2. SomePackage's 0installation procedure is to copy
> >>> sha1=someuglyhash/main/ into its distribution directory (which then
> >>> ends up in
> >>> ~/.cache/0install.net/sha1=otheruglyhash)
> >>> 
> >>> 3. SomePackage-dev's 0installation procedure is to copy
> >>> sha1=someuglyhash/dev/ into its distribution directory
> >>> 
> >>> Problem: FindSomePackageConfig.cmake now has the wrong path to the
> >>> library binaries.
> >>> 
> >>> Any help most appreciated.
> >> 
> >> Can you please summarize what you actually want to achieve ?
> > 
> > Well, I tried to, above.
> > 
> > In short, I want to create separate main and -dev packages without
> > building twice, under the constraints imposed by 0install.
> > 
> >> Do you say that libFoo installs a FindFoo.cmake as part of libFoo-devel
> >> ?
> >> 
> >> If that's the case, then this is wrong.
> > 
> > I'm sorry, that *is* wrong.  It installs a FooConfig.cmake as part of
> > libFoo.devel
> > 
> >> FindFoo.cmake must be part of the using software, not of the software to
> >> be searched.
> >> 
> >> Why do you have to find the installed library in this cache directory
> >> ?
> > 
> > Because, in a 0install world, that's where things go when you "install"
> > them.
> 
> Ok, how you do it along these lines:
> 
> CMakeLists.txt:
> #-- BOF
> 
> cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
> project(Foo)
> 
> set(FOO_VERSION 1.2.3)
> 
> # initialize (absolute) installation directory variables
> set(INSTALL_BIN_DIR bin CACHE PATH "Install path for binaries")
> set(INSTALL_LIB_DIR lib CACHE PATH "Install path for libraries")
> set(INSTALL_INCLUDE_DIR include CACHE PATH "Install path for headers")
> # this is for UNIX systems, see docs of find_package() for the search
> # paths on APPLE and WIN32
> set(INSTALL_CMAKE_DIR lib/foo-${FOO_VERSION}/cmake CACHE PATH
>   "Install path for CMake files")
> foreach(t BIN LIB INCLUDE CMAKE)
>   if(NOT IS_ABSOLUTE ${INSTALL_${t}_DIR})
> set(INSTALL_${t}_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_${t}_DIR})
>   endif()
>   mark_as_advanced(INSTALL_${t}_DIR)
> endforeach()
> 
> # configure FooConfig.cmake and friends. FooConfig.cmake must be able
> # to locate FooExports.cmake and FOO_INCLUDE_DIR relative to its own
> # directory without using absolute paths.
> configure_file(cmake/FooConfig.cmake.in
>   ${PROJECT_BINARY_DIR}/FooConfig.cmake @ONLY)

Please have a lokok at the new macro configure_package_config_file() which is 
in cmake 2.8.8.
This helps a lot with writing config files which are relocatable.

The Config.cmake.in file has to contains a few special variables/macros:

@PACKAGE_INIT@

set(FOO_INCLUDE_DIR "@PACKAGE_INSTALL_INCLUDE_DIR@" )
set(FOO_BIN_DIR "@PACKAGE_INSTALL_BIN_DIR@" )

i.e. for every FOO_XYZ variable use a @PACKAGE_FOO_XYZ@ variable, and the 
configure_package_config_file() will replace this with the help of the 
@PACKAGE_INIT@ macro with a relocatable version.
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#module:CMakePackageConfigHelpers

> configure_file(cmake/FooConfigVersion.cmake.in
>   ${PROJECT_BINARY_DIR}/FooConfigVersion.cmake @ONLY)
> 
> # configure the headers into the build tree so the package can be used
> # without installing it and not hard-coding the source/build directory
> # information into FooConfig.cmake
> configure_file(include/foo.h
>   ${PROJECT_BINARY_DIR}/include/foo.h COPYONLY)

The input file should have a suffix which indicates it is a file which is 
intended to be configured, usually foo.h.in.

Alex
--

Powered by www.kitware.com

Visit other Kitware open-source proje

[CMake] INCLUDE command within a toolchain file is stripping file path if filename is a variable?

2012-05-09 Thread Terrence Meiczinger
I have a top level cmake toolchain file and I want it to include another file. 
If I give the include a string filename it works. However, if I try to make the 
filename a variable, it can no longer find the included file. It appears cmake 
is stripping the path.


The following works fine...

linux-gnu-x86_64.cmake:

include("/src/toolchains/linux-common.cmake")

however, if I do the following it does not..

linux-gnu-x86_64.cmake:
set(TOOLCHAIN_COMMON "/src/toolchains/linux-common.cmake")
message(STATUS "TOOLCHAIN_COMMON: ${TOOLCHAIN_COMMON}")
include("${TOOLCHAIN_COMMON}")


It fails:

-> cmake -DCMAKE_TOOLCHAIN_FILE=/src/toolchains/linux-gnu-x86_64.cmake

-- TOOLCHAIN_TOP:  /src/toolchains/linux-gnu-x86_64.cmake
-- TOOLCHAIN_COMMON: /src/toolchains/linux-common.cmake
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
CMake Error at /src/toolchains/linux-gnu-x86_64.cmake:18 (INCLUDE):
  include could not find load file:

    /linux-common.cmake

As you can see the from the status output, the path is the same as the first 
example. However, it appears cmake is stripping it prior to actually including 
it.


Now, if I change the include as follows, it works... but this seems icky.


include("${${TOOLCHAIN_COMMON}}")

Any insight into why this behavior is occurring?

Thanks,

Terrence
--

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 doesn't recognize custom templates

2012-05-09 Thread NoRulez
>> By the way could you try 2.8.8 instead of 2.8.7 ?Yes, I will try it tomorrow (I read the changelog http://www.cmake.org/files/v2.8/CMakeChangeLog-2.8.8 but I can't find any details where this behavior may be fixed)Because on our Buildserver CMake 2.8.7 is installed and if no relevant changes are made in 2.8.8, then I would be happy if I could retain the CMake 2.8.7 installation (Never change a running system ;-))But I will try 2.8.8 on the workstation and send you the output from 2.8.7 ("--verbose --debug").Best RegardsAm 09. Mai 2012 um 11:31 schrieb Eric Noulard :2012/5/9 : >>> Is it the case? Is there any file in _CPack_Packages\win32\NSIS\MyProject >>> ? > No, there aren't any files > > >>> Could you copy/paste the exact message you get and may be running cpack >>> on the command line with ---verbose and --debug. > Sure, but I can only do so tomorrow > > >>> Nope normally you don't but what are you doing in your >>> "CPackConfig.cmake.in" ? > I only set the CPACK variables and additional variables which are used in > the NSIS.template.in file. > Because if I don't use the custom CPackConfig.cmake.in file then the > variables in the NSIS.template.in files aren't resolved.  Please send us those files. As usual the devil may be in the details.  >>> And do you have any INSTALL(CODE or INSTALL(SCRIPTS in your project? > Yes, i use this for the BundleUtilities like in the BundleUtilities example > > INSTALL(CODE " > file(GLOB_RECURSE SHARED_LIBS > \"\${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\") > include(BundleUtilities) > fixup_bundle(\"${APPS}\" \"\${SHARED_LIBS}\" \"${DIRS}\") > " COMPONENT Runtime)  I'm not a BundleUtilities user but code like that may break with CPack because CPack may internally use DESTDIR to do its local installation so that one should usually write:  $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX} rather than ${CMAKE_INSTALL_PREFIX}  however since you have NO file at all in the local CPack install dir, the problem is elsewhere.  By the way could you try 2.8.8 instead of 2.8.7 ?  --  Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.org--

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] ExternalProject danger- source directory is deleted

2012-05-09 Thread Jean-Christophe Fillion-Robin
Hi Pat,

In some extent, I think the problem has been addressed in CMake master. See


http://public.kitware.com/gitweb?p=cmake.git;a=commitdiff;h=987c017f6b1b49ab832c244166e30e07260432da

http://public.kitware.com/gitweb?p=cmake.git;a=commitdiff;h=987c017f6b1b49ab832c244166e30e07260432da
and
  http://www.cmake.org/Bug/view.php?id=12564

Hth
Jc

On Wed, May 9, 2012 at 2:32 PM, Pat Marion  wrote:

> When using ExternalProject, sometimes the build rules decide that an
> existing source directory needs to be deleted and re{downloaded,cloned}.
> In my experience, this is pretty dangerous and I have lost work due to it.
> Would it be possible to throw an error and ask the user to perform the
> delete, or pass a --force argument?  Is it the case that dashboards rely on
> the ability to do a hard-delete of a source directory during intermediate
> builds?
>
> Pat
>
> --
>
> 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
>



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

[CMake] ExternalProject danger- source directory is deleted

2012-05-09 Thread Pat Marion
When using ExternalProject, sometimes the build rules decide that an
existing source directory needs to be deleted and re{downloaded,cloned}.
In my experience, this is pretty dangerous and I have lost work due to it.
Would it be possible to throw an error and ask the user to perform the
delete, or pass a --force argument?  Is it the case that dashboards rely on
the ability to do a hard-delete of a source directory during intermediate
builds?

Pat
--

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] Secret precompiled header support?

2012-05-09 Thread Robert Dailey
To my knowledge there are no dedicated target properties or commands that
allow one to easily add precompiled headers support to a target. In my
case, I'm generating for visual studio and I have the following that I can
use to enable precompiled headers:

macro( _precompiled_headers PrecompiledHeader PrecompiledSource SourcesVar )
if( MSVC )
get_filename_component( PrecompiledBasename ${PrecompiledHeader} NAME_WE )
set( PrecompiledBinary
"${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch" )
set( Sources ${${SourcesVar}} )

set_property(
SOURCE ${PrecompiledSource} APPEND_STRING PROPERTY
COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
)

set_property(
SOURCE ${PrecompiledSource} APPEND PROPERTY
OBJECT_OUTPUTS "${PrecompiledBinary}"
)
 set_property(
SOURCE ${Sources} APPEND_STRING PROPERTY
COMPILE_FLAGS "/Yu\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
)
 set_property(
SOURCE ${Sources} APPEND PROPERTY
OBJECT_DEPENDS "${PrecompiledBinary}"
)
else()
message( "Precompiled header support not provided for this platform" )
endif()
 # Add precompiled header to SourcesVar
list( APPEND ${SourcesVar} ${PrecompiledSource} )
endmacro()

The one interesting thing I have noticed is the way these compile flags
translate to actual vcproj output:


 

CMake seems to do more than just add them as general compiler flags, it
seems to know exactly which attributes in the VCPROJ XML are mapped to
their respective command line alternatives, and uses the appropriate ones.
If this is true, why do we not have a dedicated target & source file
property that I can use to enable precompiled headers instead of using
these command line strings directly? Am I misunderstanding something?
--

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 doesn't recognize custom templates

2012-05-09 Thread Eric Noulard
2012/5/9  :
>>> Is it the case? Is there any file in _CPack_Packages\win32\NSIS\MyProject
>>> ?
> No, there aren't any files
>
>
>>> Could you copy/paste the exact message you get and may be running cpack
>>> on the command line with ---verbose and --debug.
> Sure, but I can only do so tomorrow
>
>
>>> Nope normally you don't but what are you doing in your
>>> "CPackConfig.cmake.in" ?
> I only set the CPACK variables and additional variables which are used in
> the NSIS.template.in file.
> Because if I don't use the custom CPackConfig.cmake.in file then the
> variables in the NSIS.template.in files aren't resolved.

Please send us those files.
As usual the devil may be in the details.

>>> And do you have any INSTALL(CODE or INSTALL(SCRIPTS in your project?
> Yes, i use this for the BundleUtilities like in the BundleUtilities example
>
> INSTALL(CODE "
> file(GLOB_RECURSE SHARED_LIBS
>   \"\${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
> include(BundleUtilities)
> fixup_bundle(\"${APPS}\" \"\${SHARED_LIBS}\" \"${DIRS}\")
> " COMPONENT Runtime)

I'm not a BundleUtilities user but code like that may break with CPack because
CPack may internally use DESTDIR to do its local installation so that
one should usually write:

$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}
rather than
${CMAKE_INSTALL_PREFIX}

however since you have NO file at all in the local CPack install dir,
the problem is elsewhere.

By the way could you try 2.8.8 instead of 2.8.7 ?

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

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 doesn't recognize custom templates

2012-05-09 Thread norulez
>> Is it the case? Is there any file in _CPack_Packages\win32\NSIS\MyProject ?No, there aren't any files>> Could you copy/paste the exact message you get and may be running cpack on the command line with ---verbose and --debug.Sure, but I can only do so tomorrow>> Nope normally you don't but what are you doing in your "CPackConfig.cmake.in" ?I only set the CPACK variables and additional variables which are used in the NSIS.template.in file.Because if I don't use the custom CPackConfig.cmake.in file then the variables in the NSIS.template.in files aren't resolved.>> And do you have any INSTALL(CODE or INSTALL(SCRIPTS in your project?Yes, i use this for the BundleUtilities like in the BundleUtilities exampleINSTALL(CODE "file(GLOB_RECURSE SHARED_LIBS  \"\${CMAKE_INSTALL_PREFIX}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")include(BundleUtilities)fixup_bundle(\"${APPS}\" \"\${SHARED_LIBS}\" \"${DIRS}\")" COMPONENT Runtime)Best RegardsAm 09. Mai 2012 um 10:55 schrieb Eric Noulard :2012/5/9 : [...]  > > If I run the INSTALL target under VS then the files are correctly copied to > C:\Program Files\MyProject > But only the PACKAGE target under VS doesn't work, and I get the message > from the last email I sent.  >> So, my custom CPackConfig.cmake.in and my NSIS.template.in seems to work, >> but CPack reports that there are not files (*.* under >> _CPack_Packages\win32\NSIS\MyProject)  Is it the case? Is there any file in _CPack_Packages\win32\NSIS\MyProject ?  Could you copy/paste the exact message you get and may be running cpack on the command line with ---verbose and --debug.   >> I have install statements for the executable and also for the shared >> libraries. What could be the problem? >> Do I need a special setting in CPackConfig.cmake.in or in NSIS.tempalte.in >> to copy the files into the _CPack_Packages subfolder?  Nope normally you don't but what are you doing in your "CPackConfig.cmake.in" ?  And do you have any INSTALL(CODE or INSTALL(SCRIPTS in your project?   --  Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.org--

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 doesn't recognize custom templates

2012-05-09 Thread Eric Noulard
2012/5/9  :
[...]

>
> If I run the INSTALL target under VS then the files are correctly copied to
> C:\Program Files\MyProject
> But only the PACKAGE target under VS doesn't work, and I get the message
> from the last email I sent.

>> So, my custom CPackConfig.cmake.in and my NSIS.template.in seems to work,
>> but CPack reports that there are not files (*.* under
>> _CPack_Packages\win32\NSIS\MyProject)

Is it the case? Is there any file in
 _CPack_Packages\win32\NSIS\MyProject ?

Could you copy/paste the exact message you get  and may be
running cpack on the command line with ---verbose and --debug.


>> I have install statements for the executable and also for the shared
>> libraries. What could be the problem?
>> Do I need a special setting in CPackConfig.cmake.in or in NSIS.tempalte.in
>> to copy the files into the _CPack_Packages subfolder?

Nope normally you don't but what are you doing in your "CPackConfig.cmake.in" ?

And do you have any INSTALL(CODE or INSTALL(SCRIPTS in your project?


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

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] C#/.NET

2012-05-09 Thread Pau Garcia i Quiles
Hi,

>From what I can see, those custom commands do not generate .sln and
MSBuild .csproj files, which means debugging will be difficult.

This is a huge project with hundreds of subprojects and lots of .NET
stuff: WPF, WCF, MEF, third-party dependencies, some C++ and C++/CLI,
etc. It may be possible to extend those custom commands do entertain
all of that, but the result will certainly be ugly and hard to use.

Raw MSBuild does not look good (how difficult can it be to copy a
directory!?) and NAnt... well, not much better than raw MSBuild:
XML-based, does not generate .sln/.csproj, etc.

I will propose adding proper C#/.NET support to CMake but I seriously
doubt it'll get approved, it'll probably take too long to be done and
stable :-(



On Wed, May 9, 2012 at 7:36 PM, David Cole  wrote:
> As you can see from Mathieu's response, and the links he provided,
> building C# stuff from CMake is certainly possible with lots of custom
> command mojo.
>
> As the guy who wrote that mojo for mummy and activizdotnet, and the
> guy who closed the bug in our issue tracker until a funder/volunteer
> comes along (still waiting...), I'm certainly in the position to say:
> it's possible, but not as pretty as you'd like it to be...
>
> Let us know if you tackle it via the custom command route.
>
> Another option these days would be to have csproj files and build them
> via ExternalProject and devenv or msbuild command lines. (Which is
> really just custom commands under the hood...)
>
>
> Cheers ( & good luck ),
> David
>
>
> On Wed, May 9, 2012 at 11:04 AM, Mathieu Malaterre
>  wrote:
>> Hi,
>>
>> On Wed, May 9, 2012 at 11:19 AM, Pau Garcia i Quiles
>>  wrote:
>>> Is anyone using CMake for C#/.NET projects? We are looking to moving
>>> from Visual Studio solutions/projects to a proper build system and
>>> CMake would be my preferred choice.
>>
>> Here is my two cents. Until CMake actually do support C#, I do not
>> believe this is worth the effort to use cmake. There are only two C#
>> implementations and both of them do support *.sln/csproj files.
>>
>> You can have a look at two projects mummy [1] & gdcm [2] they both
>> uses C# and you will see the amount of detail needed to keep track of
>> dependencies and get things right. So if you project is only using C#,
>> I would suggest to go with the default VS tools. If your project is
>> using cmake anyway, be ready for some low level cmake programming [3].
>>
>> 2cts
>>
>>
>> [1] http://www.kitware.com/products/avdownload.php
>> [2] http://gdcm.sourceforge.net/
>> [3] http://public.kitware.com/Bug/view.php?id=7918
>>
>> --
>> Mathieu
>> --
>>
>> 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



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
--

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 doesn't recognize custom templates

2012-05-09 Thread Eric Noulard
2012/5/9 David Cole :
> What do your install commands look like?
>
> You're not trying to install files into absolute paths on Windows, are you?

This can be checked easily by running:

cpack --debug -G NSIS

then you should get message like:

Got some ABSOLUTE DESTINATION FILES: ...

This can be found in cmake_install.cmake as well, where some

list(APPEND CPACK_ABSOLUTE_DESTINATION_FILES 

statement may be found.

> (i.e. -- all things should be installed underneath
> CMAKE_INSTALL_PREFIX in a normal 'make install' tree in order to work
> well on Windows with the NSIS generator.)

May be we could add some explicit warning/error in CPack when a specific
generator cannot handle absolute destination?

David: what do you think, would it be useful ?

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

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 doesn't recognize custom templates

2012-05-09 Thread norulez
The install command looks something likemacro(InstallTarget TARGET)    INSTALL(TARGETS ${TARGET}
BUNDLE DESTINATION .
RUNTIME DESTINATION .ARCHIVE DESTINATION .LIBRARY DESTINATION .
)endmacro(InstallTarget)...InstallTarget(MyApp)..InstallTarget(MyLib)Other files will be installed like the following:install(FILES "${CMAKE_SOURCE_DIR}/setup/vcredist_x86.exe  DESTINATION .)If I run the INSTALL target under VS then the files are correctly copied to C:\Program Files\MyProjectBut only the PACKAGE target under VS doesn't work, and I get the message from the last email I sent.Best RegardsAm 09. Mai 2012 um 19:39 schrieb David Cole :What do your install commands look like?  You're not trying to install files into absolute paths on Windows, are you? (i.e. -- all things should be installed underneath CMAKE_INSTALL_PREFIX in a normal 'make install' tree in order to work well on Windows with the NSIS generator.)On Wed, May 9, 2012 at 1:34 PM, NoRulez  wrote: > Hello Eric, > > I've found the problem, it was my mistake. A few lines later i overwrote the > CPACK_MODULE_PATH setting. [RESOLVED] > > But what I didn't understand was the fact that it would work on Windows 7 > with the same settings. > > So, my custom CPackConfig.cmake.in and my NSIS.template.in seems to work, > but CPack reports that there are not files (*.* under > _CPack_Packages\win32\NSIS\MyProject) > I have install statements for the executable and also for the shared > libraries. What could be the problem? > Do I need a special setting in CPackConfig.cmake.in or in NSIS.tempalte.in > to copy the files into the _CPack_Packages subfolder? > > Thank you for your help > > Best Regards > > Am 08.05.2012 um 15:19 schrieb noru...@me.com: > > >> It is only a copy from the original. It doesn't work in windows xp in >> general. >> >> Best Regards >> >> Am 08.05.2012 um 13:51 schrieb Eric Noulard : >> >>> 2012/5/8 :  There is no difference with your command. It still uses the  NSIS.template.in file from the CMake installation. >>> >>> Are there any difference between the 2 CPackConfig.cmake files ? >>> WinXP failing case vs Win7 working case? >>> >>> Does the ${CMAKE_SOURCE_DIR}/cmake/NSIS.template.in file has any weird >>> attribute? >>> Is it readable by "normal user"? (you said it works if you are admin >>> right?) >>>  Yes I tried the configurations in new build directories such as build1  ... buildn. >>> >>> I got that but I suspected something in the source tree (where your >>> NSIS.template.in is) >>> so starting from another source tree (taken from your VCS) may exhibit >>> different behavior. >>> >>> If all that fail I'm afraid I cannot help more unless you can build a >>> minimalistic example >>> which shows the wrong behavior. >>> >>> (I have no WinXP at hand but then I may look into the source more >>> thoroughly). >>> >>> -- >>> Erk >>> Le gouvernement représentatif n'est pas la démocratie -- >>> http://www.le-message.org >> -- >> >> 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] CPack doesn't recognize custom templates

2012-05-09 Thread David Cole
What do your install commands look like?

You're not trying to install files into absolute paths on Windows, are
you? (i.e. -- all things should be installed underneath
CMAKE_INSTALL_PREFIX in a normal 'make install' tree in order to work
well on Windows with the NSIS generator.)



On Wed, May 9, 2012 at 1:34 PM, NoRulez  wrote:
> Hello Eric,
>
> I've found the problem, it was my mistake. A few lines later i overwrote the
> CPACK_MODULE_PATH setting. [RESOLVED]
>
> But what I didn't understand was the fact that it would work on Windows 7
> with the same settings.
>
> So, my custom CPackConfig.cmake.in and my NSIS.template.in seems to work,
> but CPack reports that there are not files (*.* under
> _CPack_Packages\win32\NSIS\MyProject)
> I have install statements for the executable and also for the shared
> libraries. What could be the problem?
> Do I need a special setting in CPackConfig.cmake.in or in NSIS.tempalte.in
> to copy the files into the _CPack_Packages subfolder?
>
> Thank you for your help
>
> Best Regards
>
> Am 08.05.2012 um 15:19 schrieb noru...@me.com:
>
>
>> It is only a copy from the original. It doesn't work in windows xp in
>> general.
>>
>> Best Regards
>>
>> Am 08.05.2012 um 13:51 schrieb Eric Noulard :
>>
>>> 2012/5/8 :
 There is no difference with your command. It still uses the
 NSIS.template.in file from the CMake installation.
>>>
>>> Are there any difference between the 2 CPackConfig.cmake files ?
>>> WinXP failing case vs Win7 working case?
>>>
>>> Does the ${CMAKE_SOURCE_DIR}/cmake/NSIS.template.in file has any weird
>>> attribute?
>>> Is it readable by "normal user"? (you said it works if you are admin
>>> right?)
>>>
 Yes I tried the configurations in new build directories such as build1
 ... buildn.
>>>
>>> I got that but I suspected something in the source tree (where your
>>> NSIS.template.in is)
>>> so starting from another source tree (taken from your VCS) may exhibit
>>> different behavior.
>>>
>>> If all that fail I'm afraid I cannot help more unless you can build a
>>> minimalistic example
>>> which shows the wrong behavior.
>>>
>>> (I have no WinXP at hand but then I may look into the source more
>>> thoroughly).
>>>
>>> --
>>> Erk
>>> Le gouvernement représentatif n'est pas la démocratie --
>>> http://www.le-message.org
>> --
>>
>> 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] C#/.NET

2012-05-09 Thread David Cole
As you can see from Mathieu's response, and the links he provided,
building C# stuff from CMake is certainly possible with lots of custom
command mojo.

As the guy who wrote that mojo for mummy and activizdotnet, and the
guy who closed the bug in our issue tracker until a funder/volunteer
comes along (still waiting...), I'm certainly in the position to say:
it's possible, but not as pretty as you'd like it to be...

Let us know if you tackle it via the custom command route.

Another option these days would be to have csproj files and build them
via ExternalProject and devenv or msbuild command lines. (Which is
really just custom commands under the hood...)


Cheers ( & good luck ),
David


On Wed, May 9, 2012 at 11:04 AM, Mathieu Malaterre
 wrote:
> Hi,
>
> On Wed, May 9, 2012 at 11:19 AM, Pau Garcia i Quiles
>  wrote:
>> Is anyone using CMake for C#/.NET projects? We are looking to moving
>> from Visual Studio solutions/projects to a proper build system and
>> CMake would be my preferred choice.
>
> Here is my two cents. Until CMake actually do support C#, I do not
> believe this is worth the effort to use cmake. There are only two C#
> implementations and both of them do support *.sln/csproj files.
>
> You can have a look at two projects mummy [1] & gdcm [2] they both
> uses C# and you will see the amount of detail needed to keep track of
> dependencies and get things right. So if you project is only using C#,
> I would suggest to go with the default VS tools. If your project is
> using cmake anyway, be ready for some low level cmake programming [3].
>
> 2cts
>
>
> [1] http://www.kitware.com/products/avdownload.php
> [2] http://gdcm.sourceforge.net/
> [3] http://public.kitware.com/Bug/view.php?id=7918
>
> --
> Mathieu
> --
>
> 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] CPack doesn't recognize custom templates

2012-05-09 Thread NoRulez
Hello Eric,I've found the problem, it was my mistake. A few lines later i overwrote the CPACK_MODULE_PATH setting. [RESOLVED]

But what I didn't understand was the fact that it would work on Windows 7 with the same settings.So, my custom CPackConfig.cmake.in and my NSIS.template.in seems to work, but CPack reports that there are not files (*.* under _CPack_Packages\win32\NSIS\MyProject)I have install statements for the executable and also for the shared libraries. What could be the problem?Do I need a special setting in CPackConfig.cmake.in or in NSIS.tempalte.in to copy the files into the _CPack_Packages subfolder?

Thank you for your help

Best Regards

Am 08.05.2012 um 15:19 schrieb noru...@me.com:

> It is only a copy from the original. It doesn't work in windows xp in general.
> 
> Best Regards
> 
> Am 08.05.2012 um 13:51 schrieb Eric Noulard :
> 
>> 2012/5/8  :
>>> There is no difference with your command. It still uses the NSIS.template.in file from the CMake installation.
>> 
>> Are there any difference between the 2 CPackConfig.cmake files ?
>> WinXP failing case vs Win7 working case?
>> 
>> Does the ${CMAKE_SOURCE_DIR}/cmake/NSIS.template.in file has any weird
>> attribute?
>> Is it readable by "normal user"? (you said it works if you are admin right?)
>> 
>>> Yes I tried the configurations in new build directories such as build1 ... buildn.
>> 
>> I got that but I suspected something in the source tree (where your
>> NSIS.template.in is)
>> so starting from another source tree (taken from your VCS) may exhibit
>> different behavior.
>> 
>> If all that fail I'm afraid I cannot help more unless you can build a
>> minimalistic example
>> which shows the wrong behavior.
>> 
>> (I have no WinXP at hand but then I may look into the source more thoroughly).
>> 
>> -- 
>> Erk
>> Le gouvernement représentatif n'est pas la démocratie --
>> http://www.le-message.org
> --
> 
> 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] Volunteering to become maintainer of FindLibLZMA.cmake

2012-05-09 Thread David Cole
Also, rather than adding yet-another-find-module to CMake, would it
instead be possible to add a LZMAConfig.cmake file to the LZMA
installation itself?

(i.e. -- are you an LZMA maintainer, and could you put that file into
the LZMA install tree...? If so, you should prefer that route, because
it will work with existing CMake unchanged: as soon as you deploy that
file, others will benefit from it immediately.)



On Wed, May 9, 2012 at 4:00 AM, Rolf Eike Beer  wrote:
>> Hi Eike,
>>
>> here a new version with the version support
>
> Looks good. Just a small nitpicks:
>
> -you should document also the LIBLZMA_VERSION_{MAJOR,MINOR,PATCH} variables
>
> -I would move setting LIBLZMA_LIBRARIES and LIBLZMA_INCLUDE_DIRS below the
> call to FPHSA and wrap it in an "if (LIBLZMA_FOUND)"
>
> Eike
> --
>
> 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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Antje Kühn
OK. Thank you very much for your help.
I think I'm now on the right way.

Antje

-Ursprüngliche Nachricht-
Von: Petr Kmoch [mailto:petr.km...@gmail.com] 
Gesendet: Mittwoch, 9. Mai 2012 17:45
An: Antje Kühn
Cc: cmake@cmake.org
Betreff: Re: [CMake] Copying a cmake generated VisualStudio project file to
another directory

In that case, cmake should already be generating this for you, from your
toplevel CMakeLists.txt file.

On Wed, May 9, 2012 at 5:23 PM, Antje Kühn  wrote:
> No, I need one "main" solution that bundles all the other "subprojects".
>
> -Ursprüngliche Nachricht-
> Von: Petr Kmoch [mailto:petr.km...@gmail.com]
> Gesendet: Mittwoch, 9. Mai 2012 17:19
> An: Antje Kühn
> Cc: cmake@cmake.org
> Betreff: Re: [CMake] Copying a cmake generated VisualStudio project 
> file to another directory
>
> For every "project()" command in CMakeLists, cmake generates one .sln 
> file (in addition to one .vcproj for each target added). Do you need 
> any extra solutions?
>
> Petr
>
> On Wed, May 9, 2012 at 5:15 PM, Antje Kühn  wrote:
>> Thank you for your answer!
>> Up to now I used qmake for building the Visual Studio project
environment.
>> For every subprojct a  *.vcxproj was built and in the end a Visual 
>> Studio solution of all the vcxproj files was created.
>> As I know there is no way in cmake to generate a VS "Solution", so my 
>> idea was to "reuse" the "original" qmake file for building the solution.
>> For this I need all my vcxproj files at a specific place.
>>
>> But now I have to look for another way
>>
>> Antje
>>
>> -Ursprüngliche Nachricht-
>> Von: Petr Kmoch [mailto:petr.km...@gmail.com]
>> Gesendet: Mittwoch, 9. Mai 2012 16:46
>> An: Antje Kühn
>> Cc: cmake@cmake.org
>> Betreff: Re: [CMake] Copying a cmake generated VisualStudio project 
>> file to another directory
>>
>> Hi.
>>
>> Custom commands are executed at build time (that is, when you do a 
>> build in Visual Studio), not at generation time (when cmake is 
>> running). There is no way to hook something to the end of the 
>> generation process itself (see
>> http://public.kitware.com/Bug/view.php?id=13020 ).
>>
>> BTW, it's generally a "Bad Idea (TM)" to move the generated tree 
>> around - it's full of absolute paths. Why do you need to move it in 
>> the
> first place?
>>
>> Petr
>>
>>
>>
>> On Wed, May 9, 2012 at 4:12 PM, Antje Kühn  wrote:
>>> Hi,
>>>
>>>
>>>
>>> I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
>>>
>>>
>>>
>>> At my CMakeLists.txt files I defined the following:
>>>
>>>
>>>
>>> add_executable(VSData ${SRC} ${INC})
>>>
>>> Target_link_libraries(VSData ${SOME_LIBS})
>>>
>>>
>>>
>>> Now I start cmake from my build directory with:
>>>
cmake -G "Visual Studio 10" ..
>>>
>>>
>>>
>>> This works and  I get the *.vcxproj files in build/VSData.
>>>
>>> Now I want to copy the generated project files to another place at 
>>> my file system.
>>>
>>> For this I added the following command at the end to my CMakeLists.txt:
>>>
>>>
>>>
>>> add_custom_command(TARGET VSData
>>>
>>>  POST_BUILD
>>>
>>>  COMMAND ${CMAKE_COMMAND}
>>>
>>>  ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj
>>> ${destDir}
>>> VERBATIM)
>>>
>>>
>>>
>>> I also tried this:
>>>
>>>
>>>
>>> add_custom_command(TARGET VSData.vcxproj
>>>
>>>    POST_BUILD
>>>
>>>    COMMAND ${CMAKE_COMMAND}
>>>
>>>    ARGS -E copy $ ${destDir}
>>> VERBATIM)
>>>
>>>
>>>
>>> But nothing happens! No error message, no warnings and the file will 
>>> not be copied!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> 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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Petr Kmoch
In that case, cmake should already be generating this for you, from
your toplevel CMakeLists.txt file.

On Wed, May 9, 2012 at 5:23 PM, Antje Kühn  wrote:
> No, I need one "main" solution that bundles all the other "subprojects".
>
> -Ursprüngliche Nachricht-
> Von: Petr Kmoch [mailto:petr.km...@gmail.com]
> Gesendet: Mittwoch, 9. Mai 2012 17:19
> An: Antje Kühn
> Cc: cmake@cmake.org
> Betreff: Re: [CMake] Copying a cmake generated VisualStudio project file to
> another directory
>
> For every "project()" command in CMakeLists, cmake generates one .sln file
> (in addition to one .vcproj for each target added). Do you need any extra
> solutions?
>
> Petr
>
> On Wed, May 9, 2012 at 5:15 PM, Antje Kühn  wrote:
>> Thank you for your answer!
>> Up to now I used qmake for building the Visual Studio project environment.
>> For every subprojct a  *.vcxproj was built and in the end a Visual
>> Studio solution of all the vcxproj files was created.
>> As I know there is no way in cmake to generate a VS "Solution", so my
>> idea was to "reuse" the "original" qmake file for building the solution.
>> For this I need all my vcxproj files at a specific place.
>>
>> But now I have to look for another way
>>
>> Antje
>>
>> -Ursprüngliche Nachricht-
>> Von: Petr Kmoch [mailto:petr.km...@gmail.com]
>> Gesendet: Mittwoch, 9. Mai 2012 16:46
>> An: Antje Kühn
>> Cc: cmake@cmake.org
>> Betreff: Re: [CMake] Copying a cmake generated VisualStudio project
>> file to another directory
>>
>> Hi.
>>
>> Custom commands are executed at build time (that is, when you do a
>> build in Visual Studio), not at generation time (when cmake is
>> running). There is no way to hook something to the end of the
>> generation process itself (see
>> http://public.kitware.com/Bug/view.php?id=13020 ).
>>
>> BTW, it's generally a "Bad Idea (TM)" to move the generated tree
>> around - it's full of absolute paths. Why do you need to move it in the
> first place?
>>
>> Petr
>>
>>
>>
>> On Wed, May 9, 2012 at 4:12 PM, Antje Kühn  wrote:
>>> Hi,
>>>
>>>
>>>
>>> I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
>>>
>>>
>>>
>>> At my CMakeLists.txt files I defined the following:
>>>
>>>
>>>
>>> add_executable(VSData ${SRC} ${INC})
>>>
>>> Target_link_libraries(VSData ${SOME_LIBS})
>>>
>>>
>>>
>>> Now I start cmake from my build directory with:
>>>
cmake -G "Visual Studio 10" ..
>>>
>>>
>>>
>>> This works and  I get the *.vcxproj files in build/VSData.
>>>
>>> Now I want to copy the generated project files to another place at my
>>> file system.
>>>
>>> For this I added the following command at the end to my CMakeLists.txt:
>>>
>>>
>>>
>>> add_custom_command(TARGET VSData
>>>
>>>  POST_BUILD
>>>
>>>  COMMAND ${CMAKE_COMMAND}
>>>
>>>  ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj
>>> ${destDir}
>>> VERBATIM)
>>>
>>>
>>>
>>> I also tried this:
>>>
>>>
>>>
>>> add_custom_command(TARGET VSData.vcxproj
>>>
>>>    POST_BUILD
>>>
>>>    COMMAND ${CMAKE_COMMAND}
>>>
>>>    ARGS -E copy $ ${destDir}
>>> VERBATIM)
>>>
>>>
>>>
>>> But nothing happens! No error message, no warnings and the file will
>>> not be copied!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> 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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Antje Kühn
No, I need one "main" solution that bundles all the other "subprojects".

-Ursprüngliche Nachricht-
Von: Petr Kmoch [mailto:petr.km...@gmail.com] 
Gesendet: Mittwoch, 9. Mai 2012 17:19
An: Antje Kühn
Cc: cmake@cmake.org
Betreff: Re: [CMake] Copying a cmake generated VisualStudio project file to
another directory

For every "project()" command in CMakeLists, cmake generates one .sln file
(in addition to one .vcproj for each target added). Do you need any extra
solutions?

Petr

On Wed, May 9, 2012 at 5:15 PM, Antje Kühn  wrote:
> Thank you for your answer!
> Up to now I used qmake for building the Visual Studio project environment.
> For every subprojct a  *.vcxproj was built and in the end a Visual 
> Studio solution of all the vcxproj files was created.
> As I know there is no way in cmake to generate a VS "Solution", so my 
> idea was to "reuse" the "original" qmake file for building the solution.
> For this I need all my vcxproj files at a specific place.
>
> But now I have to look for another way
>
> Antje
>
> -Ursprüngliche Nachricht-
> Von: Petr Kmoch [mailto:petr.km...@gmail.com]
> Gesendet: Mittwoch, 9. Mai 2012 16:46
> An: Antje Kühn
> Cc: cmake@cmake.org
> Betreff: Re: [CMake] Copying a cmake generated VisualStudio project 
> file to another directory
>
> Hi.
>
> Custom commands are executed at build time (that is, when you do a 
> build in Visual Studio), not at generation time (when cmake is 
> running). There is no way to hook something to the end of the 
> generation process itself (see
> http://public.kitware.com/Bug/view.php?id=13020 ).
>
> BTW, it's generally a "Bad Idea (TM)" to move the generated tree 
> around - it's full of absolute paths. Why do you need to move it in the
first place?
>
> Petr
>
>
>
> On Wed, May 9, 2012 at 4:12 PM, Antje Kühn  wrote:
>> Hi,
>>
>>
>>
>> I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
>>
>>
>>
>> At my CMakeLists.txt files I defined the following:
>>
>>
>>
>> add_executable(VSData ${SRC} ${INC})
>>
>> Target_link_libraries(VSData ${SOME_LIBS})
>>
>>
>>
>> Now I start cmake from my build directory with:
>>
>>>cmake -G "Visual Studio 10" ..
>>
>>
>>
>> This works and  I get the *.vcxproj files in build/VSData.
>>
>> Now I want to copy the generated project files to another place at my 
>> file system.
>>
>> For this I added the following command at the end to my CMakeLists.txt:
>>
>>
>>
>> add_custom_command(TARGET VSData
>>
>>  POST_BUILD
>>
>>  COMMAND ${CMAKE_COMMAND}
>>
>>  ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj 
>> ${destDir}
>> VERBATIM)
>>
>>
>>
>> I also tried this:
>>
>>
>>
>> add_custom_command(TARGET VSData.vcxproj
>>
>>    POST_BUILD
>>
>>    COMMAND ${CMAKE_COMMAND}
>>
>>    ARGS -E copy $ ${destDir}
>> VERBATIM)
>>
>>
>>
>> But nothing happens! No error message, no warnings and the file will 
>> not be copied!
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> 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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Antje Kühn
Thank you for your answer!
Up to now I used qmake for building the Visual Studio project environment.
For every subprojct a  *.vcxproj was built and in the end a Visual Studio
solution of all the vcxproj files was created.
As I know there is no way in cmake to generate a VS "Solution", so my idea
was to "reuse" the "original" qmake file for building the solution.
For this I need all my vcxproj files at a specific place.

But now I have to look for another way

Antje

-Ursprüngliche Nachricht-
Von: Petr Kmoch [mailto:petr.km...@gmail.com] 
Gesendet: Mittwoch, 9. Mai 2012 16:46
An: Antje Kühn
Cc: cmake@cmake.org
Betreff: Re: [CMake] Copying a cmake generated VisualStudio project file to
another directory

Hi.

Custom commands are executed at build time (that is, when you do a build in
Visual Studio), not at generation time (when cmake is running). There is no
way to hook something to the end of the generation process itself (see
http://public.kitware.com/Bug/view.php?id=13020 ).

BTW, it's generally a "Bad Idea (TM)" to move the generated tree around -
it's full of absolute paths. Why do you need to move it in the first place?

Petr



On Wed, May 9, 2012 at 4:12 PM, Antje Kühn  wrote:
> Hi,
>
>
>
> I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
>
>
>
> At my CMakeLists.txt files I defined the following:
>
>
>
> add_executable(VSData ${SRC} ${INC})
>
> Target_link_libraries(VSData ${SOME_LIBS})
>
>
>
> Now I start cmake from my build directory with:
>
>>cmake -G "Visual Studio 10" ..
>
>
>
> This works and  I get the *.vcxproj files in build/VSData.
>
> Now I want to copy the generated project files to another place at my 
> file system.
>
> For this I added the following command at the end to my CMakeLists.txt:
>
>
>
> add_custom_command(TARGET VSData
>
>  POST_BUILD
>
>  COMMAND ${CMAKE_COMMAND}
>
>  ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj ${destDir}
> VERBATIM)
>
>
>
> I also tried this:
>
>
>
> add_custom_command(TARGET VSData.vcxproj
>
>    POST_BUILD
>
>    COMMAND ${CMAKE_COMMAND}
>
>    ARGS -E copy $ ${destDir} 
> VERBATIM)
>
>
>
> But nothing happens! No error message, no warnings and the file will 
> not be copied!
>
>
>
>
>
>
>
>
>
>
>
>
> --
>
> 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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Petr Kmoch
For every "project()" command in CMakeLists, cmake generates one .sln
file (in addition to one .vcproj for each target added). Do you need
any extra solutions?

Petr

On Wed, May 9, 2012 at 5:15 PM, Antje Kühn  wrote:
> Thank you for your answer!
> Up to now I used qmake for building the Visual Studio project environment.
> For every subprojct a  *.vcxproj was built and in the end a Visual Studio
> solution of all the vcxproj files was created.
> As I know there is no way in cmake to generate a VS "Solution", so my idea
> was to "reuse" the "original" qmake file for building the solution.
> For this I need all my vcxproj files at a specific place.
>
> But now I have to look for another way
>
> Antje
>
> -Ursprüngliche Nachricht-
> Von: Petr Kmoch [mailto:petr.km...@gmail.com]
> Gesendet: Mittwoch, 9. Mai 2012 16:46
> An: Antje Kühn
> Cc: cmake@cmake.org
> Betreff: Re: [CMake] Copying a cmake generated VisualStudio project file to
> another directory
>
> Hi.
>
> Custom commands are executed at build time (that is, when you do a build in
> Visual Studio), not at generation time (when cmake is running). There is no
> way to hook something to the end of the generation process itself (see
> http://public.kitware.com/Bug/view.php?id=13020 ).
>
> BTW, it's generally a "Bad Idea (TM)" to move the generated tree around -
> it's full of absolute paths. Why do you need to move it in the first place?
>
> Petr
>
>
>
> On Wed, May 9, 2012 at 4:12 PM, Antje Kühn  wrote:
>> Hi,
>>
>>
>>
>> I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
>>
>>
>>
>> At my CMakeLists.txt files I defined the following:
>>
>>
>>
>> add_executable(VSData ${SRC} ${INC})
>>
>> Target_link_libraries(VSData ${SOME_LIBS})
>>
>>
>>
>> Now I start cmake from my build directory with:
>>
>>>cmake -G "Visual Studio 10" ..
>>
>>
>>
>> This works and  I get the *.vcxproj files in build/VSData.
>>
>> Now I want to copy the generated project files to another place at my
>> file system.
>>
>> For this I added the following command at the end to my CMakeLists.txt:
>>
>>
>>
>> add_custom_command(TARGET VSData
>>
>>  POST_BUILD
>>
>>  COMMAND ${CMAKE_COMMAND}
>>
>>  ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj ${destDir}
>> VERBATIM)
>>
>>
>>
>> I also tried this:
>>
>>
>>
>> add_custom_command(TARGET VSData.vcxproj
>>
>>    POST_BUILD
>>
>>    COMMAND ${CMAKE_COMMAND}
>>
>>    ARGS -E copy $ ${destDir}
>> VERBATIM)
>>
>>
>>
>> But nothing happens! No error message, no warnings and the file will
>> not be copied!
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> 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] C#/.NET

2012-05-09 Thread Mathieu Malaterre
Hi,

On Wed, May 9, 2012 at 11:19 AM, Pau Garcia i Quiles
 wrote:
> Is anyone using CMake for C#/.NET projects? We are looking to moving
> from Visual Studio solutions/projects to a proper build system and
> CMake would be my preferred choice.

Here is my two cents. Until CMake actually do support C#, I do not
believe this is worth the effort to use cmake. There are only two C#
implementations and both of them do support *.sln/csproj files.

You can have a look at two projects mummy [1] & gdcm [2] they both
uses C# and you will see the amount of detail needed to keep track of
dependencies and get things right. So if you project is only using C#,
I would suggest to go with the default VS tools. If your project is
using cmake anyway, be ready for some low level cmake programming [3].

2cts


[1] http://www.kitware.com/products/avdownload.php
[2] http://gdcm.sourceforge.net/
[3] http://public.kitware.com/Bug/view.php?id=7918

-- 
Mathieu
--

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] building and running tests with one command

2012-05-09 Thread Leif Walsh
Yeah, I tried it and I couldn't really figure out what it's doing. I could give 
it a binary name that it would build and I could give it a command to use to 
test, but the goal here is to only require the test name (since that may be 
different from the binary name) and to build all dependencies of the test. 

Sent from my iPhone

On May 9, 2012, at 10:45, Bill Hoffman  wrote:

> I assume you have looked at  ctest --build-and-test?
> 
> -Bill
> --
> 
> 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] building and running tests with one command

2012-05-09 Thread Bill Hoffman

I assume you have looked at  ctest --build-and-test?

-Bill
--

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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Petr Kmoch
Hi.

Custom commands are executed at build time (that is, when you do a
build in Visual Studio), not at generation time (when cmake is
running). There is no way to hook something to the end of the
generation process itself (see
http://public.kitware.com/Bug/view.php?id=13020 ).

BTW, it's generally a "Bad Idea (TM)" to move the generated tree
around - it's full of absolute paths. Why do you need to move it in
the first place?

Petr



On Wed, May 9, 2012 at 4:12 PM, Antje Kühn  wrote:
> Hi,
>
>
>
> I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
>
>
>
> At my CMakeLists.txt files I defined the following:
>
>
>
> add_executable(VSData ${SRC} ${INC})
>
> Target_link_libraries(VSData ${SOME_LIBS})
>
>
>
> Now I start cmake from my build directory with:
>
>>cmake -G "Visual Studio 10" ..
>
>
>
> This works and  I get the *.vcxproj files in build/VSData.
>
> Now I want to copy the generated project files to another place at my file
> system.
>
> For this I added the following command at the end to my CMakeLists.txt:
>
>
>
> add_custom_command(TARGET VSData
>
>  POST_BUILD
>
>  COMMAND ${CMAKE_COMMAND}
>
>  ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj ${destDir}
> VERBATIM)
>
>
>
> I also tried this:
>
>
>
> add_custom_command(TARGET VSData.vcxproj
>
>    POST_BUILD
>
>    COMMAND ${CMAKE_COMMAND}
>
>    ARGS -E copy $ ${destDir} VERBATIM)
>
>
>
> But nothing happens! No error message, no warnings and the file will not be
> copied!
>
>
>
>
>
>
>
>
>
>
>
>
> --
>
> 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] building and running tests with one command

2012-05-09 Thread Petr Kmoch
Actuall, I haven't tried this using ctest directly, just via make test
(or its Visual Studio equivalent). I believe that to make it work as
one test, you'd have to provide a trivial launcher which does the two
build - run steps in sequence.

Petr

On Wed, May 9, 2012 at 3:16 PM, Leif Walsh  wrote:
> So you run 'ctest -R testTarget' and it picks up the build test too?
> Hmm.  Thanks.
>
> On Wed, 9 May 2012, Petr Kmoch wrote:
>
>> The closest I've come to solving this problem is that for each test
>> ${testTarget}, I add two cmake tests:
>>
>> add_test(NAME build_${testTarget} COMMAND ${CMAKE_COMMAND} --build
>> "${CMAKE_BINARY_DIR}" --target ${testTarget} --config
>> $)
>>
>> add_test(NAME someName COMMAND ${testTarget} ...)
>>
>> It might even be possible to combine them into one command, perhaps
>> with a custom test driver.
>>
>> Petr
>>
>> On Tue, May 8, 2012 at 1:27 AM, Leif Walsh  wrote:
>> > Hi,
>> >
>> > Is there a make, cmake, or ctest way to rebuild the dependencies of a
>> > test if needed, and then run the test?
>> >
>> > Suppose I have a bulit directory and I'm developing.  I want to make
>> > edits, then run a command specifying one test to check, so that
>> > anything needed by that test gets rebuilt (if my changes require it),
>> > and then run.
>> >
>> > In make, I would do this by having one rule like
>> >
>> > run_%: %
>> >    ./$<
>> >
>> > so that if I want to edit some library's source file and then run
>> > test_foobar, I would just run `make run_test_foobar`, and the source I
>> > changed would get recompiled, the library would get relinked,
>> > test_foobar would get relinked if it's static, and then test_foobar
>> > would be run.
>> >
>> > I hoped ctest --bulid-and-test would help, but it seems it doesn't.  I
>> > tried --build-target test_foobar (I have add_test(test_foobar ...) in
>> > my configuration), and it only built test_foobar, it didn't seem to
>> > run it.
>> >
>> > --
>> > Cheers,
>> > Leif
>> > --
>> >
>> > 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
>>
>
> --
> Cheers,
> Leif
--

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] Copying a cmake generated VisualStudio project file to another directory

2012-05-09 Thread Antje Kühn
Hi,

 

I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.

 

At my CMakeLists.txt files I defined the following:

 

add_executable(VSData ${SRC} ${INC})

Target_link_libraries(VSData ${SOME_LIBS})

 

Now I start cmake from my build directory with: 

>cmake -G "Visual Studio 10" ..

 

This works and  I get the *.vcxproj files in build/VSData.

Now I want to copy the generated project files to another place at my file
system.

For this I added the following command at the end to my CMakeLists.txt:

 

add_custom_command(TARGET VSData 

 POST_BUILD 

 COMMAND ${CMAKE_COMMAND}

 ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj ${destDir}
VERBATIM)

 

I also tried this:

 

add_custom_command(TARGET VSData.vcxproj

   POST_BUILD 

   COMMAND ${CMAKE_COMMAND} 

   ARGS -E copy $ ${destDir} VERBATIM)

 

But nothing happens! No error message, no warnings and the file will not be
copied!

 

 

 

 

 

--

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] building and running tests with one command

2012-05-09 Thread Leif Walsh
So you run 'ctest -R testTarget' and it picks up the build test too?
Hmm.  Thanks.

On Wed, 9 May 2012, Petr Kmoch wrote:

> The closest I've come to solving this problem is that for each test
> ${testTarget}, I add two cmake tests:
> 
> add_test(NAME build_${testTarget} COMMAND ${CMAKE_COMMAND} --build
> "${CMAKE_BINARY_DIR}" --target ${testTarget} --config
> $)
> 
> add_test(NAME someName COMMAND ${testTarget} ...)
> 
> It might even be possible to combine them into one command, perhaps
> with a custom test driver.
> 
> Petr
> 
> On Tue, May 8, 2012 at 1:27 AM, Leif Walsh  wrote:
> > Hi,
> >
> > Is there a make, cmake, or ctest way to rebuild the dependencies of a
> > test if needed, and then run the test?
> >
> > Suppose I have a bulit directory and I'm developing.  I want to make
> > edits, then run a command specifying one test to check, so that
> > anything needed by that test gets rebuilt (if my changes require it),
> > and then run.
> >
> > In make, I would do this by having one rule like
> >
> > run_%: %
> >    ./$<
> >
> > so that if I want to edit some library's source file and then run
> > test_foobar, I would just run `make run_test_foobar`, and the source I
> > changed would get recompiled, the library would get relinked,
> > test_foobar would get relinked if it's static, and then test_foobar
> > would be run.
> >
> > I hoped ctest --bulid-and-test would help, but it seems it doesn't.  I
> > tried --build-target test_foobar (I have add_test(test_foobar ...) in
> > my configuration), and it only built test_foobar, it didn't seem to
> > run it.
> >
> > --
> > Cheers,
> > Leif
> > --
> >
> > 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
> 

-- 
Cheers,
Leif--

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] Checking if git submodules have been initialized

2012-05-09 Thread Arnaud Gelas

if( NOT EXISTS "${MY_SOURCE_DIR}/project/.git" )
message( SEND_ERROR "The git submodules are not available. Please run
git submodule update --init --recursive"
)
endif()


HTH

On 05/09/2012 02:52 PM, David Doria wrote:

I have recently started using git submodules in my projects. I have
had multiple complains from my users "It gives me a "missing xyz.h"
type of error when I try to compile." The reason is that they haven't
initialized the submodules (like it says to do in the readme :) ). Is
there a CMake way to check if a submodule is initialized so I can
throw a more appropriate error - "Please initialize the xyz submodule"
instead of letting the error get all the way to the compiler?

Thanks,

David
--

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] Checking if git submodules have been initialized

2012-05-09 Thread David Doria
I have recently started using git submodules in my projects. I have
had multiple complains from my users "It gives me a "missing xyz.h"
type of error when I try to compile." The reason is that they haven't
initialized the submodules (like it says to do in the readme :) ). Is
there a CMake way to check if a submodule is initialized so I can
throw a more appropriate error - "Please initialize the xyz submodule"
instead of letting the error get all the way to the compiler?

Thanks,

David
--

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] building and running tests with one command

2012-05-09 Thread Petr Kmoch
The closest I've come to solving this problem is that for each test
${testTarget}, I add two cmake tests:

add_test(NAME build_${testTarget} COMMAND ${CMAKE_COMMAND} --build
"${CMAKE_BINARY_DIR}" --target ${testTarget} --config
$)

add_test(NAME someName COMMAND ${testTarget} ...)

It might even be possible to combine them into one command, perhaps
with a custom test driver.

Petr

On Tue, May 8, 2012 at 1:27 AM, Leif Walsh  wrote:
> Hi,
>
> Is there a make, cmake, or ctest way to rebuild the dependencies of a
> test if needed, and then run the test?
>
> Suppose I have a bulit directory and I'm developing.  I want to make
> edits, then run a command specifying one test to check, so that
> anything needed by that test gets rebuilt (if my changes require it),
> and then run.
>
> In make, I would do this by having one rule like
>
> run_%: %
>    ./$<
>
> so that if I want to edit some library's source file and then run
> test_foobar, I would just run `make run_test_foobar`, and the source I
> changed would get recompiled, the library would get relinked,
> test_foobar would get relinked if it's static, and then test_foobar
> would be run.
>
> I hoped ctest --bulid-and-test would help, but it seems it doesn't.  I
> tried --build-target test_foobar (I have add_test(test_foobar ...) in
> my configuration), and it only built test_foobar, it didn't seem to
> run it.
>
> --
> Cheers,
> Leif
> --
>
> 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] C#/.NET

2012-05-09 Thread Pau Garcia i Quiles
Hi,

Is anyone using CMake for C#/.NET projects? We are looking to moving
from Visual Studio solutions/projects to a proper build system and
CMake would be my preferred choice.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
--

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] Volunteering to become maintainer of FindLibLZMA.cmake

2012-05-09 Thread Rolf Eike Beer
> Hi Eike,
>
> here a new version with the version support

Looks good. Just a small nitpicks:

-you should document also the LIBLZMA_VERSION_{MAJOR,MINOR,PATCH} variables

-I would move setting LIBLZMA_LIBRARIES and LIBLZMA_INCLUDE_DIRS below the
call to FPHSA and wrap it in an "if (LIBLZMA_FOUND)"

Eike
--

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] Volunteering to become maintainer of FindLibLZMA.cmake

2012-05-09 Thread Mario Bensi
Hi Eike,

here a new version with the version support

Mario

On Sunday, May 06, 2012 05:59:34 PM Rolf Eike Beer wrote:
> > Hi
> > 
> > In attachment a patch and the file FindLibLZMA.cmake
> > 
> > If you think this module can be integrate in cmake and if you can give me
> > the
> > write access in cmake, i can integrate and maintain this.
> > 
> > What do you think about this ?
> 
> What about version support, e.g. find_package(LibLZMA 2.0)?
> 
> Eike
> --
> 
> 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# - Find LibLZMA
# Find LibLZMA headers and library
#
#  LIBLZMA_FOUND - True if liblzma is found.
#  LIBLZMA_INCLUDE_DIRS  - Directory where liblzma headers are located.
#  LIBLZMA_LIBRARIES - Lzma libraries to link against.
#  LIBLZMA_HAS_AUTO_DECODER  - True if lzma_auto_decoder() is found (required).
#  LIBLZMA_HAS_EASY_ENCODER  - True if lzma_easy_encoder() is found (required).
#  LIBLZMA_HAS_LZMA_PRESET   - True if lzma_lzma_preset() is found (required).
#  LIBLZMA_VERSION_STRING- version number as a string (ex: "5.0.3")


# Copyright (c) 2008, Per Øyvind Karlsen, 
# Copyright (c) 2009, Alexander Neundorf, 
# Copyright (c) 2009, Helio Chissini de Castro, 
# Copyright (c) 2012, Mario Bensi, 
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h )
FIND_LIBRARY(LIBLZMA_LIBRARY lzma)

SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})

IF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
FILE(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS)

STRING(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
STRING(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
STRING(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")

SET(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
ENDIF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")

# We're using new code known now as XZ, even library still been called LZMA
# it can be found in http://tukaani.org/xz/
# Avoid using old codebase
IF (LIBLZMA_LIBRARIES)
   INCLUDE(CheckLibraryExists)
   CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
   CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
   CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
ENDIF (LIBLZMA_LIBRARIES)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA  REQUIRED_VARS  LIBLZMA_INCLUDE_DIR 
  LIBLZMA_LIBRARY
  LIBLZMA_HAS_AUTO_DECODER
  LIBLZMA_HAS_EASY_ENCODER
  LIBLZMA_HAS_LZMA_PRESET
   VERSION_VARLIBLZMA_VERSION_STRING
 )

MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )--

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