[CMake] CMAKE install command post process the file

2011-12-28 Thread vivek goel
I am installing static file using cmake INSTALL command

I want to post process the output file using cmake

example

Static files are having string like v={{VERSION}}

I want to replace {{VERSION}} in the output files.

Is it possible with cmake ? using utility like sed.
-- 
regards
Vivek Goel
--

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] include directories

2011-12-28 Thread Tom Deblauwe

Hello,

I have the following project structure:

framework1/inc/lib1 - public headers
framework1/inc/lib2 - public headers
framework1/libs/lib1/ - CMakeLists.txt
framework1/libs/lib1/src - implementation source+headers
framework1/libs/lib2/ - CMakeLists.txt
framework1/libs/lib2/src - implementation source+headers
framework1/tests/lib1/ - CMakeLists.txt
framework1/tests/lib1/src - unittest for lib1
framework1/tests/lib2/ - CMakeLists.txt
framework1/tests/lib2/src - unittest for lib2

In the cmakelists.txt in framework1/libs/lib1 I do an 
add_subdirectory(../../tests/lib1) and also the add_test(). This works 
great. But the unittest has to do an 
include_directory(../../tests/lib1/src) so that the unittest can use 
the private implementation headers. This also works great.


But the problem comes when someone want to use the lib1: it 
automatically adds the unittest, which adds the include of the private 
implementation src and this is not good because when someone wants to 
use the lib1 he should only have the public include dir 
framework1/inc/lib1 and have the extra framework1/tests/lib1/src as 
include directory. How can I solve this?


Best regards,
Tom,
--

Powered by www.kitware.com

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

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

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


Re: [CMake] CMAKE install command post process the file

2011-12-28 Thread Eric Noulard
2011/12/28 vivek goel goelvivek2...@gmail.com:
 I am installing static file using cmake INSTALL command

 I want to post process the output file using cmake

 example

 Static files are having string like v={{VERSION}}

 I want to replace {{VERSION}} in the output files.

 Is it possible with cmake ? using utility like sed.

You should try to use
configure_file
cmake command.

You'll need to replace {{VERSION}} in your static files with @VERSION@.
You may then

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/static_file.in
${CMAKE_CURRENT_BINARY_DIR}/static_file @ONLY)
install(${CMAKE_CURRENT_BINARY_DIR}/static_file DESTINATION ...)


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.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] __FILE__ relative path

2011-12-28 Thread Michael Wild
set(SRCS a/a.cpp b/b.cpp c/c.cpp d/d.cpp)

foreach(f IN LISTS SRCS)
  get_filename_component(b ${f} NAME)
  set_source_files_properties(${f} PROPERTIES
COMPILE_DEFINITIONS MYSRCNAME=${b})
endforeach()

add_executable(foo ${SRCS})


HTH

Michael

On 12/28/2011 08:17 AM, vivek goel wrote:
 Is there any way to define custom
 macro as given in following answer
 http://stackoverflow.com/questions/237542/learning-the-source-codes-filename-at-compile-time
 with cmake
 
 
 regards
 Vivek Goel
 
 
 
 On Tue, Dec 27, 2011 at 11:02 PM, Rolf Eike Beer e...@sf-mail.de
 mailto:e...@sf-mail.de wrote:
 
 Am Dienstag, 27. Dezember 2011, 09:18:15 schrieb J Decker:
  On Tue, Dec 27, 2011 at 1:42 AM, Rolf Eike Beer e...@sf-mail.de
 mailto:e...@sf-mail.de wrote:
   Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
   How can I make cmake to compile source with relative path ?
  
   So that __FILE__ belongs to relative path of the file
  
   or there is another way I can replace __FILE__ with some other
 variable ?
 
  relative path to what?  What is it you need the path to be?
 
   __FILE__ is implemented by the compiler, it has nothing to do
 with CMake.
   What
  Well, it does have a little to do with CMake; the variable is the
  filename passed to the compiler, which comes from cmake.
 
 Yes, but the compiler is free to convert it to an absolute path or
 do whatever
 it wants with it.
 
 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] link_directories, MSVC and $(Configuration)

