Re: [CMake] Transitive library dependencies with parallel builds

2012-03-03 Thread Michael Hertling
On 02/29/2012 05:35 PM, Number Cruncher wrote:
> Do transitive dependencies reduce number of jobs that can be compiled in 
> parallel?
> 
> If I have two libraries A and B, with an executable C, whose 
> dependencies are described by:
> 
>add_library(A ${A_SRC})
> 
>add_library(B ${B_SRC})
>target_link_libraries(B A)
> 
>add_executable(C ${C_SRC})
>target_link_libraries(C B)
> 
> I understand that when *linking* C, the transitive dependency A will be 
> added. However, if I build C in parallel "make -j N", will CMake build 
> libraries A and B simultaneously, or fully compile and link A before 
> starting compilation of B? I.e. just because the link steps are serial 
> dependencies, are the compilation steps? Would it be faster to do:
> 
>add_library(A ${A_SRC})
> 
>add_library(B ${B_SRC})
> 
>add_executable(C ${C_SRC})
>target_link_libraries(C B A)
> 
> Thanks.

Look at the following exemplary project:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(P C)
FILE(WRITE ${CMAKE_BINARY_DIR}/a.c "void a(void){}\n")
FILE(WRITE ${CMAKE_BINARY_DIR}/b.c "void b(void){a();}\n")
FILE(WRITE ${CMAKE_BINARY_DIR}/c.c "int main(void){b(); return 0;}\n")
ADD_LIBRARY(A SHARED a.c)
ADD_LIBRARY(B SHARED b.c)
ADD_EXECUTABLE(C c.c)
IF(TRANSITIVE)
TARGET_LINK_LIBRARIES(B A)
TARGET_LINK_LIBRARIES(C B)
ELSE()
TARGET_LINK_LIBRARIES(C B A)
ENDIF()

Configure with -DTRANSITIVE=ON and inspect CMakeFiles/Makefile2:

CMakeFiles/A.dir/all:
CMakeFiles/B.dir/all: CMakeFiles/A.dir/all
CMakeFiles/C.dir/all: CMakeFiles/B.dir/all

With -DTRANSITIVE=OFF, these lines read:

CMakeFiles/A.dir/all:
CMakeFiles/B.dir/all:
CMakeFiles/C.dir/all: CMakeFiles/A.dir/all
CMakeFiles/C.dir/all: CMakeFiles/B.dir/all

The CMakeFiles/.dir/all targets do:

$(MAKE) -f CMakeFiles/.dir/build.make CMakeFiles/.dir/build

Finally, CMakeFiles/.dir/build in CMakeFiles/.dir/build.make
does build target  completely, i.e. including the linking step.

Thus, the two-part transitive linking with -DTRANSITIVE=ON indeed
completes A before addressing B, so A and B can not be compiled in
parallel. In contrast, the one-part non-transitive linking with -D
TRANSITIVE=OFF allows for A and B to be compiled and even linked in
parallel since they haven't any interdependencies. So, with -j, the
latter is potentially faster than the former, but...

...reconsider what you're about to do: If B actually references A,
you might possibly not want to drop the TARGET_LINK_LIBRARIES(B A)
command. Run "readelf -d libB.so" on both results for -DTRANSITIVE
and you will see the difference. If A and B were static libraries,
CMake would lose the awareness that B must pull in A in the linker
command line.

In short, the answers to your questions are: N/Y, Y and Y.

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


Re: [CMake] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Ajay Panyala
Please provide a minimal but complete example for this issue.

Please find it in the following link
http://pastie.org/private/pd13u33s9xpfihf2dbzc1q

Thank You
Ajay

On Sat, Mar 3, 2012 at 3:54 PM, Michael Hertling wrote:

> On 03/04/2012 12:14 AM, Ajay Panyala wrote:
> > No, it wouldn't; check it out:
> >
> > % touch a
> > % rm -f b
> > % ls b
> > ls: cannot access b: No such file or directory
> > % cmake -E copy_if_different a b
> > % ls b
> > b
> > % cksum a b
> > 4294967295 0 a
> > 4294967295 0 b
> >
> > It works with one file, but I have 4 files that are generated.
> > I have 4 cmake -E copy_if_different commands, one for each file.
> > Only the last file is not copied (if similar). The others are copied
> > even if they are the same.
> >
> > I verfied that they are the same with a diff.
> >
> > Any idea what might be happening here ?
>
> Please provide a minimal but complete example for this issue.
>
> Regards,
>
> Michael
>
> > On Sat, Mar 3, 2012 at 2:47 PM, Michael Hertling  >wrote:
> >
> >> On 03/03/2012 10:36 PM, Ajay Panyala wrote:
> >>> Try "cmake -E copy_if_different ..."
> >>>
> >>> cmake -E copy_if_different build/test1.c build/tests/test1.c
> >>>
> >>> That would work when make is run atleast once.
> >>> When running make for the 1st time test1.c was never
> >>> copied to build/tests before. So I would be comparing a file with
> >>> another non-existant file and that would result in an error halting
> >>> the make process.
> >>
> >> No, it wouldn't; check it out:
> >>
> >> % touch a
> >> % rm -f b
> >> % ls b
> >> ls: cannot access b: No such file or directory
> >> % cmake -E copy_if_different a b
> >> % ls b
> >> b
> >> % cksum a b
> >> 4294967295 0 a
> >> 4294967295 0 b
> >>
> >> Regards,
> >>
> >> Michael
> >>
> >>> On Sat, Mar 3, 2012 at 1:20 PM, Hendrik Sattler <
> p...@hendrik-sattler.de
> >>> wrote:
> >>>
>  Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
> > I have a custom target which runs a command to generate
> > a C source file say test1.c
> >
> > ADD_CUSTOM_TARGET(TestGen ALL
> > COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
> > DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
> > )
> >
> > And I have a custom command that moves the generated *test1.c *
> > to a new directory inside the build directory.
> >
> > ADD_CUSTOM_COMMAND(
> > TARGET TestGen
> > POST_BUILD
> > COMMAND mv
> > ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
> > )
> >
> > Each time I run make, the custom target is run (since custom targets
> >> are
> > always
> > out-of-date). But I want to avoid moving the new test1.c generated
> each
> > time if build/test1.c is the same as build/tests/test1.c since there
> >> are
> > other targets
> > like add_executable and add_library later in the CMakelists file that
> >> are
> >  re-built
> > each time since they depend on test1.c
> 
>  Try "cmake -E copy_if_different ..."
> 
>  HS
> --
>
> 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
>



-- 
Ajay Panyala  | Email: a...@csc.lsu.edu
Department of Computer Science | Phone: +1 (225) 907 9501
Louisiana State University   |  www.csc.lsu.edu/~ajay
--

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] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Michael Hertling
On 03/04/2012 12:14 AM, Ajay Panyala wrote:
> No, it wouldn't; check it out:
> 
> % touch a
> % rm -f b
> % ls b
> ls: cannot access b: No such file or directory
> % cmake -E copy_if_different a b
> % ls b
> b
> % cksum a b
> 4294967295 0 a
> 4294967295 0 b
> 
> It works with one file, but I have 4 files that are generated.
> I have 4 cmake -E copy_if_different commands, one for each file.
> Only the last file is not copied (if similar). The others are copied
> even if they are the same.
> 
> I verfied that they are the same with a diff.
> 
> Any idea what might be happening here ?

Please provide a minimal but complete example for this issue.

Regards,

Michael

