Re: [CMake] custom build

2016-07-29 Thread Chuck Atkins
Hi Lev,

However, the target builds only if I explicitly say 'make foo_sqlite'. So
> far
> so good. Is there any way I can make it build if I just say 'make'?
>

See the add_custom_target documentation for the ALL option,
https://cmake.org/cmake/help/v3.6/command/add_custom_target.html


And, there are more then one sqlite database to build, how can I make the
> rule to be generic? Can I say *.sql, *.sqlite?
>

The problem with using wild cards is that they won't be sensitive to make
detecting file changes.  For example, if you add a new file then CMake
won't automatically re-run because the *.sql statement hasn't changed.  You
should also be able to replace the separate custom_target and
custom_command with a single custom_target:

add_custom_target(foo ALL sqlite3 -init foo.sql foo.sqlite)

You could also wrap the call in a macro for convience:

macro(add_sqlite_target name)
  add_custom_target(${name} ALL sqlite3 -init
${CMAKE_CURRENT_SOURCE_DIR}/${name}.sql
${CMAKE_CURRENT_BINARY_DIR}/${name}.sqlite BYPRODUCTS
${CMAKE_CURRENT_BINARY_DIR}/${name}.sqlite SOURCES ${name}.sql)
endmacro()

add_sqlite_target(fooA)
add_sqlite_target(fooB)
add_sqlite_target(fooC)
add_sqlite_target(fooD)

Note the addition of BYPRODUCTS and SOURCES.  This adds additional
dependency information if you decided to either a) make other targets that
consume the database or b) have other targets that produce the source code.

- Chuck
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] custom build

2016-07-29 Thread Lev
On Fri, 29 Jul 2016 08:50:13 -0400
Guillaume Dumont  wrote:

> add_custom_command(OUTPUT foo.sqlite
> MAIN_DEPENDENCY
> foo.sql COMMAND "cat foo.sql |
> sqlite3 -batch foo.sqlite")
> 
> add_custom_target(foo_sqlite
> DEPENDS foo.sqlite)

Thanks, that helps.

It works somehow. Minor issue, that the double quotes is not necessary.

However, the target builds only if I explicitly say 'make foo_sqlite'. So far
so good. Is there any way I can make it build if I just say 'make'?

And, there are more then one sqlite database to build, how can I make the
rule to be generic? Can I say *.sql, *.sqlite?

Thanks,
Levente

-- 
73 de HA5OGL
Op.: Levente
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] custom build

2016-07-29 Thread Lev
On Fri, 29 Jul 2016 08:13:08 -0400
"Elizabeth A. Fischer"  wrote:

> Did you run "cmake" first before "make"?

Yes... thanks.

> Have you considered just using "make" instead?  The big benefits of
> CMake are:
>  1. Can find link dependencies, which might be in different places on
> different systems.
>  2. Adjust for the different command line options required by
> different compilers.
> 
> So far, I don't see either of those issues in your problem.  I would
> consider just using plain "make" here.

Yes, I considered that solution. Then I have to make the upper level
CMakeLists.txt/build system to run "make" in that directory, and
somehow make my global variables visible in that Makefile. Seems to be
harder than hacking the CMakeLists.txt.

And, I want to have a consistent build system.

Lev

-- 
73 de HA5OGL
Op.: Levente
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] custom build

2016-07-29 Thread Guillaume Dumont
As per CMake documentation your custom target should depend on the output
of the custom command. So it should look more like this:

add_custom_command(OUTPUT foo.sqlite
MAIN_DEPENDENCY foo.sql
COMMAND "cat foo.sql |
sqlite3 -batch foo.sqlite")

add_custom_target(foo_sqlite
DEPENDS foo.sqlite)

HTH

Guillaume

On Fri, Jul 29, 2016 at 6:45 AM, Lev  wrote:

> Dear cmake users,
>
>
> Could you please help me how to make cmake to produce a generic build
> system?
>
> What I want to do is running simple shell command on files. Namely, I want
> to
> generate sqlite database from a sql file. It all works from the command
> line,
> I just can't figure out how to make cmake to do the right thing.
>
> I started to do something like this:
>
> add_custom_target(foo.sqlite foo.sql)
>
> add_custom_command(OUTPUT foo.sqlite
> MAIN_DEPENDENCY foo.sql
> COMMAND "cat foo.sql |
> sqlite3 -batch foo.sqlite")
>
> but it doesn't do anything when I issue "make".
>
> Any help appreciated.
>
> Levente
>
> --
> 73 de HA5OGL
> Op.: Levente
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Guillaume Dumont
=
dumont.guilla...@gmail.com
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] custom build

2016-07-29 Thread Lev
Dear cmake users,


Could you please help me how to make cmake to produce a generic build system?

What I want to do is running simple shell command on files. Namely, I want to
generate sqlite database from a sql file. It all works from the command line,
I just can't figure out how to make cmake to do the right thing.

I started to do something like this:

add_custom_target(foo.sqlite foo.sql)

add_custom_command(OUTPUT foo.sqlite
MAIN_DEPENDENCY foo.sql
COMMAND "cat foo.sql | sqlite3 
-batch foo.sqlite")

but it doesn't do anything when I issue "make".

Any help appreciated. 

Levente

-- 
73 de HA5OGL
Op.: Levente
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[cmake-developers] [CMake 0015059]: CMake custom build step PRE_LINK/PRE_BUILD do not work

2014-08-05 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://www.cmake.org/Bug/view.php?id=15059 
== 
Reported By:k0n3ru
Assigned To:
== 
Project:CMake
Issue ID:   15059
Category:   CMake
Reproducibility:always
Severity:   feature
Priority:   normal
Status: new
== 
Date Submitted: 2014-08-05 04:24 EDT
Last Modified:  2014-08-05 04:24 EDT
== 
Summary:CMake custom build step PRE_LINK/PRE_BUILD do not
work
Description: 
PRE_LINK and PRE_BUILD do not seem to work in CMake on linux ( generating
MakeFiles ). 

The documentation says that only PRE_BUILD is not supported. But , PRE_LINK does
not work at all.And PRE_BUILD is built *after* the actual target.

From the documentation :

Note that the PRE_BUILD option is only supported on Visual Studio 7 or later.
For all other generators PRE_BUILD will be treated as PRE_LINK. 






Steps to Reproduce: 
cmake_minimum_required(VERSION 2.8.5)
project(custom_command_test)

add_custom_target(my_actual_target
COMMAND echo  I am the actual taget 
COMMENT Running actual target
)
add_custom_command(
TARGET my_actual_target
PRE_LINK
COMMAND echo I am prelinked to actual target
COMMENT  Running PRELINK action 
)
add_custom_command(
TARGET my_actual_target
PRE_BUILD
COMMAND echo  I am prebuilt to actual target
COMMENT  Running PRE_BUILD action
)
add_custom_command(
TARGET my_actual_target
POST_BUILD
COMMAND echo  I postbuild to actual target
COMMENT  Running POST BUILD action 
)


=
On running the above :

 cmake .
-- The C compiler identification is GNU 4.4.2
-- The CXX compiler identification is GNU 4.4.2
-- Check for working C compiler: /gcc/4.4.2/bin/gcc
-- Check for working C compiler: /gcc/4.4.2/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /gcc/4.4.2/bin/g++
-- Check for working CXX compiler: /gcc/4.4.2/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: 

  make my_actual_target
Scanning dependencies of target my_actual_target
[100%] Running actual target
 I am the actual taget 
 Running PRE_BUILD action
 I am prebuilt to actual target
 Running POST BUILD action 
 I postbuild to actual target
[100%] Built target my_actual_target

 cmake --version
cmake version 2.8.10.2

Additional Information: 
Workaround is to add a fake target and POST_BUILD step on it. Then creating
dependency seems to work. But, it has its own issues.For my setup , it creates
problems when parallel make ( -j ) is done.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2014-08-05 04:24 k0n3ru New Issue
==

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[CMake] Custom build type.

2010-01-20 Thread Surya Kiran Gullapalli
Hello all,
I'm using cmake 2.8 to generage VS2005 project files. By default, we've 4
build configurations Debug, Release, MinSizeRel, RelWithDebInfo.

I want to have a different Build configuration, The cxxflags, definitions
(which we add with Add_Definitions) are different from what I've with the
other 4 configurations. How can I create custom build configuration for
VS2005 generator.

Thanks in advance,
Surya
___
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 build type.

2010-01-20 Thread Ryan Pavlik
Look at the CMake FAQ: there's an example that adds a mode called 
Maintainer:

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

Ryan

On 1/20/10 5:52 AM, Surya Kiran Gullapalli wrote:

Hello all,
I'm using cmake 2.8 to generage VS2005 project files. By default, 
we've 4 build configurations Debug, Release, MinSizeRel, RelWithDebInfo.


I want to have a different Build configuration, The cxxflags, 
definitions (which we add with Add_Definitions) are different from 
what I've with the other 4 configurations. How can I create custom 
build configuration for VS2005 generator.


Thanks in advance,
Surya


___
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

rpav...@iastate.edu
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 Build Type GCC on Linux

2009-03-24 Thread Nadir SOUALEM

Clemens Arth wrote:

Hi,

I got a rather simple question. To add some special optimization flags 
to a custom build for one of our projects, I followed the guide to add 
a custom build type to my project using the example found here:


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



I simply copy-pasted the code found there into a separate file and did 
the following:


project(Dummy)
include(maintainermode.cmake)
add_library(dummylib dummy.cpp)

To build it I run:
cmake -DCMAKE_BUILD_TYPE=Maintainer ..
and
make

Although everything seems to be correct, I can't get the stuff 
compiled with the new mode - it definitely adds the configuration, but 
I simply cannot build it like Release or Debug. It always sticks back 
to Debug.


Did I miss something here?
Regards
Clemens
___
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


try to delete your CMakeCache.txt
$rm CMakeCache.txt

and reload cmake:
cmake -DCMAKE_BUILD_TYPE=Debug

To avoid these manipulations, try to do an Out Source build


--
Nadir SOUALEM
Ingénieur INRIA - Équipe SAGE


___
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 Build Type GCC on Linux

2009-03-23 Thread Clemens Arth

Hi,

I got a rather simple question. To add some special optimization flags 
to a custom build for one of our projects, I followed the guide to add a 
custom build type to my project using the example found here:


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

I simply copy-pasted the code found there into a separate file and did 
the following:


project(Dummy)
include(maintainermode.cmake)
add_library(dummylib dummy.cpp)

To build it I run:
cmake -DCMAKE_BUILD_TYPE=Maintainer ..
and
make

Although everything seems to be correct, I can't get the stuff compiled 
with the new mode - it definitely adds the configuration, but I simply 
cannot build it like Release or Debug. It always sticks back to Debug.


Did I miss something here?
Regards
Clemens
___
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 build step

2008-01-19 Thread pepone . onrez
Hello i creating a CMake macro for compile same IDL files.

Here is steps i trying to do

1) find all files in  ./slice directory that's end with .ice

for each .ice files

1.1) run slice2cpp compiler that's generate a .h and .cpp file white the
same name as the .ice
1.2) move the .h file to the include directory
1.3) move the .cpp file to the source directory