2011-12-28 Thread Hauke Heibel
On Tue, Dec 27, 2011 at 4:55 PM, Rolf Eike Beer e...@sf-mail.de wrote:
 Don't use link_directories. Ever. You don't want to use it. Surely. It does
 not what you think it does. It only exists to create trouble, unexpected
 behaviour and questions to this list ;)

If that were possible it would be great. Consider e.g. boost; they
link automatically on windows machines and they don't export their
build targets. Typically I expect a library Foo which depends on boost
to provide all required information to build after calling
find_package(Foo) which in this case requires the definition of
FOO_LIBRARY_DIRS containing the path to the boost libraries.

But I see your point since I should enforce what you wrote for my
personal libraries...

Thank you for the tip!

Regards,
Hauke
--

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] [EXTERNAL] Re: execute_process appending redirected output

2011-12-28 Thread Belcourt, K. Noel

Hi Aaron,

On Dec 27, 2011, at 11:04 PM, Aaron Ten Clay wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/27/11 16:16, Belcourt, Kenneth wrote:

I'm trying to get CMake to execute this command

INSTALL(CODE
EXECUTE_PROCESS (COMMAND cat

\${CMAKE_CURRENT_SOURCE_DIR}/onejar_classpath.txt 
${CMAKE_INSTALL_PREFIX}/onejar/boot-manifest.mf\)

)

but this doesn't work, here's the error I get when I run the install.

I've checked that both the source and target files exist and are

writable. Any ideas on how to get this to work?



It looks as thought you might be missing some escaped double-quotes.


I've tried quite a few quoting permutations, none work.


INSTALL(CODE
EXECUTE_PROCESS (COMMAND cat
\${CMAKE_CURRENT_SOURCE_DIR}/onejar_classpath.txt\ 
\${CMAKE_INSTALL_PREFIX}/onejar/boot-manifest.mf\)
)


Unfortunately this doesn't work.


It's also worth noting that this is not a cross-platform command.


Yup, we're a unix only shop.


Maybe
look at file(READ ...) followed by file(APPEND ...)?


Looks promising, I'll check this out.

Thanks for the help Aaron.

-- Noel


--

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] __FILE__ relative path

2011-12-28 Thread J Decker
ya - before using the file parameter, find the last / or '\' and print
from there forward... you dono't need an absolute or relative path for
that

On Tue, Dec 27, 2011 at 11:17 PM, vivek goel goelvivek2...@gmail.com wrote:
 Is there any way to define custom
 macro as given in following answer
 http://stackoverflow.com/questions/237542/learning-the-source-codes-filename-at-compile-time
 with cmake


 regards
 Vivek Goel



 On Tue, Dec 27, 2011 at 11:02 PM, Rolf Eike Beer e...@sf-mail.de wrote:

 Am Dienstag, 27. Dezember 2011, 09:18:15 schrieb J Decker:
  On Tue, Dec 27, 2011 at 1:42 AM, Rolf Eike Beer e...@sf-mail.de wrote:
   Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
   How can I make cmake to compile source with relative path ?
  
   So that __FILE__ belongs to relative path of the file
  
   or there is another way I can replace __FILE__ with some other
   variable ?
 
  relative path to what?  What is it you need the path to be?
 
   __FILE__ is implemented by the compiler, it has nothing to do with
   CMake.
   What
  Well, it does have a little to do with CMake; the variable is the
  filename passed to the compiler, which comes from cmake.

 Yes, but the compiler is free to convert it to an absolute path or do
 whatever
 it wants with it.

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

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] __FILE__ relative path

2011-12-28 Thread Michael Wild
If you don't want to have the full path embedded in the binary, you do.

As an addendum to my previous answer, the string after the equal sign might 
need escaped quoting.