> On Sat, Mar 3, 2012 at 2:47 PM, Michael Hertling wrote:
> 
>> On 03/03/2012 10:36 PM, Ajay Panyala wrote:
>>> Try "cmake -E copy_if_different ..."
>>>
>>> cmake -E copy_if_different build/test1.c build/tests/test1.c
>>>
>>> That would work when make is run atleast once.
>>> When running make for the 1st time test1.c was never
>>> copied to build/tests before. So I would be comparing a file with
>>> another non-existant file and that would result in an error halting
>>> the make process.
>>
>> No, it wouldn't; check it out:
>>
>> % touch a
>> % rm -f b
>> % ls b
>> ls: cannot access b: No such file or directory
>> % cmake -E copy_if_different a b
>> % ls b
>> b
>> % cksum a b
>> 4294967295 0 a
>> 4294967295 0 b
>>
>> Regards,
>>
>> Michael
>>
>>> On Sat, Mar 3, 2012 at 1:20 PM, Hendrik Sattler >> wrote:
>>>
 Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
> I have a custom target which runs a command to generate
> a C source file say test1.c
>
> ADD_CUSTOM_TARGET(TestGen ALL
> COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
> DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
> )
>
> And I have a custom command that moves the generated *test1.c *
> to a new directory inside the build directory.
>
> ADD_CUSTOM_COMMAND(
> TARGET TestGen
> POST_BUILD
> COMMAND mv
> ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
> )
>
> Each time I run make, the custom target is run (since custom targets
>> are
> always
> out-of-date). But I want to avoid moving the new test1.c generated each
> time if build/test1.c is the same as build/tests/test1.c since there
>> are
> other targets
> like add_executable and add_library later in the CMakelists file that
>> are
>  re-built
> each time since they depend on test1.c

 Try "cmake -E copy_if_different ..."

 HS
--

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] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Ajay Panyala
No, it wouldn't; check it out:

% touch a
% rm -f b
% ls b
ls: cannot access b: No such file or directory
% cmake -E copy_if_different a b
% ls b
b
% cksum a b
4294967295 0 a
4294967295 0 b

It works with one file, but I have 4 files that are generated.
I have 4 cmake -E copy_if_different commands, one for each file.
Only the last file is not copied (if similar). The others are copied
even if they are the same.

I verfied that they are the same with a diff.

Any idea what might be happening here ?

Thank You
Ajay

On Sat, Mar 3, 2012 at 2:47 PM, Michael Hertling wrote:

> On 03/03/2012 10:36 PM, Ajay Panyala wrote:
> > Try "cmake -E copy_if_different ..."
> >
> > cmake -E copy_if_different build/test1.c build/tests/test1.c
> >
> > That would work when make is run atleast once.
> > When running make for the 1st time test1.c was never
> > copied to build/tests before. So I would be comparing a file with
> > another non-existant file and that would result in an error halting
> > the make process.
>
> No, it wouldn't; check it out:
>
> % touch a
> % rm -f b
> % ls b
> ls: cannot access b: No such file or directory
> % cmake -E copy_if_different a b
> % ls b
> b
> % cksum a b
> 4294967295 0 a
> 4294967295 0 b
>
> Regards,
>
> Michael
>
> > On Sat, Mar 3, 2012 at 1:20 PM, Hendrik Sattler  >wrote:
> >
> >> Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
> >>> I have a custom target which runs a command to generate
> >>> a C source file say test1.c
> >>>
> >>> ADD_CUSTOM_TARGET(TestGen ALL
> >>> COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
> >>> DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
> >>> )
> >>>
> >>> And I have a custom command that moves the generated *test1.c *
> >>> to a new directory inside the build directory.
> >>>
> >>> ADD_CUSTOM_COMMAND(
> >>> TARGET TestGen
> >>> POST_BUILD
> >>> COMMAND mv
> >>> ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
> >>> )
> >>>
> >>> Each time I run make, the custom target is run (since custom targets
> are
> >>> always
> >>> out-of-date). But I want to avoid moving the new test1.c generated each
> >>> time if build/test1.c is the same as build/tests/test1.c since there
> are
> >>> other targets
> >>> like add_executable and add_library later in the CMakelists file that
> are
> >>>  re-built
> >>> each time since they depend on test1.c
> >>
> >> Try "cmake -E copy_if_different ..."
> >>
> >> HS
> --
>
> 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] Problems with CMake and static Qt plugins

