[CMake] Include raw text in generated makefiles

2006-07-25 Thread Antoine Tollenaere

Hi,

I'm currently trying to port a handwritten autotoolized+nmaked project
to cmake. My problem is that I was including a third party Makefile.vc
in one of my nmake files. This Makefile is provided by another company
and can change at any moment, so it would be better for me not to have
to port it to CMake, so that I don't have to work on it each time they
change something.

Is there a way to tell CMake to include a file in the generated Makefiles ?
Alternatively if I could just automatically add a line like !include
${PATH}\makefile.win it would be perfect. This part of the project
don't have to be ortable so it's not a problem if CMake does not
really handled what's outputted.

Please reply to my address as well, I'm not a ML subscriber.

Regards,
Antoine Tollenaere.

--
Jabber ID : [EMAIL PROTECTED]
tel : +33 6 86 75 99 35
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] (no subject)

2006-07-25 Thread Daniel Tihelka

Hallo everybody,

may I have two more simple questions about CMake and SWIG module?

The first is connected to the setting of SWIG parameters - when I create wrapper for Java, I need to set -package name to SWIG.

It is impossible to set is as:

	SET_SOURCE_FILES_PROPERTIES( ErisJava.i PROPERTIES SWIG_FLAGS -package my_package )

as it is replaced by -package\ my_package in the call of SWIG. Moreover, it overwrites all previous definitions of PROPERTIES SWIG_FLAGS. There is possibility of using:

	SET(CMAKE_SWIG_FLAGS -package my_package)

but if I understand it well, it swithes this parameter globally, for all swig calls (also when wrapping e.g. python). So, how to deal with this? Is there another way or is the second way correct?


==