Michael.



On 28.12.2011, at 18:41, J Decker d3c...@gmail.com wrote:

 ya - before using the file parameter, find the last / or '\' and print
 from there forward... you dono't need an absolute or relative path for
 that
 
 On Tue, Dec 27, 2011 at 11:17 PM, vivek goel goelvivek2...@gmail.com wrote:
 Is there any way to define custom
 macro as given in following answer
 http://stackoverflow.com/questions/237542/learning-the-source-codes-filename-at-compile-time
 with cmake
 
 
 regards
 Vivek Goel
 
 
 
 On Tue, Dec 27, 2011 at 11:02 PM, Rolf Eike Beer e...@sf-mail.de wrote:
 
 Am Dienstag, 27. Dezember 2011, 09:18:15 schrieb J Decker:
 On Tue, Dec 27, 2011 at 1:42 AM, Rolf Eike Beer e...@sf-mail.de wrote:
 Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
 How can I make cmake to compile source with relative path ?
 
 So that __FILE__ belongs to relative path of the file
 
 or there is another way I can replace __FILE__ with some other
 variable ?
 
 relative path to what?  What is it you need the path to be?
 
 __FILE__ is implemented by the compiler, it has nothing to do with
 CMake.
 What
 Well, it does have a little to do with CMake; the variable is the
 filename passed to the compiler, which comes from cmake.
 
 Yes, but the compiler is free to convert it to an absolute path or do
 whatever
 it wants with it.
 
 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
 --
 
 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] $ENV{env_var} is not picking up user defined environment variables

2011-12-28 Thread Avanindra Singh
Hi,

I am trying to access environment variables in CMakeLists.txt in UNIX
environment. Here is example code

message(STATUS cuda path $ENV{CUDA_PATHS} )

and it is not printing anything for the variable. While when i try to echo
it on terminal , i get proper value.


avanindra@avanindra-Triayaam:~/projects/ros_3d/build$ echo ${CUDA_PATH}
/usr/local/cuda


Can some one please help me fix this.

Thanks
Avanindra Singh
--

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] _USRDLL issue with Extension DLLs in MSVC6.0

2011-12-28 Thread shabelnikov

Hello All,

I faced issue with Visual Studio 6.0 project (.dsp) produced by CMake.
CMake version: 2.8.6
Project type: Extension DLL
Issue: CMake adds _USRDLL define for Extension DLLs (_AFXDLL and 
_AFXEXT are defined). According to documentation 
(http://msdn.microsoft.com/en-us/library/aa235516%28v=vs.60%29.aspx) 
_USRDLL must not be defined for Extension DLLs (when _AFXDLL is 
defined). This behavior leads to linker errors.
Solution that I see: exclude _USRDLL symbol when _AFXDLL  _AFXEXT 
symbols are defined.


Additionally:
I've also tested my project with Visual Studio 9 and it works OK;
I've tried several ways to make CMake do not add mentioned symbol to 
produced project but without success;
I've checked CMake 2.8.6 source code and found that _USRDLL symbol 
persists in DLLHeader.dsptemplate project template.


p.s. I've searched documentation, FAQ, ChangeLog.txt and web for this 
issue and haven't found answer.


Best Regards,
Alexey Shabelnikov
--

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 : OS X package installation directory

2011-12-28 Thread Yngve Inntjore Levinsen
Hi,

Søndag 25. desember 2011 20.32.41 skrev Nicholas Yue:
 Hi,
 
  I would like to package up my software to install (via DMG and PKG)
 to the /Applications/my-software directory
 
Is the variable CMAKE_INSTALL_PREFIX what you are looking for? Have a look at:
cmake --help-variable CMAKE_INSTALL_PREFIX

  How should one configure CMakeLists.txt INSTALL and CPack variable
 to install software in the above location i.e. /Applications/my-software
 
  Also, is there a way to check the installation without actually
 doing the full installation steps e.g. is there some flags/files to
 check the installation directory after the DMG/PKG is created ?

make -n works at least, and likewise e.g. ctest -N (n/N means dry-run I 
believe).  You could try make install -n at least to see where make is 
moving stuff. Unsure if cpack has something similar.
 Regards

Cheers,
Yngve
--

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] $ENV{env_var} is not picking up user defined environment variables