2) Compile the generated files in a shared library

Here is the macro i use for steps (1.1 1.2 1.3) - the problem is that the
second CUSTOM_COMMAND that's move generated files
to is final destination is not called. Any help is appreciated , thanks in
advance


SET ( SLICE2CPP_COMMAND ${ICE_HOME}/bin/slice2cpp${EXE_EXTENSION} )
SET ( SLICE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/slice )
SET ( SLICE2CPP_GENERATED_SOURCES ${PROJECT_SOURCE_DIR}/src )
SET ( SLICE2CPP_GENERATED_HEADERS ${PROJECT_SOURCE_DIR}/include )
SET ( MOVE_FILE_COMMAND mv )

SET ( SLICE_ARGS -I${SLICE_SOURCE_DIR} -I${ICE_SLICE_HOME}/slice)

#
# Appends the new_bit to the original.
# If the original is not set, it will be set to the new_bit.
#
MACRO( APPEND ORIGINAL NEW_BIT )

  IF( NOT ${ORIGINAL} )
SET( ${ORIGINAL} ${NEW_BIT} )
  ELSE  ( NOT ${ORIGINAL} )
SET( ${ORIGINAL} ${${ORIGINAL}} ${NEW_BIT} )
  ENDIF ( NOT ${ORIGINAL} )

ENDMACRO( APPEND ORIGINAL NEW_BIT )

#
# Generate rules for buil slice files.
#
MACRO ( GENERATE_SLICE2CPP_RULES GENERATED_CPP_LIST GENERATED_HEADER_LIST )

FOREACH( SLICE_SOURCE_BASENAME ${ARGN} )
APPEND( GEN_SLICE_RULES_SLICE_DEPENDS
${SLICE_SOURCE_DIR}/${PROJECT_NAMESPACE}/${SLICE_SOURCE_BASENAME} )
ENDFOREACH( SLICE_SOURCE_BASENAME ${ARGN} )


FOREACH( SLICE_SOURCE_BASENAME ${ARGN} )
SET( SLICE_SOURCE
${SLICE_SOURCE_DIR}/${PROJECT_NAMESPACE}/${SLICE_SOURCE_BASENAME} )

STRING( REGEX REPLACE \\.ice .cpp SOURCE_OUTPUT_BASENAME
${SLICE_SOURCE_BASENAME} )
STRING( REGEX REPLACE \\.ice .h HEADER_OUTPUT_BASENAME
${SLICE_SOURCE_BASENAME} )

ADD_CUSTOM_COMMAND(
OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_OUTPUT_BASENAME}
${CMAKE_CURRENT_BINARY_DIR}/${HEADER_OUTPUT_BASENAME}
COMMAND ${SLICE2CPP_COMMAND}
ARGS${SLICE_SOURCE} ${SLICE_ARGS}
COMMENT -- Generating ${SOURCE_OUTPUT_BASENAME}
${HEADER_OUTPUT_BASENAME} file from ${SLICE_SOURCE})

ADD_CUSTOM_COMMAND(
OUTPUT  ${PROJECT_SOURCE_DIR}/src/${SOURCE_OUTPUT_BASENAME}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_OUTPUT_BASENAME}
COMMAND ${MOVE_FILE_COMMAND}
ARGS${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_OUTPUT_BASENAME}
${PROJECT_SOURCE_DIR}/src
COMMENT -- Moving ${SOURCE_OUTPUT_BASENAME} to sources dir
${PROJECT_SOURCE_DIR}/src)

APPEND ( ${GENERATED_CPP_LIST}
${PROJECT_SOURCE_DIR}/src/${SOURCE_OUTPUT_BASENAME} )
APPEND ( ${GENERATED_HEADER_LIST} include/${PROJECT_NAMESPACE} )

ENDFOREACH( SLICE_SOURCE_BASENAME ${ARGN} )

ENDMACRO ( GENERATE_SLICE2CPP_RULES GENERATED_CPP_LIST GENERATED_HEADER_LIST
)
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Custom build command for documentation

2008-01-08 Thread Alexander.Camek
Hi all,

currently I can generate for some subdirectories my Latex and Doxygen 
documentation. This is done like it is described in the cmake FAQ.
What I now want to do is to collect all this commands of the subdirectory and 
put it in an unique common build command, e.g. make doc.
The idea is that the user can generate all documents with one common command, 
like cmake currently does during source build when a user types make all.

The problem is that when I add a custom target it doesn't know about targets 
given by a ADD_SUBDIRECTORY command.

Consider following structure:

\src
 \modules
  \module1 - some docu
  \module2 - some docu
  \module3 - some docu
 \tools
  \tool1 - some docu
  \tool2 - some docu

Then think about the user who types in make doc and all documents of the 
whole build is generated.

Is it with current release (cmake 2.4.7) possible to generate such a command 
for generating documentation?

If not so. Does the next big step of cmake (cmake 2.5 or 2.6 ???) consider 
something like a doc command in it? Similar to the install command which 
collects all informations of the to installable files. 

Thanks for your help.

Greetings

Alexander



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

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

Re: [CMake] Custom build command for documentation

2008-01-08 Thread Pau Garcia i Quiles

Quoting [EMAIL PROTECTED]:


Hi all,

currently I can generate for some subdirectories my Latex and   
Doxygen documentation. This is done like it is described in the   
cmake FAQ.
What I now want to do is to collect all this commands of the   
subdirectory and put it in an unique common build command, e.g. make  
 doc.
The idea is that the user can generate all documents with one common  
 command, like cmake currently does during source build when a user   
types make all.


The problem is that when I add a custom target it doesn't know about  
 targets given by a ADD_SUBDIRECTORY command.


Consider following structure:

\src
 \modules
  \module1 - some docu
  \module2 - some docu
  \module3 - some docu
 \tools
  \tool1 - some docu
  \tool2 - some docu

Then think about the user who types in make doc and all documents   
of the whole build is generated.


Is it with current release (cmake 2.4.7) possible to generate such a  
 command for generating documentation?