2012-03-03 Thread Michael Hertling
On 03/02/2012 02:48 PM, NoRulez wrote:
> Hello,
> 
> I use Qt 4.8.0 from the QtSDK and Iwant to generate a static qt plugin.
> In my main.cpp I have the following:
> 
> 
> #include
> #include
> 
> Q_IMPORT_PLUGIN(Local)
> 
> intmain(intargc,char*argv[]){
> QApplicationapp(argc,argv);
> 
>  .
>  .
>  .
> return  app.exec();
> 
> }
> 
> The corresponding CMakeLists.txt for the LocalPlugin looks like the following:
> 
> SET(LOCALPLUGIN_HEADERS
> 
>  LocalPlugin.h
> 
> )
> 
> SET(LOCALPLUGIN_SOURCES
> 
>  LocalPlugin.cpp
> 
> )
> 
> 
> SET(QT_USE_QTGUITRUE)
> SET(QT_USE_QTPLUGINTRUE)
> 
> QT4_AUTOMOC(${LOCALPLUGIN_SOURCES})
> QT4_WRAP_CPP(LOCALPLUGIN_MOC${LOCALPLUGIN_HEADERS})
> 
> ADD_LIBRARY(Local  STATIC  ${LOCALPLUGIN_HEADERS}  ${LOCALPLUGIN_SOURCES}  
> ${LOCALPLUGIN_MOC})
> 
> TARGET_LINK_LIBRARIES(Local  ${QT_LIBRARIES})
> 
> 
> The corresponding CMakeLists.txt for the main app looks like the following:
> 
> SET(QT_USE_QTMAINTRUE)
> 
> SET(QT_USE_QTGUI  TRUE)
> 
> ADD_EXECUTABLE(MyApp WIN32  ${APP_SOURCES}  ${APP_RCC}  MyApp.rc)
> TARGET_LINK_LIBRARIES(MyAppLocal  ${QT_LIBRARIES})
> 
> When I compile it I get the following error:
> In function `StaticLocalPluginInstance': undefined reference to 
> `qt_plugin_instance_Local()'
> 
> Please, could anybody help me to get it working?

Did you INCLUDE(${QT_USE_FILE}) in the correct place, i.e. after
setting the QT_USE_QT* variables? QT_LIBRARIES is populated in
that file.

Moreover, the lines

SET(QT_USE_QTGUITRUE)
SET(QT_USE_QTMAINTRUE)
SET(QT_USE_QTPLUGINTRUE)
QT4_WRAP_CPP(LOCALPLUGIN_MOC${LOCALPLUGIN_HEADERS})

are obviously missing blanks - just typos in your report?

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


Re: [CMake] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Ajay Panyala
No, it wouldn't;

Thanks. It works now. I might have done something wrong earlier.

- Ajay

On Sat, Mar 3, 2012 at 2:47 PM, Michael Hertling wrote:

> On 03/03/2012 10:36 PM, Ajay Panyala wrote:
> > Try "cmake -E copy_if_different ..."
> >
> > cmake -E copy_if_different build/test1.c build/tests/test1.c
> >
> > That would work when make is run atleast once.
> > When running make for the 1st time test1.c was never
> > copied to build/tests before. So I would be comparing a file with
> > another non-existant file and that would result in an error halting
> > the make process.
>
> No, it wouldn't; check it out:
>
> % touch a
> % rm -f b
> % ls b
> ls: cannot access b: No such file or directory
> % cmake -E copy_if_different a b
> % ls b
> b
> % cksum a b
> 4294967295 0 a
> 4294967295 0 b
>
> Regards,
>
> Michael
>
> > On Sat, Mar 3, 2012 at 1:20 PM, Hendrik Sattler  >wrote:
> >
> >> Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
> >>> I have a custom target which runs a command to generate
> >>> a C source file say test1.c
> >>>
> >>> ADD_CUSTOM_TARGET(TestGen ALL
> >>> COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
> >>> DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
> >>> )
> >>>
> >>> And I have a custom command that moves the generated *test1.c *
> >>> to a new directory inside the build directory.
> >>>
> >>> ADD_CUSTOM_COMMAND(
> >>> TARGET TestGen
> >>> POST_BUILD
> >>> COMMAND mv
> >>> ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
> >>> )
> >>>
> >>> Each time I run make, the custom target is run (since custom targets
> are
> >>> always
> >>> out-of-date). But I want to avoid moving the new test1.c generated each
> >>> time if build/test1.c is the same as build/tests/test1.c since there
> are
> >>> other targets
> >>> like add_executable and add_library later in the CMakelists file that
> are
> >>>  re-built
> >>> each time since they depend on test1.c
> >>
> >> Try "cmake -E copy_if_different ..."
> >>
> >> HS
> --
>
> 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] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Michael Hertling
On 03/03/2012 10:36 PM, Ajay Panyala wrote:
> Try "cmake -E copy_if_different ..."
> 
> cmake -E copy_if_different build/test1.c build/tests/test1.c
> 
> That would work when make is run atleast once.
> When running make for the 1st time test1.c was never
> copied to build/tests before. So I would be comparing a file with
> another non-existant file and that would result in an error halting
> the make process.

No, it wouldn't; check it out:

% touch a
% rm -f b
% ls b
ls: cannot access b: No such file or directory
% cmake -E copy_if_different a b
% ls b
b
% cksum a b
4294967295 0 a
4294967295 0 b

Regards,

Michael

> On Sat, Mar 3, 2012 at 1:20 PM, Hendrik Sattler 
> wrote:
> 
>> Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
>>> I have a custom target which runs a command to generate
>>> a C source file say test1.c
>>>
>>> ADD_CUSTOM_TARGET(TestGen ALL
>>> COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
>>> DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
>>> )
>>>
>>> And I have a custom command that moves the generated *test1.c *
>>> to a new directory inside the build directory.
>>>
>>> ADD_CUSTOM_COMMAND(
>>> TARGET TestGen
>>> POST_BUILD
>>> COMMAND mv
>>> ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
>>> )
>>>
>>> Each time I run make, the custom target is run (since custom targets are
>>> always
>>> out-of-date). But I want to avoid moving the new test1.c generated each
>>> time if build/test1.c is the same as build/tests/test1.c since there are
>>> other targets
>>> like add_executable and add_library later in the CMakelists file that are
>>>  re-built
>>> each time since they depend on test1.c
>>
>> Try "cmake -E copy_if_different ..."
>>
>> HS
--

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] Install commands/shortcuts for the windows explorer

2012-03-03 Thread norulez
Hi,

Is there an easy way to add/create a windows context menu entry with CMake/nsis?

If someone has this already done before, maybe this can be explained.

Thanks in advance

Best Regards
NoRulez
--

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] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Ajay Panyala
Try "cmake -E copy_if_different ..."

cmake -E copy_if_different build/test1.c build/tests/test1.c

That would work when make is run atleast once.
When running make for the 1st time test1.c was never
copied to build/tests before. So I would be comparing a file with
another non-existant file and that would result in an error halting
the make process.

Thanks
Ajay

On Sat, Mar 3, 2012 at 1:20 PM, Hendrik Sattler wrote:

> Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
> > I have a custom target which runs a command to generate
> > a C source file say test1.c
> >
> > ADD_CUSTOM_TARGET(TestGen ALL
> > COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
> > DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
> > )
> >
> > And I have a custom command that moves the generated *test1.c *
> > to a new directory inside the build directory.
> >
> > ADD_CUSTOM_COMMAND(
> > TARGET TestGen
> > POST_BUILD
> > COMMAND mv
> > ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
> > )
> >
> > Each time I run make, the custom target is run (since custom targets are
> > always
> > out-of-date). But I want to avoid moving the new test1.c generated each
> > time if build/test1.c is the same as build/tests/test1.c since there are
> > other targets
> > like add_executable and add_library later in the CMakelists file that are
> >  re-built
> > each time since they depend on test1.c
>
> Try "cmake -E copy_if_different ..."
>
> HS
> --
>
> 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] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Hendrik Sattler
Am Samstag, 3. März 2012, 21:41:49 schrieb Ajay Panyala:
> I have a custom target which runs a command to generate
> a C source file say test1.c
> 
> ADD_CUSTOM_TARGET(TestGen ALL
> COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
> DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
> )
> 
> And I have a custom command that moves the generated *test1.c *
> to a new directory inside the build directory.
> 
> ADD_CUSTOM_COMMAND(
> TARGET TestGen
> POST_BUILD
> COMMAND mv
> ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
> )
> 
> Each time I run make, the custom target is run (since custom targets are
> always
> out-of-date). But I want to avoid moving the new test1.c generated each
> time if build/test1.c is the same as build/tests/test1.c since there are
> other targets
> like add_executable and add_library later in the CMakelists file that are
>  re-built
> each time since they depend on test1.c

Try "cmake -E copy_if_different ..."

HS
--

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] avoid rebuilding targets depending on generated source files

2012-03-03 Thread Ajay Panyala
Hello,

I have a custom target which runs a command to generate
a C source file say test1.c

ADD_CUSTOM_TARGET(TestGen ALL
COMMAND genExec ${PROJECT_SOURCE_DIR}/Main.java
DEPENDS ${PROJECT_SOURCE_DIR}/Main.java
)

And I have a custom command that moves the generated *test1.c *
to a new directory inside the build directory.

ADD_CUSTOM_COMMAND(
TARGET TestGen
POST_BUILD
COMMAND mv
ARGS ${PROJECT_BINARY_DIR}/test1.c ${PROJECT_BINARY_DIR}/tests/
)

Each time I run make, the custom target is run (since custom targets are
always
out-of-date). But I want to avoid moving the new test1.c generated each time
if build/test1.c is the same as build/tests/test1.c since there are other
targets
like add_executable and add_library later in the CMakelists file that are
 re-built
each time since they depend on test1.c

I tried cmake -E compare_files inside execute_process, but it would not be
executed before the custom command.

I tried cmake -E compare_files inside a custom command as well, but that
would give an
error and halt the make process if the files differ.

I want to avoid re-building later targets that depend on test1.c.

Thanks
Ajay
--

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] Where can I download the cmake for win64?

2012-03-03 Thread David Cole
On Sat, Mar 3, 2012 at 10:04 AM, John Drescher  wrote:
>> I download the cmake-2.8.7-win32-x86.exe , but it failed when it works with
>> visual studio 2008 win64 and give the message below:
>>
>> Check for working C compiler using: Visual Studio 9 2008 Win64
>>
>> Check for working C compiler using: Visual Studio 9 2008 Win64 -- broken
>>
>> CMake Error at C:/Program Files (x86)/CMake
>> 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
>>
>> The C compiler "cl" is not able to compile a simple test program.
>>
>
> I have seen a few instances of this on the list. I think a good deal
> of them were either a botched compiler install or a permissions
> problem.
>

I think this is usually when you have Visual Studio installed, but
have not installed the Win64 parts of Visual Studio. Or it could also
be that you're using an Express Edition of Visual Studio, but have not
installed a 64-bit capable Platform SDK.

Verify that you can build a simple "hello world" Win64 executable with
Visual Studio alone (i.e., not using CMake) -- after you are
successful at that task, the 32-bit CMake will "just work" on the same
Visual Studio.


HTH,
David