2011-12-28 Thread Rolf Eike Beer
Avanindra Singh wrote:
 Hi,
 
 I am trying to access environment variables in CMakeLists.txt in UNIX
 environment. Here is example code
 
 message(STATUS cuda path $ENV{CUDA_PATHS} )
 
 and it is not printing anything for the variable. While when i try to echo
 it on terminal , i get proper value.
 
 
 avanindra@avanindra-Triayaam:~/projects/ros_3d/build$ echo ${CUDA_PATH}
 /usr/local/cuda

export CUDA_PATH ?

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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

Re: [CMake] $ENV{env_var} is not picking up user defined environment variables

2011-12-28 Thread Rolf Eike Beer
Am Donnerstag 29 Dezember 2011, 06:23:25 schrieben Sie:
 Hi Elike,
 
 Thanks for the reply.
 
 I think cuda path is already exported. I have entry for export in ~/.bashrc
 file. Below are the few lines from bashrc file.
 
 #CUDA CUSTOM PATH DEFINITION
 
  export AV_PROJECT_PATH=/home/avanindra/projects
  export CUDA_PATH=/usr/local/cuda
  export CUDA_BIN_PATH=/usr/local/cuda/bin
  export CUDA_LIB_PATH=/usr/local/cuda/lib
  export CUDA_INC_PATH=/usr/local/cuda/include
  export NVSDKCOMPUTE_ROOT=/home/avanindra/NVIDIA_GPU_Computing_SDK
  export
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_LIB_PATH:$NVSDKCOMPUTE_ROOT/lib
  export ROS_MASTER_URI=http://localhost:11311
  source /opt/ros/electric/setup.bash
 
 Also command line echo ${CUDA_PATH} gives the correct path , this means
 CUDA_PATH already exist as environment variable.

Then don't write MESSAGE(STATUS $ENV{CUDA_PATHS}), but $ENV{CUDA_PATH} ;)

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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

[CMake] on find_package and building dependencies

2011-12-28 Thread Ryan Lewis
Hi,

I really like CMake's find_package() utility for finding dependencies,
but for some projects I have a
separate local copy of the installed libraries, and I want to point
find_package at a particular directory to find the installed
libraries.
How can I do this?

On that note, I also have some dependencies which themselves are build
using CMake, it is possible to tell my CMake Project to
build another CMake project?

Thanks,
-rhl
--

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-commits] CMake branch, master, updated. v2.8.6-444-g15cebeb

2011-12-28 Thread KWSys Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, master has been updated
   via  15cebeb047d2a8be09a556898f70ed6be2d5fa16 (commit)
  from  38bc4b5d9e4682bfd98dffa10e374c0d6d72e801 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15cebeb047d2a8be09a556898f70ed6be2d5fa16
commit 15cebeb047d2a8be09a556898f70ed6be2d5fa16
Author: KWSys Robot kwro...@kitware.com
AuthorDate: Thu Dec 29 00:05:05 2011 -0500
Commit: KWSys Robot kwro...@kitware.com
CommitDate: Thu Dec 29 00:05:05 2011 -0500

KWSys Nightly Date Stamp

diff --git a/Source/kwsys/kwsysDateStamp.cmake 
b/Source/kwsys/kwsysDateStamp.cmake
index 087d226..9ee30df 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2011)
 SET(KWSYS_DATE_STAMP_MONTH 12)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   28)
+SET(KWSYS_DATE_STAMP_DAY   29)

---

Summary of changes:
 Source/kwsys/kwsysDateStamp.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits