Re: [CMake] Question about add_custom_command

2010-09-13 Thread David Aldrich
Hi Michael

 set(SRCS a.c b.c d.c e.c)
 
 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c
   COMMAND ...
   DEPENDS ${SRCS}
   COMMENT Generating f.c
   VERBATIM)
 list(APPEND SRCS ${CMAKE_BINARY_DIR}/f.c)
 
 add_executable(main ${SRCS})

Thanks - that worked nicely.

Now I have another problem. I need to link to the Python libraries. So I 
specify:

FIND_PACKAGE(PythonLibs REQUIRED)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

snip

message (${PYTHON_LIBRARY})
add_library( Kernel STATIC ${SRCS} )
TARGET_LINK_LIBRARIES(Kernel ${PYTHON_LIBRARY})

The message shows:

/usr/lib64/libpython2.4.so

but this path does not appear in the link command so the build fails.

I am trying to build a static library so am worried why ${PYTHON_LIBRARY} is a 
shared library.

By the way, is it normal CMake style to write CMAKE commands in upper or lower 
case?

Can you help with these questions please?

BR

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] Question about add_custom_command

2010-09-13 Thread Michael Wild

On 13. Sep, 2010, at 13:03 , David Aldrich wrote:

 Hi Michael
 
 set(SRCS a.c b.c d.c e.c)
 
 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c
  COMMAND ...
  DEPENDS ${SRCS}
  COMMENT Generating f.c
  VERBATIM)
 list(APPEND SRCS ${CMAKE_BINARY_DIR}/f.c)
 
 add_executable(main ${SRCS})
 
 Thanks - that worked nicely.
 
 Now I have another problem. I need to link to the Python libraries. So I 
 specify:
 
 FIND_PACKAGE(PythonLibs REQUIRED)
 INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
 
 snip
 
 message (${PYTHON_LIBRARY})
 add_library( Kernel STATIC ${SRCS} )
 TARGET_LINK_LIBRARIES(Kernel ${PYTHON_LIBRARY})
 
 The message shows:
 
 /usr/lib64/libpython2.4.so
 
 but this path does not appear in the link command so the build fails.
 
 I am trying to build a static library so am worried why ${PYTHON_LIBRARY} is 
 a shared library.
 
 By the way, is it normal CMake style to write CMAKE commands in upper or 
 lower case?
 
 Can you help with these questions please?
 
 BR
 
 David

You never link static libraries. They are more like zip files than actual 
libraries and just contain the compiled object files and for if you ran ranlib 
on it, also a table-of-contents to speed link up.

If you do target_link_libraries in CMake, where the target is a static 
library, CMake just creates the static library archive and remembers internally 
the transitive link dependency. If you linked that static archive into an 
executable, the python libraries would then show up on the command line.

HTH

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
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] CMake Problem with Visual Studio 2008 Express and Windows 7

2010-09-13 Thread Conor Downey
Hi,

I am using CMAKE for the first time and ive run into a problem. Basically i
have set where the source is and where to build the binaries. Then i add an
entry. But when i configure the program seems to have trouble finding my
compiler. I have Visual Studio 2008 Express Edition installed on a Windows 7
OS. The build log is as follows:
(one thing, in here it says the log is stored in the build directory at
...\build\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm, but
that doesnt get created. Was mentioned that this could be a permissions
problem ,but im the only user on this laptop and its just in a folder in My
Documents, so it shouldnt be an issue.)

Check for working CXX compiler using: Visual Studio 9 2008
CMake Error: Remove failed on file:
C:/Users/Downey/Documents/College/Masters/Gae/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.exe:
System Error: Permission denied
Check for working CXX compiler using: Visual Studio 9 2008 -- broken
CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:45 (MESSAGE):
The C++ compiler cl is not able to compile a simple test program.
It fails with the following output:
Change Dir:
C:/Users/Downey/Documents/College/Masters/Gae/build/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~2\MICROS~1.0\Common7\IDE\VCExpress.exe
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
Copyright (C) Microsoft Corp 2007. All rights reserved.
1-- Build started: Project: cmTryCompileExec, Configuration: Debug
Win32 --
1Compiling...
1Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for
80x86
1Copyright (C) Microsoft Corporation. All rights reserved.
1cl /Od /D WIN32 /D _WINDOWS /D _DEBUG /D CMAKE_INTDIR=\Debug\
/D _MBCS /FD /EHsc /RTCs /MDd /FocmTryCompileExec.dir\Debug\\
/FdC:\Users\Downey\Documents\College\Masters\Gae\build\CMakeFiles\CMakeTmp\Debug/cmTryCompileExec.pdb
/W3 /c /Zi /TP /Zm1000
1 .\testCXXCompiler.cxx
1testCXXCompiler.cxx
1Compiling manifest to resources...
1Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1Copyright (C) Microsoft Corporation. All rights reserved.
1Linking...
1LINK : fatal error LNK1104: cannot open file
'C:\Users\Downey\Documents\College\Masters\Gae\build\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.exe'
1Build log was saved at