>> It fails with the following output:
>>
>> Change Dir: I:/CMake2.8.7-x64/CMakeFiles/CMakeTmp
>>
>> Run Build Command:C:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com
>>
>> CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
>>
>> Microsoft (R) Visual Studio 9.0.21022.8
>>
>> 
>>
>> CMake will not be able to correctly generate this project.
>>
>> Call Stack (most recent call first):
>>
>> CMakeLists.txt:14 (PROJECT)
>>
>> Configuring incomplete, errors occurred!
>>
>>
>>
>> How could i fix the errors? And where can I download the cmake for win64?
>> I'm very appreciate if someone answer the question above.
>>
>
> The 32 bit version works fine for win64. You can get the source and
> build a 64 bit cmake however that does not really give you anything
> more than the 32 bit version does. Its not like you need 4GB of ram to
> create your projects.
>
> John
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

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


Re: [CMake] Where can I get the latest version of CMake for cygwin?

2012-03-03 Thread marco atzeri

On 3/2/2012 8:55 PM, Bill Hoffman wrote:

On 3/2/2012 1:57 PM, Robert Dailey wrote:

Latest version of CMake on the Cygwin installer is 2.8.4. I need 2.8.7.
Where can I get 2.8.7 for Cygwin?



We have them built, but I have been very bad at not getting them
uploaded to the server.

You can find them here:

http://www.cmake.org/files/v2.8/cmake-2.8.7-1.tar.bz2



Bill,
a simple RFU (request for upload) at cygwin-apps
mailing list, with the link at your files

http://www.cmake.org/files/v2.8/cmake-2.8.7-1.tar.bz2
http://www.cmake.org/files/v2.8/cmake-2.8.7-1-src.tar.bz2

will allow a larger audience and the correct deployment
of your package.

Thank in advance
Marco




--

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] Where can I download the cmake for win64?

2012-03-03 Thread John Drescher
> I download the cmake-2.8.7-win32-x86.exe , but it failed when it works with
> visual studio 2008 win64 and give the message below:
>
> Check for working C compiler using: Visual Studio 9 2008 Win64
>
> Check for working C compiler using: Visual Studio 9 2008 Win64 -- broken
>
> CMake Error at C:/Program Files (x86)/CMake
> 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
>
> The C compiler "cl" is not able to compile a simple test program.
>

I have seen a few instances of this on the list. I think a good deal
of them were either a botched compiler install or a permissions
problem.

> It fails with the following output:
>
> Change Dir: I:/CMake2.8.7-x64/CMakeFiles/CMakeTmp
>
> Run Build Command:C:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com
>
> CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
>
> Microsoft (R) Visual Studio 9.0.21022.8
>
> 
>
> CMake will not be able to correctly generate this project.
>
> Call Stack (most recent call first):
>
> CMakeLists.txt:14 (PROJECT)
>
> Configuring incomplete, errors occurred!
>
>
>
> How could i fix the errors? And where can I download the cmake for win64?
> I'm very appreciate if someone answer the question above.
>

The 32 bit version works fine for win64. You can get the source and
build a 64 bit cmake however that does not really give you anything
more than the 32 bit version does. Its not like you need 4GB of ram to
create your projects.

John
--

Powered by www.kitware.com

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

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

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


[CMake] Where can I download the cmake for win64?

2012-03-03 Thread 小马
Hello
 
I download the cmake-2.8.7-win32-x86.exe , but it failed when it works with 
visual studio 2008 win64 and give the message below:
 
Check for working C compiler using: Visual Studio 9 2008 Win64

Check for working C compiler using: Visual Studio 9 2008 Win64 -- broken

CMake Error at C:/Program Files (x86)/CMake 
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):

The C compiler "cl" is not able to compile a simple test program.

It fails with the following output:

Change Dir: I:/CMake2.8.7-x64/CMakeFiles/CMakeTmp

Run Build Command:C:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com

CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec

Microsoft (R) Visual Studio 9.0.21022.8



CMake will not be able to correctly generate this project.

Call Stack (most recent call first):

CMakeLists.txt:14 (PROJECT)

Configuring incomplete, errors occurred!

 

How could i fix the errors? And where can I download the cmake for win64? I'm 
very appreciate if someone answer the question above.

 

Best regards

 

Yulong--

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