If not so. Does the next big step of cmake (cmake 2.5 or 2.6 ???)   
consider something like a doc command in it? Similar to the install   
command which collects all informations of the to installable files.


Thanks for your help.

Greetings

Alexander


I'm using this:

# Create a make doc target using Doxygen
# Prototype:
# GENERATE_DOCUMENTATION(doxygen_config_file)
# Parameters:
#doxygen_config_fileDoxygen configuration file (must be in the  
root of the source directory)



MACRO(GENERATE_DOCUMENTATION DOXYGEN_CONFIG_FILE)
FIND_PACKAGE(Doxygen)
SET(DOXYFILE_FOUND false)
IF(EXISTS ${PROJECT_SOURCE_DIR}/${DOXYGEN_CONFIG_FILE})
SET(DOXYFILE_FOUND true)
ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/${DOXYGEN_CONFIG_FILE})

IF( DOXYGEN_FOUND )
IF( DOXYFILE_FOUND )
# Add target
ADD_CUSTOM_TARGET( doc ALL ${DOXYGEN_EXECUTABLE}  
${PROJECT_SOURCE_DIR}/${DOXYGEN_CONFIG_FILE} )


# Add .tag file and generated documentation to the list of  
files we must erase when distcleaning


# Read doxygen configuration file
FILE( READ ${PROJECT_SOURCE_DIR}/${DOXYGEN_CONFIG_FILE}  
DOXYFILE_CONTENTS )

STRING( REGEX REPLACE \n ; DOXYFILE_LINES ${DOXYFILE_CONTENTS} )

# Parse .tag filename and add to list of files to delete if it exists
FOREACH( DOXYLINE ${DOXYFILE_CONTENTS} )
STRING( REGEX REPLACE .*GENERATE_TAGFILE *= *([^  
^\n]+).* \\1 DOXYGEN_TAG_FILE ${DOXYLINE} )

ENDFOREACH( DOXYLINE )
ADD_TO_DISTCLEAN( ${PROJECT_BINARY_DIR}/${DOXYGEN_TAG_FILE} )

# Parse doxygen output doc dir and add to list of files to  
delete if it exists

FOREACH( DOXYLINE ${DOXYFILE_CONTENTS} )
STRING( REGEX REPLACE .*OUTPUT_DIRECTORY *= *([^  
^\n]+).* \\1 DOXYGEN_DOC_DIR ${DOXYLINE} )

ENDFOREACH( DOXYLINE )
ADD_TO_DISTCLEAN( ${PROJECT_BINARY_DIR}/${DOXYGEN_DOC_DIR} )
ADD_TO_DISTCLEAN( ${PROJECT_BINARY_DIR}/${DOXYGEN_DOC_DIR}.dir )

ELSE( DOXYFILE_FOUND )
MESSAGE( STATUS Doxygen configuration file not found -  
Documentation will not be generated )

ENDIF( DOXYFILE_FOUND )
ELSE(DOXYGEN_FOUND)
MESSAGE(STATUS Doxygen not found - Documentation will not be generated)
ENDIF(DOXYGEN_FOUND)
ENDMACRO(GENERATE_DOCUMENTATION)

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

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


Re: [CMake] Custom build command for documentation

2008-01-08 Thread Stefan Buschmann

Hi,

You can just define custom dependencies to include all your 
documentation in one doc target.


E.g. I have a target Docs in my project:
 ADD_CUSTOM_TARGET(Docs)

And then in each subdirectory that contains a documentation project, I 
write e.g.:

 ...
 ADD_CUSTOM_TARGET(Docs-Doxygen
   DEPENDS   ${PROJECT_TARGET_CHM}
 )
 ...
 ADD_DEPENDENCIES(Docs
   Docs-Doxygen
 )

This will cause make Docs to make all documentation projects at once.

Bye,

Stefan


[EMAIL PROTECTED] schrieb:

Hi all,

currently I can generate for some subdirectories my Latex and Doxygen 
documentation. This is done like it is described in the cmake FAQ.
What I now want to do is to collect all this commands of the subdirectory and 
put it in an unique common build command, e.g. make doc.
The idea is that the user can generate all documents with one common command, 
like cmake currently does during source build when a user types make all.

The problem is that when I add a custom target it doesn't know about targets 
given by a ADD_SUBDIRECTORY command.

Consider following structure:

\src
 \modules
  \module1 - some docu
  \module2 - some docu
  \module3 - some docu
 \tools
  \tool1 - some docu
  \tool2 - some docu

Then think about the user who types in make doc and all documents of the 
whole build is generated.

Is it with current release (cmake 2.4.7) possible to generate such a command 
for generating documentation?

If not so. Does the next big step of cmake (cmake 2.5 or 2.6 ???) consider something like a doc command in it? Similar to the install command which collects all informations of the to installable files. 


Thanks for your help.

Greetings

Alexander



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

  



___
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


RE: [CMake] Custom build command for documentation

2008-01-08 Thread Alexander.Camek


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]
 ] On Behalf Of Stefan Buschmann
 Sent: Tuesday, January 08, 2008 1:51 PM
 To: CMake@cmake.org
 Subject: Re: [CMake] Custom build command for documentation
 
 Hi,
 
 You can just define custom dependencies to include all your 
 documentation in one doc target.
 
 E.g. I have a target Docs in my project:
   ADD_CUSTOM_TARGET(Docs)
 
 And then in each subdirectory that contains a documentation 
 project, I write e.g.:
   ...
   ADD_CUSTOM_TARGET(Docs-Doxygen
 DEPENDS   ${PROJECT_TARGET_CHM}
   )
   ...
   ADD_DEPENDENCIES(Docs
 Docs-Doxygen
   )

I have tried this, but I get the error that doc isn't known.
Okay it can't be known, because it is defined in the main CMakeLists.txt and 
not in the same subdirectory CMakeLists.txt.

  currently I can generate for some subdirectories my Latex 
 and Doxygen documentation. This is done like it is described 
 in the cmake FAQ.
  What I now want to do is to collect all this commands of 
 the subdirectory and put it in an unique common build 
 command, e.g. make doc.
  The idea is that the user can generate all documents with 
 one common command, like cmake currently does during source 
 build when a user types make all.
 
  The problem is that when I add a custom target it doesn't 
 know about targets given by a ADD_SUBDIRECTORY command.
 
  Consider following structure:
 
  \src
   \modules
\module1 - some docu
\module2 - some docu
\module3 - some docu
   \tools
\tool1 - some docu
\tool2 - some docu
 
  Then think about the user who types in make doc and all 
 documents of the whole build is generated.
 
  Is it with current release (cmake 2.4.7) possible to 
 generate such a command for generating documentation?
 
  If not so. Does the next big step of cmake (cmake 2.5 or 
 2.6 ???) consider something like a doc command in it? Similar 
 to the install command which collects all informations of the 
 to installable files. 

What I have currently tried was this:
Consider following structure:

\src (main CMakeLists.txt)
  \modules (module CMakeLists.txt)
   \module1 - some docu (CMakeLists.txt for module1 with build and all source 
information stuff, add_library, and so on)
   \module2 - some docu
   \module3 - some docu
  \tools
   \tool1 - some docu
   \tool2 - some docu

In my CMakeLists.txt at given structure I added after the ADD_SUBDIRECTORY 
commands in the main CMakeLists.txt

ADD_CUSTOM_TARGET(LaTeX_Documents echo DEPENDS modules_doc tools_doc)
ADD_CUSTOM_TARGET(Doxygen_Documents DEPENDS )
ADD_CUSTOM_TARGET(doc DEPENDS LaTeX_Documents Doxygen_Documents)

Now I added there in the CMakeList.txt after the ADD_SUBDIRECTORY a 
ADD_CUSTOM_TARGET(modules_doc echo DEPENDS module1_doc module2_doc) and so on.
And for example in my module1 CMakeLists.txt I added 
ADD_CUSTOM_TARGET(module1_doc echo DEPENDS ${RESULT}) after the whole three 
step Latex build (as explaned on FAQ).

But that doesn't work, because I get an error: No rule to make target 
`module1_doc', needed by `modules/CMakeFiles/modules_doc'.

Is it possible do something like that. The idea behind the hierachical step is 
that every future module developer has only to add his module directory and add 
his document target to the CMakeLists.txt in the upper directory. Therefore he 
doesn't need to know or change anything in any other part of the build.

Hope now my idea is more clearer.


Greetings Alexander



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

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

RE: [CMake] Custom build command for documentation

2008-01-08 Thread Alexander.Camek
Ah forgot to put the ADD_CUSTOM_TARGET before the ADD_SUBDIRECTORY. 
Now it works fine.

Thanks Stefan for your greate help.

Greetings

Alexander



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

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