The second question is about cmake -E copy command. I have notices that the use of wildcards is not possible in this command (event not documented?) - I need to copy all generated Java wrappign classes, but I cannot use the command cmake -E copy source_dir/*.java destin_dir. I have solved it by cmake -E chdir dir comand, but I have completely lost the platform independence.

I want kindly to ask you, if it would be possible to add support for wildcards in the cmake -E copy command (or mabye to the others as well?) - it will extend the abilities of the cmake while still be platform independent. Or can it be solved in another way?


I use CMake 2.2-1-beta (compiled by gentoo distro).

Thank you very much for your help.
Dan


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

[CMake] CMake + SWIG

2006-07-25 Thread Daniel Tihelka

Hallo everybody,

may I have two more simple questions about CMake and SWIG module?

The first is connected to the setting of SWIG parameters - when I create
 wrapper for Java, I need to set -package name to SWIG.

It is impossible to set is as:

SET_SOURCE_FILES_PROPERTIES( ErisJava.i PROPERTIES SWIG_FLAGS -package
 my_package )

as it is replaced by -package\ my_package in the call of SWIG. Moreover, it
 overwrites all previous definitions of PROPERTIES SWIG_FLAGS. There is
 possibility of using:

SET(CMAKE_SWIG_FLAGS -package my_package)

but if I understand it well, it swithes this parameter globally, for all swig
 calls (also when wrapping e.g. python). So, how to deal with this? Is there
 another way or is the second way correct?


==

The second question is about cmake -E copy command. I have notices that the
 use of wildcards is not possible in this command (event not documented?) - I
 need to copy all generated Java wrappign classes, but I cannot use the
 command cmake -E copy source_dir/*.java destin_dir. I have solved it by
 cmake -E chdir dir comand, but I have completely lost the platform
 independence.

I want kindly to ask you, if it would be possible to add support for
 wildcards in the cmake -E copy command (or mabye to the others as well?) -
 it will extend the abilities of the cmake while still be platform
 independent. Or can it be solved in another way?


I use CMake 2.2-1-beta (compiled by gentoo distro).

Thank you very much for your help.
Dan

---


P.S. I am really sorry for the previous post, I forget to fill the subject :-(
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Include raw text in generated makefiles

2006-07-25 Thread Brandon J. Van Every

Antoine Tollenaere wrote:


Is there a way to tell CMake to include a file in the generated 
Makefiles ? 


Well there's INCLUDE_EXTERNAL_MSPROJECT, but I don't know that it 
applies to the nmake generator.


You could ADD_CUSTOM_COMMAND or ADD_CUSTOM_TARGET to wrap up the 3rd 
party nmakefile.  This doesn't help you with communicating variables, 
but you could get things built the way the manufacturer intended.  For 
communication you'd probably have to delve into CMake scripting.



Cheers,
Brandon Van Every

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


[CMake] Cannot build CMake on MacOS 10.4.7 and XCode 2.3

2006-07-25 Thread Sylvain Benner



Hello,

I'm a newbie to MacOS and XCode. I managed to build 
the XCode project files for CMake with the 2.4.2 binaries for 
Tiger.
When I try to compile CMake project I've got an 
include error with this file "cmCPackCygwinBinaryGenerator.h" in 
"cmCPackGenerators.cxx".
It exists on WindowsXP but not on 
MacOS.
I don't understand the error, do you have some 
ideas?

Thank you

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

[CMake] Do anyone have a few examples of the Cmake which run on Linux to compiler the wxWidgets?

2006-07-25 Thread 高原


Do anyone have a few examples of the Cmake which run on Linux to compiler the wxWidgets? Please give me a copy that I can follow it to go on and on!Thanks a lot?通过 Windows Live Messenger 表达您自己! Windows Live Messenger!
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Cascading dependencies.

2006-07-25 Thread Brad King
Giulio Eulisse wrote:
 Ciao,
 I'm trying to use cmake to build a project with many libraries, with
 lots of dependencies. For this reason I would like to do something that
 allows the following.
 Given 3 libs A B C each one with its own dir and with
 
 A depends on B
 B depends on C
 
 I want to be able to discover that A depends on C too and put it in the
 list of libraries that should be linked with A. I was trying to do it
 with LISTs but they don't seem to be available across directories...Any
 idea?

Use these four CMakeLists.txt files:

# CMakeLists.txt
PROJECT(MYPROJ)
ADD_SUBDIRECTORY(C)
ADD_SUBDIRECTORY(B)
ADD_SUBDIRECTORY(A)

# C/CMakeLists.txt
ADD_LIBRARY(C ...)

# B/CMakeLists.txt
ADD_LIBRARY(B ...)
TARGET_LINK_LIBRARIES(B C)

# A/CMakeLists.txt
ADD_LIBRARY(A ...)
TARGET_LINK_LIBRARIES(A B)

CMake will automatically chain the dependency of A on C through B and
construct the proper link line.

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


Re: [CMake] Cannot build CMake on MacOS 10.4.7 and XCode 2.3

2006-07-25 Thread William A. Hoffman
I take it you are trying to build CVS CMake with CMake 2.4.2.  I have removed
the include for the cmCPackCygwinBinaryGenerator.h from CVS cmake.  If you CVS
update it should be OK now.

-Bill


At 06:10 AM 7/25/2006, Sylvain Benner wrote:
Hello,
 
I'm a newbie to MacOS and XCode. I managed to build the XCode project files 
for CMake with the 2.4.2 binaries for Tiger.
When I try to compile CMake project I've got an include error with this file 
cmCPackCygwinBinaryGenerator.h in cmCPackGenerators.cxx.
It exists on WindowsXP but not on MacOS.
I don't understand the error, do you have some ideas?
 
Thank you
 
Sylvain
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

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


[CMake] problem passing compiler flags to TRY_COMPILE

2006-07-25 Thread David Somers
I'm trying to write a test to check if a gcc compiler options is supported.

I can't quite work out how to get the test code to compile with the flag I 
need check. I've tried doing this:

TRY_COMPILE(CMAKE_GCC_VISIBILITY
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testGCCvisibility.c
CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING=-fvisibility=hidden
OUTPUT_VARIABLE OUTPUT
)

But when the test code is executed the flag I've specified 
(-fvisibility=hidden) isn't passed to the compiler. I suspect that I'm doing 
something wrong, but I can't see it myself :-(

Any help/ideas appreciated.

-- 
David Somers
typographer/programmer/whatever
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] problem passing compiler flags to TRY_COMPILE

2006-07-25 Thread David Somers
On Tuesday 25 July 2006 17:06, David Somers wrote:
 I'm trying to write a test to check if a gcc compiler options is supported.

 I can't quite work out how to get the test code to compile with the flag I
 need check. I've tried doing this:

 TRY_COMPILE(CMAKE_GCC_VISIBILITY
   ${CMAKE_BINARY_DIR}
   ${CMAKE_BINARY_DIR}/CMakeTmp/testGCCvisibility.c
   CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING=-fvisibility=hidden
   OUTPUT_VARIABLE OUTPUT
   )

Dammit... just realized I need to do it like:

TRY_COMPILE(CMAKE_GCC_VISIBILITY
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testGCCvisibility.c
COMPILE_DEFINITIONS -visibility=hidden
OUTPUT_VARIABLE OUTPUT
)

COMPILE_DEFINITIONS really should be called COMPILE_FLAGS, imho.

-- 
David Somers
typographer/programmer/whatever
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CTest and devenv command line issues

2006-07-25 Thread Anton Deguet
Hello,

I am trying to setup a couple of nightly builds on a single Windows box.
Since the build requires DLLs (to test our __declspec and Python
wrappers), I have been trying to use the MSVC devenv command line
with /useenv to set the DLL and Python search paths per build.  I have
something almost working but I am stuck whenever I try to submit to
Dart.  Here is what works (in a small batch script):

@rem Go to the build directory
c:
cd C:\users\anton\dart-build\msvc7.1-dynamic-IDE\build

@rem Set the env. variables.
call cisstvsvars.bat
call cisstvars.bat Release

@rem Clean and build
devenv /useenv /clean Release /project ALL_BUILD
devenv /useenv /build Release /project ALL_BUILD
devenv /useenv /build Release /project RUN_TESTS

At that point, my test programs can find the DLLs and run successfully
but, as expected, nothing gets submitted to my Dart2 dashboard. 

The following two won't work:
devenv /useenv /build Release /project Nightly
C:\Program Files\CMake 2.4\bin\ctest.exe -C Release -D Nightly

The error message is that the DLLs are not found.  I looks like at one
point my environment variables have been dropped.

Any clue?  I am using CMake 2.4.2.


Anton


-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] EXECUTE_PROCESS or ADD_CUSTOM_COMMAND?

2006-07-25 Thread fuchsrich
I need to compile a code generator, run the code generator, then compile the
code that the code generator produces.  Do I need to complie the generator,
then use the EXECUTE_PROCESS command to run it, then have the generated code
compiled, or should I use the ADD_CUSTOM_COMMAND somehow?

The code generator is in a dir like such:
common/code_generator/*.java
and the output is put here:
common/code_generator_output/*.cpp

The code that is generated is based on an .xsd file, so I don't know what the
file names will be of the generated code until it is created.

Thanks
Richard


This message was sent using IMP, the Internet Messaging Program.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Testing shared library

2006-07-25 Thread William A. Hoffman
At 02:19 PM 7/25/2006, Flávio P. Duarte wrote:
It looks like CMake is prependind LD_LIBRARY_PATH before ../src and in
LD_LIBRARY_PATH there is an older version of mylib.
The CMake command line looks like:
/usr/bin/c++   -g -Wall   -fPIC -L/home/user/lib/
CMakeFiles/test1.dir/obj1.o CMakeFiles/test1.dir/obj2.o   -o test1
-rdynamic -L/home/user/test/src
 I think the first -L is being added to CMake to correspond to
LD_LIBRARY_PATH environment variable. The easiest solution would be get
rid of LD_LIBRARY_PATH, but I consider it as a last option. And if the
first -L corresponds to LD_LIBRARY_PATH, it might be a bug. People will
not be able to test their libraries without changing this variable first.
As an alternative, I thought change the command line, but I open to
suggestions.

Flavio

CMake is not looking at LD_LIBRARY_PATH.  You must be doing an in-source
build and creating a library that is being put in /home/user/test/src which
is why cmake is adding the -L.

-Bill

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


Re: [CMake] Testing shared library

2006-07-25 Thread Flávio P. Duarte
William A. Hoffman wrote:
 At 02:19 PM 7/25/2006, Flávio P. Duarte wrote:
 It looks like CMake is prependind LD_LIBRARY_PATH before ../src and in
 LD_LIBRARY_PATH there is an older version of mylib.
 The CMake command line looks like:
 /usr/bin/c++   -g -Wall   -fPIC -L/home/user/lib/
 CMakeFiles/test1.dir/obj1.o CMakeFiles/test1.dir/obj2.o   -o test1
 -rdynamic -L/home/user/test/src
 I think the first -L is being added to CMake to correspond to
 LD_LIBRARY_PATH environment variable. The easiest solution would be get
 rid of LD_LIBRARY_PATH, but I consider it as a last option. And if the
 first -L corresponds to LD_LIBRARY_PATH, it might be a bug. People will
 not be able to test their libraries without changing this variable first.
As an alternative, I thought change the command line, but I open to
 suggestions.

 Flavio
 
 CMake is not looking at LD_LIBRARY_PATH.  You must be doing an in-source
 build and creating a library that is being put in /home/user/test/src which
 is why cmake is adding the -L.
The /home/user/test/src directory is ok. You are right about your
statement: It is where the new mylib is located. The problem is
/home/user/lib. This directory should not be there. CMake should place
the project paths before LDFLAGS.

  Apparently I forgot to paste the end of the compiler line, so I am
repeating it:
/usr/bin/c++   -g -Wall   -fPIC -L/home/user/lib/
CMakeFiles/test1.dir/obj1.o CMakeFiles/test1.dir/obj2.o   -o test1
-rdynamic -L/home/user/test/src -lmylib

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


Re: [CMake] CTest and devenv command line issues

2006-07-25 Thread Brad King
Anton Deguet wrote:
 Hello,
 
 I am trying to setup a couple of nightly builds on a single Windows box.
 Since the build requires DLLs (to test our __declspec and Python
 wrappers), I have been trying to use the MSVC devenv command line
 with /useenv to set the DLL and Python search paths per build.  I have
 something almost working but I am stuck whenever I try to submit to
 Dart.  Here is what works (in a small batch script):
 
 @rem Go to the build directory
 c:
 cd C:\users\anton\dart-build\msvc7.1-dynamic-IDE\build
 
 @rem Set the env. variables.
 call cisstvsvars.bat
 call cisstvars.bat Release
 
 @rem Clean and build
 devenv /useenv /clean Release /project ALL_BUILD
 devenv /useenv /build Release /project ALL_BUILD
 devenv /useenv /build Release /project RUN_TESTS
 
 At that point, my test programs can find the DLLs and run successfully
 but, as expected, nothing gets submitted to my Dart2 dashboard. 
 
 The following two won't work:
 devenv /useenv /build Release /project Nightly
 C:\Program Files\CMake 2.4\bin\ctest.exe -C Release -D Nightly
 
 The error message is that the DLLs are not found.  I looks like at one
 point my environment variables have been dropped.
 
 Any clue?  I am using CMake 2.4.2.

This doesn't work because building the Nightly target just runs another
ctest that constructs its own devenv command line to drive the build and
doesn't add the /useenv option.

CTest is designed to drive dashboard submissions using ctest -S
scripts.  See here for an example:

http://www.cmake.org/Testing/Sites/dash4.kitware/Win32-bcc5.8/20060725-1514-Experimental/Notes.html

You can set environment variables in the script:

SET(ENV{VAR1} value1)
SET(ENV{VAR2} value2)

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


Re: [CMake] EXECUTE_PROCESS or ADD_CUSTOM_COMMAND?

2006-07-25 Thread Brad King
[EMAIL PROTECTED] wrote:
 I need to compile a code generator, run the code generator, then compile the
 code that the code generator produces.  Do I need to complie the generator,
 then use the EXECUTE_PROCESS command to run it, then have the generated code
 compiled, or should I use the ADD_CUSTOM_COMMAND somehow?
 
 The code generator is in a dir like such:
 common/code_generator/*.java
 and the output is put here:
 common/code_generator_output/*.cpp
 
 The code that is generated is based on an .xsd file, so I don't know what the
 file names will be of the generated code until it is created.

Use ADD_EXECUTABLE to create the generator and then use
ADD_CUSTOM_COMMAND to drive its use.  See here for basic file generation:

http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_the_build.3F

You could use FILE(GLOB) to get the list of input java files ahead of
time or better yet just list them manually so that when one is added
CMake will know to re-run and include it.  This list should be used as
the DEPENDS option of the ADD_CUSTOM_COMMAND call.  The OUTPUT option
should have one file that you know to be generated.  This output should
then be listed as a source file in some other target added with
ADD_LIBRARY, ADD_EXECUTABLE, or ADD_CUSTOM_TARGET.

To be fully safe you really need to know the set of output files
produced by a custom command and list them on the OUTPUT option and as
source files in the final target using the outputs.  Listing one will
work if no one deletes the other outputs by hand and then expects the
build to work.

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