file://c:\Users\Downey\Documents\College\Masters\Gae\build\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm

1cmTryCompileExec - 1 error(s), 0 warning(s)
== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:8 (project)
Configuring incomplete, errors occurred!

Does anyone have any ideas what might be going wrong. I have tried
reinstalling VC++ again but it makes no difference.

Cheers for any help,
Conor
___
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] Question about add_custom_command

2010-09-13 Thread David Aldrich
Hi Michael

 
 You never link static libraries. They are more like zip files than actual
 libraries and just contain the compiled object files and for if you ran
 ranlib on it, also a table-of-contents to speed link up.
 
 If you do target_link_libraries in CMake, where the target is a static
 library, CMake just creates the static library archive and remembers
 internally the transitive link dependency. If you linked that static
 archive into an executable, the python libraries would then show up on the
 command line.

Now I am confused (more than before!) because linking my Kernel library does 
give errors related to Python:

Linking CXX executable main
CMakeFiles/main.dir/Kernel.cpp.o: In function 
`__static_initialization_and_destruction_0(int, int)':
Kernel.cpp:(.text+0x101): undefined reference to `_Py_NoneStruct'
Kernel.cpp:(.text+0x10d): undefined reference to `_Py_NoneStruct'

The make file is evidently building an executable even though I have only 
specified:

add_library( Kernel STATIC ${SRCS} )

I can see from make VERBOSE=1, that it is trying to link main.exe instead of 
calling 'ar' to build libKernel.a.

Can you give me some more help on this please?

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] Question about add_custom_command

2010-09-13 Thread Michael Wild

On 13. Sep, 2010, at 14:57 , David Aldrich wrote:

 Hi Michael
 
 
 You never link static libraries. They are more like zip files than actual
 libraries and just contain the compiled object files and for if you ran
 ranlib on it, also a table-of-contents to speed link up.
 
 If you do target_link_libraries in CMake, where the target is a static
 library, CMake just creates the static library archive and remembers
 internally the transitive link dependency. If you linked that static
 archive into an executable, the python libraries would then show up on the
 command line.
 
 Now I am confused (more than before!) because linking my Kernel library does 
 give errors related to Python:
 
 Linking CXX executable main
 CMakeFiles/main.dir/Kernel.cpp.o: In function 
 `__static_initialization_and_destruction_0(int, int)':
 Kernel.cpp:(.text+0x101): undefined reference to `_Py_NoneStruct'
 Kernel.cpp:(.text+0x10d): undefined reference to `_Py_NoneStruct'
 
 The make file is evidently building an executable even though I have only 
 specified:
 
 add_library( Kernel STATIC ${SRCS} )
 
 I can see from make VERBOSE=1, that it is trying to link main.exe instead of 
 calling 'ar' to build libKernel.a.
 
 Can you give me some more help on this please?
 
 David

Can you show above link command with make VERBOSE=1? I assume you do 
something like this?

find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

add_library(Kernel STATIC a.c b.c d.c)
target_link_libraries(Kernel ${PYTHON_LIBRARIES})

add_executable(main main.c)
target_link_libraries(main Kernel)


Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
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] Question about add_custom_command

2010-09-13 Thread David Aldrich
Hi Michael

I have found that I had an 'add_executable' call left in accidentally. 

Sorry for wasting your time. It works well now. Thanks again for your help.

BR

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] FindBoost.cmake trouble with static libs (-gd vs -sgd issue)

2010-09-13 Thread Dixon, Shane
Philip,

 

You closed the bug already so I can't comment there, but I wanted to let you 
know that this latest version of FindBoost.cmake did work as expected for me.  
Thank you so much for your help.

 

--

Shane

 



From: philiplow...@gmail.com [mailto:philiplow...@gmail.com] On Behalf Of 
Philip Lowman
Sent: Tuesday, September 07, 2010 10:15 PM
To: Dixon, Shane
Cc: cmake@cmake.org
Subject: Re: [CMake] FindBoost.cmake trouble with static libs (-gd vs -sgd 
issue)

 

Shane,

Thanks for opening ticket 11204 for this issue.  My response is included there.

http://public.kitware.com/Bug/view.php?id=11204

 

On Thu, Sep 2, 2010 at 4:08 PM, Dixon, Shane shane.di...@atmel.com wrote:

I found that when using the FindBoost.cmake and using the Boost_USE_STATIC_LIBS 
option, it wouldn't find the static libs in my C:\Boost\libs folder.  It kept 
coming back with files ending in -gd libs instead of -sgd libs even though the 
option Boost_USE_STATIC_LIBS was set.  I found that it had to do with the order 
that the FIND_LIBRARY looks for the files.  I had BOTH the -gd and the -sgd 
libraries installed so it found the -gd ones first and then ignores the next 
option.  I fixed it by applying the following:

 

 

728,729c728,729

 NAMES  
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}


${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}

---

 NAMES  
 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}


 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}

 

I just switched the order to look for the more specific lib before the more 
general one.  If ${_boost_STATIC_TAG} is empty when Boost_USE_STATIC_LIBS is 
OFF, then maybe this could just be one line:

 

${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}

 

Which seems like it should find either -sgd or -gd files, but sould find -sgd 
files first if the option was provided.  Any thoughts?  I defer to anyone with 
more experience for the best way to do this.

 

--

Shane


___
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




-- 
Philip Lowman

___
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] custom target isn't rebuilt if depending on another custom target

2010-09-13 Thread Gerhard Stengel
Hi,

I have a strange problem with custom targets and their dependencies. I do as 
follows:

1) create a file 1 and add it to a custom target 1
2) create a file 2 and add it to a custom target 2
3) create a 3rd file by packing #1 and #2 together
4) the 3rd file is added to a custom target which depends on custom targets 1 
and 2

This is an example CMakeLists.txt:

snip ---

add_custom_command(OUTPUT Demo1.out   
COMMAND ${CMAKE_COMMAND} -E copy 
${CMAKE_CURRENT_SOURCE_DIR}/Demo1.in Demo1.out
DEPENDS Demo1.in)
add_custom_target(cust1 ALL DEPENDS Demo1.out)

add_custom_command(OUTPUT Demo2.out   
COMMAND ${CMAKE_COMMAND} -E copy 
${CMAKE_CURRENT_SOURCE_DIR}/Demo2.in Demo2.out
DEPENDS Demo2.in)
add_custom_target(cust2 ALL DEPENDS Demo2.out)

#this would work correctly in all cases
#add_custom_command(OUTPUT Demo.tar   
#COMMAND ${CMAKE_COMMAND} -E tar cvf Demo.tar Demo1.out 
Demo2.out
#DEPENDS Demo1.out Demo2.out)

#without file level dependencies it isn't correctly rebuilt
add_custom_command(OUTPUT Demo.tar   
COMMAND ${CMAKE_COMMAND} -E tar cvf Demo.tar Demo1.out 
Demo2.out)

add_custom_target(cust3 ALL DEPENDS Demo.tar)
add_dependencies(cust3 cust1 cust2)

snip ---

If I create Demo.tar from a clean project, everything's fine. However, the 
rebuilt isn't performed completely, that is 
if I touch Demo1.in, just Demo1.out is rebuilt, but not Demo.tar that depends 
on it! This seems wrong to me because I 
expect that if the target cust1 is rebuild, even the target cust3 has to be 
rebuilt due to the relation established by 
the add_dependencies() command!


The problem seems to be that add_dependencies() doesn't realize that if cust1 
or cust2 becomes out of date cust3 has to 
be rebuilt, too.

The solution using file level dependencies (see commented out command) would 
work, but in my project it's not really 
possible to do so because the source custom targets which the final custom 
target takes as input contain lots of 
files.

Is there an easy workaround or is this a cmake bug?

best regards

Gerhard

___
Powered by www.kitware.com

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

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

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


[CMake] add_test : expand environment variable at running time

2010-09-13 Thread Olivier Pierard
Dear all,

I re-submit a previous question with no answer in a simpler way.

A ctest_test() call on a cluster computation node executes a test
constructed with add_test(..) on the cluster master node.

add_test contains an evironment variable but is not expanded or expanded
at configuration time but not at test running time:

- add_test( mpirun -machinefile $TMPDIR myexec ) = will never expand
TMPDIR  - I don't understand why because in CTestTestfile.cmake, I have
add_test( test_name mpirun -machinefile $TMPDIR myexec); if I
submit this as a bash command, environment variable is well expanded; 
Does ctest prevent expanding variables at running time ?

- add_test( mpirun -machinefile ${TMPDIR} myexec ) = expands at
configuration time with cmake (empty because not defined in cmake - logical)

- add_test( mpirun -machinefile $ENV{TMPDIR} myexec ) = expands at
configuration time with cmake but TMPDIR is not yet defined on the
master node (logical)

I'm really stucked because one of our configurations really needs this
machinefile specification !

Did I missed something or do you see a way to circumvent this limitation ?

Thanks for your help

Olivier

___
Powered by www.kitware.com

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

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

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


Re: [CMake] add_test : expand environment variable at running time

2010-09-13 Thread Tyler Roscoe
On Mon, Sep 13, 2010 at 06:01:52PM +0200, Olivier Pierard wrote:
 - add_test( mpirun -machinefile $TMPDIR myexec ) = will never expand
 TMPDIR  - I don't understand why because in CTestTestfile.cmake, I have
 add_test( test_name mpirun -machinefile $TMPDIR myexec); if I
 submit this as a bash command, environment variable is well expanded; 
 Does ctest prevent expanding variables at running time ?
 
 - add_test( mpirun -machinefile ${TMPDIR} myexec ) = expands at
 configuration time with cmake (empty because not defined in cmake - logical)
 
 - add_test( mpirun -machinefile $ENV{TMPDIR} myexec ) = expands at
 configuration time with cmake but TMPDIR is not yet defined on the
 master node (logical)

How about add_test (... \$TMPDIR ... )
?

tyler
___
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] Undefined reference to __Unwind_Resume when building a universal binary with make on Mac OS X

2010-09-13 Thread Ryan Pavlik

 if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
endif()

Hope this helps!

Ryan

On 9/10/10 9:19 AM, Pedro d'Aquino wrote:
The problem wasn't related to the universal binaries, but to the SDK 
used (10.5). I need to add -mmacosx-version-min=10.5 to the compiler 
flags in order to make it work.


Shouldn't this be handled automatically by CMake?

On Fri, Sep 10, 2010 at 8:46 AM, Pedro d'Aquino bud...@gmail.com 
mailto:bud...@gmail.com wrote:


Hi everyone,

I'm currently modifying an existing CMake-based project to build
universal binaries on 10.6.4. Xcode 3.2.3 builds the new project
fine, but the make-based compilation fails because of an undefined
symbol, __Unwind_Resume.

The actual command used for compiling each C++ file is (from
VERBOSE=1):
/usr/bin/c++-Wall -Wno-multichar -O2 -g -Wall -Wno-multichar
-arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk 

After all files are compiled successfully, linking fails with the
following message:

Undefined symbols:
  __Unwind_Resume, referenced from:
  macosx::MacLibraryLoader::release(ILibraryInterface**)in
mac_library_loader.cpp.o
  macosx::MacLibraryLoader::getInterface()in
mac_library_loader.cpp.o

 macosx::MacLibraryLoader::MacLibraryLoader(std::basic_stringchar, std::char_traitschar,

std::allocatorchar  const)in mac_library_loader.cpp.o
  .

It seems __Unwind_Resume is referenced in just about every .cpp
file I compile.

The only change I've made from my original, i386-only project was add

if(APPLE)
SET(CMAKE_OSX_ARCHITECTURES i386;x86_64)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
endif()

Does anyone know what is going on?

Thanks a lot,

Pedro d'Aquino






___
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



--
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

http://academic.cleardefinition.com/

___
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] Use of CMAKE_LIBRARY_OUTPUT_DIRECTORY

2010-09-13 Thread Ryan Pavlik

 On 9/13/10 12:29 PM, David Aldrich wrote:

Hi

I have tried to set the output directory for my library as follows:

# set destination directory for LIBRARY target (i.e. libKernel.a)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ./_gnuRelease )

# build the Kernel static library
add_library(Kernel STATIC ${SRCS})

however, the library is being created in the source directory, not in the 
directory I have specified.

Why is this please?

Best regards

David

I believe for static libraries, the variable
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
is actually used.  In any case, you might rather consider using 
install(TARGETS instead of setting the output directories, and then 
just (on the user-side) setting the CMAKE_INSTALL_PREFIX and doing a 
make install.


Hope this helps!

Ryan

--
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

http://academic.cleardefinition.com/

___
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] custom target isn't rebuilt if depending on another custom target

2010-09-13 Thread Michael Hertling
On 09/13/2010 05:46 PM, Gerhard Stengel wrote:
 Hi,
 
 I have a strange problem with custom targets and their dependencies. I do as 
 follows:
 
 1) create a file 1 and add it to a custom target 1
 2) create a file 2 and add it to a custom target 2
 3) create a 3rd file by packing #1 and #2 together
 4) the 3rd file is added to a custom target which depends on custom targets 1 
 and 2
 
 This is an example CMakeLists.txt:
 
 snip ---
 
 add_custom_command(OUTPUT Demo1.out   
 COMMAND ${CMAKE_COMMAND} -E copy 
 ${CMAKE_CURRENT_SOURCE_DIR}/Demo1.in Demo1.out
 DEPENDS Demo1.in)
 add_custom_target(cust1 ALL DEPENDS Demo1.out)
 
 add_custom_command(OUTPUT Demo2.out   
 COMMAND ${CMAKE_COMMAND} -E copy 
 ${CMAKE_CURRENT_SOURCE_DIR}/Demo2.in Demo2.out
 DEPENDS Demo2.in)
 add_custom_target(cust2 ALL DEPENDS Demo2.out)
 
 #this would work correctly in all cases
 #add_custom_command(OUTPUT Demo.tar   
 #COMMAND ${CMAKE_COMMAND} -E tar cvf Demo.tar Demo1.out 
 Demo2.out
 #DEPENDS Demo1.out Demo2.out)
 
 #without file level dependencies it isn't correctly rebuilt
 add_custom_command(OUTPUT Demo.tar   
 COMMAND ${CMAKE_COMMAND} -E tar cvf Demo.tar Demo1.out 
 Demo2.out)
 
 add_custom_target(cust3 ALL DEPENDS Demo.tar)
 add_dependencies(cust3 cust1 cust2)
 
 snip ---
 
 If I create Demo.tar from a clean project, everything's fine. However, the 
 rebuilt isn't performed completely, that is 
 if I touch Demo1.in, just Demo1.out is rebuilt, but not Demo.tar that depends 
 on it! [...]

Demo.tar does *not* depend on Demo1.out; it has no dependencies at all.
As a proof - if on *nix - issue find . -exec grep Demo\.tar {} \;
in the build directory after cmaking, and you'll see that Demo.tar's
dependency line doesn't mention any prerequisites after the colon.

 [...] This seems wrong to me because I 
 expect that if the target cust1 is rebuild, even the target cust3 has to be 
 rebuilt due to the relation established by 
 the add_dependencies() command!

Rebuilding cust3 doesn't regenerate Demo.tar due to its lack of
dependencies if it already exists. So, Demo.tar is generated at
the first time and that's it, unless the file is removed later.

 The problem seems to be that add_dependencies() doesn't realize that if cust1 
 or cust2 becomes out of date cust3 has to 
 be rebuilt, too.

It does, but rebuilding cust3 doesn't do what you expect, see above.

 The solution using file level dependencies (see commented out command) would 
 work, [...]

...and is the correct one...

 [...] but in my project it's not really 
 possible to do so because the source custom targets which the final 
 custom target takes as input contain lots of 
 files.

First of all, is it possible to simplify your CMakeLists.txt? Unless
you really need cust{1,2} as top-level targets they aren't necessary
if Demo{1,2}.out are mentioned as dependencies in Demo.tar's custom
command and if these commands all reside in the same CMakeLists.txt.
Furthermore, you could even use

ADD_CUSTOM_TARGET(Demo.tar ALL
  COMMAND ${CMAKE_COMMAND} -E tar cvf Demo.tar Demo1.out Demo2.out
  DEPENDS Demo1.out Demo2.out)

instead of Demo.tar's custom command if you don't need Demo.tar as an
ingredient for another target and, again, if these commands/targets
are defined in the same CMakeLists.txt.

 Is there an easy workaround or is this a cmake bug?

No bug. ;) Without further knowledge of your project, the best advice
one can give is to use lists, loops, functions and properties to cope
with large numbers of files in the CMakeLists.txt.

'hope that helps.

Regards,

Michael
___
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, next, updated. v2.8.2-758-g24ecd4c

2010-09-13 Thread Marcel Loose
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, next has been updated
   via  24ecd4cfde77b2fa600022b3bdad0f41a1ba6bd5 (commit)
   via  80bad29af6dbff6ea284d7a56735f85fc7476e5a (commit)
   via  f3bc219adbbf10f3a75af1ac1db1f47b90102e19 (commit)
  from  c134483df8c0fecd91f63796eb8f7fd9ca8e62c9 (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=24ecd4cfde77b2fa600022b3bdad0f41a1ba6bd5
commit 24ecd4cfde77b2fa600022b3bdad0f41a1ba6bd5
Merge: c134483 80bad29
Author: Marcel Loose lo...@astron.nl
AuthorDate: Mon Sep 13 13:16:15 2010 +0200
Commit: Marcel Loose lo...@astron.nl
CommitDate: Mon Sep 13 13:16:15 2010 +0200

Merge branch 'issue_10199' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80bad29af6dbff6ea284d7a56735f85fc7476e5a
commit 80bad29af6dbff6ea284d7a56735f85fc7476e5a
Author: Marcel Loose lo...@astron.nl
AuthorDate: Mon Sep 13 13:13:12 2010 +0200
Commit: Marcel Loose lo...@astron.nl
CommitDate: Mon Sep 13 13:13:12 2010 +0200

Issue 10199: Fixed code documentation and now set prefix_WC_ROOT

diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 9bad3b1..daf3d87 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -8,18 +8,22 @@
 # The minimum required version of Subversion can be specified using the
 # standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
 #
-# If the command line client executable is found the macro
+# If the command line client executable is found two macros are defined:
 #  Subversion_WC_INFO(dir var-prefix)
-# is defined to extract information of a subversion working copy at
-# a given location. The macro defines the following variables:
+#  Subversion_WC_LOG(dir var-prefix)
+# Subversion_WC_INFO extracts information of a subversion working copy at
+# a given location. This macro defines the following variables:
 #  var-prefix_WC_URL - url of the repository (at dir)
 #  var-prefix_WC_ROOT - root url of the repository
 #  var-prefix_WC_REVISION - current revision
 #  var-prefix_WC_LAST_CHANGED_AUTHOR - author of last commit
 #  var-prefix_WC_LAST_CHANGED_DATE - date of last commit
 #  var-prefix_WC_LAST_CHANGED_REV - revision of last commit
-#  var-prefix_WC_LAST_CHANGED_LOG - last log of base revision
 #  var-prefix_WC_INFO - output of command `svn info dir'
+# Subversion_WC_LOG retrieves the log message of the base revision of a
+# subversion working copy at a given location. This macro defines the
+# variable:
+#  var-prefix_LAST_CHANGED_LOG - last log of base revision
 # Example usage:
 #  FIND_PACKAGE(Subversion)
 #  IF(SUBVERSION_FOUND)
@@ -74,6 +78,8 @@ IF(Subversion_SVN_EXECUTABLE)
 
   STRING(REGEX REPLACE ^(.*\n)?URL: ([^\n]+).*
 \\2 ${prefix}_WC_URL ${${prefix}_WC_INFO})
+  STRING(REGEX REPLACE ^(.*\n)?Repository Root: ([^\n]+).*
+\\2 ${prefix}_WC_ROOT ${${prefix}_WC_INFO})
   STRING(REGEX REPLACE ^(.*\n)?Revision: ([^\n]+).*
 \\2 ${prefix}_WC_REVISION ${${prefix}_WC_INFO})
   STRING(REGEX REPLACE ^(.*\n)?Last Changed Author: ([^\n]+).*

---

Summary of changes:
 Modules/FindSubversion.cmake  |   14 ++
 Source/kwsys/kwsysDateStamp.cmake |2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)


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


[Cmake-commits] CMake branch, next, updated. v2.8.2-767-g7ddcc30

2010-09-13 Thread David Cole
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, next has been updated
   via  7ddcc305907163545c72677b393fefb8f7a84a84 (commit)
   via  ed37fc3ea398b03bbba175ae337f14b6af58daee (commit)
  from  8edcf3432d55a9304534659f4a1d9b2eccbab96f (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=7ddcc305907163545c72677b393fefb8f7a84a84
commit 7ddcc305907163545c72677b393fefb8f7a84a84
Merge: 8edcf34 ed37fc3
Author: David Cole david.c...@kitware.com
AuthorDate: Mon Sep 13 16:33:58 2010 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Mon Sep 13 16:33:58 2010 -0400

Merge topic 'fix_target_name_with_dot_vs10' into next

ed37fc3 VS2010: Set IntDir for utility and global targets.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed37fc3ea398b03bbba175ae337f14b6af58daee
commit ed37fc3ea398b03bbba175ae337f14b6af58daee
Author: David Cole david.c...@kitware.com
AuthorDate: Mon Sep 13 13:29:10 2010 -0400
Commit: David Cole david.c...@kitware.com
CommitDate: Mon Sep 13 15:22:15 2010 -0400

VS2010: Set IntDir for utility and global targets.

VS2010 uses IntDir as the location for writing log files for
what happens during custom build steps. With no IntDir settings,
all ExternalProject usage within the same CMakeLists.txt file
would result in multiple utility targets all trying to use the
same custom build log files.

With parallel builds, they would try to use them simultaneously
and result in file access errors, preventing the builds from
completing successfully.

Now each utility target has its own IntDir setting, and so, its
own custom build rule log files.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index b374579..b290aed 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -814,10 +814,12 @@ bool 
cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
 
 void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
 {
-  if(this-Target-GetType()  cmTarget::MODULE_LIBRARY)
+  cmTarget::TargetType ttype = this-Target-GetType();
+  if(ttype  cmTarget::GLOBAL_TARGET)
 {
 return;
 }
+
   this-WriteString(PropertyGroup\n, 2);
   this-WriteString(_ProjectFileVersion10.0.20506.1
 /_ProjectFileVersion\n, 3);
@@ -827,33 +829,48 @@ void 
cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
   for(std::vectorstd::string::iterator config = configs-begin();
   config != configs-end(); ++config)
 {
-std::string targetNameFull = 
-  this-Target-GetFullName(config-c_str());
-std::string intermediateDir = this-LocalGenerator-
-  GetTargetDirectory(*this-Target);
-intermediateDir += /;
-intermediateDir += *config;
-intermediateDir += /;
-this-ConvertToWindowsSlash(intermediateDir);
-std::string outDir = this-Target-GetDirectory(config-c_str());
-this-ConvertToWindowsSlash(outDir);
-this-WritePlatformConfigTag(OutDir, config-c_str(), 3);
-*this-BuildFileStream  outDir
-\\
-/OutDir\n;
-this-WritePlatformConfigTag(IntDir, config-c_str(), 3); 
-*this-BuildFileStream  intermediateDir
-/IntDir\n;
-this-WritePlatformConfigTag(TargetName, config-c_str(), 3);
-*this-BuildFileStream
-   cmSystemTools::GetFilenameWithoutLastExtension(
-  targetNameFull.c_str())
-/TargetName\n;
-this-WritePlatformConfigTag(TargetExt, config-c_str(), 3);
-*this-BuildFileStream  cmSystemTools::GetFilenameLastExtension(
-  targetNameFull.c_str())
-/TargetExt\n;
-this-OutputLinkIncremental(*config);
+if(ttype = cmTarget::UTILITY)
+  {
+  this-WritePlatformConfigTag(IntDir, config-c_str(), 3);
+  *this-BuildFileStream
+ $(Platform)\\$(Configuration)\\$(ProjectName)\\
+ /IntDir\n;
+  }
+else
+  {
+  std::string targetNameFull =
+this-Target-GetFullName(config-c_str());
+  std::string intermediateDir = this-LocalGenerator-
+GetTargetDirectory(*this-Target);
+  intermediateDir += /;
+  intermediateDir += *config;
+  intermediateDir += /;
+  this-ConvertToWindowsSlash(intermediateDir);
+  std::string outDir = this-Target-GetDirectory(config-c_str());
+  this-ConvertToWindowsSlash(outDir);
+
+  this-WritePlatformConfigTag(OutDir, config-c_str(), 3);
+  *this-BuildFileStream  outDir
+