[CMake] removing \ from ${CMAKE_CXX_FLA GS}

2010-01-28 Thread naryniecki
Hi,

I need to use ${CMAKE_CXX_FLAGS} variable, but it contains unneeded char: \.
I tried to remove it:
STRING(REPLACE '\\'   FLAGS ${CMAKE_CXX_FLAGS})
but it didn't work. How can I do this?

Br.
Marek
___
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] how to add LDFLAGS BY FORCE??

2010-01-28 Thread jojelino

I DONT WANT 'CMAKE' DO DEPENDENCY STUFF. because it sucks very much.
instead of letting cmake do MORON stuff to piss me off, i want to give 
it wise and toleable solution by giving LDFLAGS stuff by hand after 
source files (surely it is external library)
such as gcc -shared -o out.exe a.o b.o c.o... -lgtk -lgdk -latk... which 
is more practical and easy to fix.


MY BUILD ENVIRONMENT IS TOTALLY MESSED UP.and i'm so so dying to find it.

___
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] FindSubversion does not handle REQUIRED option

2010-01-28 Thread Marcel Loose
There's a bug in the current FindSubversion.cmake, which causes it to
ignore the REQUIRED option, when option QUIET is not given. The
following patch solves this. IMHO, it would be even better to use FPHSA
for this.

Furthermore, I'm not sure whether it's desirable to conditionally define
macros. This puts the burden on the user to check Subversion_FOUND
first, before calling, e.g., Subversion_WC_INFO. I'd prefer to do this
inside the macro Subversion_WC_INFO.

Just my 2 cents.
Marcel Loose.


Index: FindSubversion.cmake
===
RCS file: /cvsroot/CMake/CMake/Modules/FindSubversion.cmake,v
retrieving revision 1.5
diff -u -r1.5 FindSubversion.cmake
--- FindSubversion.cmake28 Sep 2009 15:45:46 -  1.5
+++ FindSubversion.cmake28 Jan 2010 08:54:18 -
@@ -110,13 +110,13 @@
 ENDIF(Subversion_SVN_EXECUTABLE)

 IF(NOT Subversion_FOUND)
-  IF(NOT Subversion_FIND_QUIETLY)
-MESSAGE(STATUS Subversion was not found.)
-  ELSE(NOT Subversion_FIND_QUIETLY)
-IF(Subversion_FIND_REQUIRED)
-  MESSAGE(FATAL_ERROR Subversion was not found.)
-ENDIF(Subversion_FIND_REQUIRED)
-  ENDIF(NOT Subversion_FIND_QUIETLY)
+  IF(Subversion_FIND_REQUIRED)
+MESSAGE(FATAL_ERROR Subversion was not found.)
+  ELSE(Subversion_FIND_REQUIRED)
+IF(NOT Subversion_FIND_QUIETLY)
+  MESSAGE(STATUS Subversion was not found.)
+ENDIF(NOT Subversion_FIND_QUIETLY)
+  ENDIF(Subversion_FIND_REQUIRED)
 ENDIF(NOT Subversion_FOUND)

 # FindSubversion.cmake ends here.


___
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] how to add LDFLAGS BY FORCE??

2010-01-28 Thread Marcel Loose
Why not write your own Makefile and use make, then YOU can do all the
dependency stuff yourself. Then you don't have to use CMake, which you
appear to dislike so much. 

You apparently don't appreciate all the hard work that CMake does for
you, and seem not willing to put effort into learning this. Flaming
doesn't help you much.

Marcel Loose.

On Thu, 2010-01-28 at 17:30 +0900, jojelino wrote:
 I DONT WANT 'CMAKE' DO DEPENDENCY STUFF. because it sucks very much.
 instead of letting cmake do MORON stuff to piss me off, i want to give

 it wise and toleable solution by giving LDFLAGS stuff by hand after 
 source files (surely it is external library)
 such as gcc -shared -o out.exe a.o b.o c.o... -lgtk -lgdk -latk...
which 
 is more practical and easy to fix.
 
 MY BUILD ENVIRONMENT IS TOTALLY MESSED UP.and i'm so so dying to find
it.
 
 ___
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake


___
Powered by www.kitware.com

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

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

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


[CMake] this is what i got struck

2010-01-28 Thread jojelino
i want to include gtk dependency libraries with gtk itself. but 
followings was error-prone.

set(a )
find_library(a NAMES gdk_pixbuf-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gdk-win32-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gtk-win32-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gdi32)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES imm32)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES shell32)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES ole32)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES uuid)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES pangocairo-1.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES pangoft2-1.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES pangowin32-1.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gdi32)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES freetype)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES fontconfig)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES pango-1.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES m)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES atk-1.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES cairo)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gio-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gobject-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gmodule-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES gthread-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES glib-2.0)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
find_library(a NAMES intl)
set(GTKLIBS ${GTKLIBS} ${a})
set(a )
mark_as_advanced(GTKLIBS)
target_link_libraries(dev9null ${GTKLIBS})
target_link_libraries(CDVDnull ${GTKLIBS})

I wondered why this brute-force based method doesn't work with cmake.
it complains it isn't from project so it can't compile. what a mess. 
cmake, this is not what you need to care for!

how we can deceive cmake so that i can work without problem?

___
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] this is what i got struck

2010-01-28 Thread Adolfo Rodríguez Tsouroukdissian
It would be best if you explained your use case in more detail. Anyway, this
might be a helpful read

http://cmake.org/cmake/help/cmake-2-8-docs.html#module:FindGTK2

Best,

Adolfo.


On Thu, Jan 28, 2010 at 10:30 AM, jojelino jojel...@gmail.com wrote:

 i want to include gtk dependency libraries with gtk itself. but followings
 was error-prone.
 set(a )
 find_library(a NAMES gdk_pixbuf-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gdk-win32-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gtk-win32-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gdi32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES imm32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES shell32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES ole32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES uuid)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pangocairo-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pangoft2-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pangowin32-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gdi32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES freetype)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES fontconfig)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pango-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES m)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES atk-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES cairo)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gio-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gobject-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gmodule-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gthread-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES glib-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES intl)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 mark_as_advanced(GTKLIBS)
 target_link_libraries(dev9null ${GTKLIBS})
 target_link_libraries(CDVDnull ${GTKLIBS})

 I wondered why this brute-force based method doesn't work with cmake.
 it complains it isn't from project so it can't compile. what a mess. cmake,
 this is not what you need to care for!
 how we can deceive cmake so that i can work without problem?

 ___
 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




-- 
Adolfo Rodríguez Tsouroukdissian, Ph. D.

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
contener información privilegiada y/o confidencial que está dirigida
exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
destinatario indicado, o el empleado encargado de su entrega a dicha
persona, por favor, notifíquelo inmediatamente y remita el mensaje original
a la dirección de correo electrónico indicada. Cualquier copia, uso o
distribución no autorizados de esta comunicación queda estrictamente
prohibida.

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
contain confidential information which is privileged and intended only for
the individual or entity to whom they are addressed.  If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution or use of this e-mail and/or accompanying document(s) is
strictly prohibited.  If you have received this e-mail in error, please
immediately notify the sender at the above e-mail address.
___
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] this is what i got struck

2010-01-28 Thread Michael Wild
Dude, you really are in some need of RTFM! E.g. here 
http://lmgtfy.com/?q=cmake+documentation

Flaming, swearing and strong language won't get you much help here!

find_library(a ...) creates a variable in the cache called a. Next time you 
call find_library(a ...) it just won't do anything, because a is already in 
the cache and evaluates to true (i.e. is not 0, FALSE, NO, OFF, NOTFOUND or 
*-NOTFOUND).

So, fix your code to read:


find_package(GTK2 REQUIRED)
include_directories(${GTK2_INCLUDE_DIRS})
...
target_link_libraries(dev9null ${GTK2_LIBRARIES})
...


Most of the libraries you showed below will be picked up automatically. If you 
still insist on doing things yourself, do something like this:

find_library(GDK_PIXBUF_LIBRARY gdk_pixbuf-2.0)
find_library(GDK_WIN32_LIBRARY gdk-win32-2.0)
find_library(GTK_WIN32_LIBRARY gtk-win32-2.0)
...
set(GTKLIBS
  ${GDK_PIXBUF_LIBRARY}
  ${GDK_WIN32_LIBRARY}
  ${GTK_WIN32_LIBRARY}
  ...
  )

target_link_libraries(dev9null ${GTKLIBS})
...


HTH

Michael

On 28. Jan, 2010, at 10:30 , jojelino wrote:

 i want to include gtk dependency libraries with gtk itself. but followings 
 was error-prone.
 set(a )
 find_library(a NAMES gdk_pixbuf-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gdk-win32-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gtk-win32-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gdi32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES imm32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES shell32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES ole32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES uuid)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pangocairo-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pangoft2-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pangowin32-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gdi32)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES freetype)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES fontconfig)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES pango-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES m)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES atk-1.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES cairo)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gio-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gobject-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gmodule-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES gthread-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES glib-2.0)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 find_library(a NAMES intl)
 set(GTKLIBS ${GTKLIBS} ${a})
 set(a )
 mark_as_advanced(GTKLIBS)
 target_link_libraries(dev9null ${GTKLIBS})
 target_link_libraries(CDVDnull ${GTKLIBS})
 
 I wondered why this brute-force based method doesn't work with cmake.
 it complains it isn't from project so it can't compile. what a mess. cmake, 
 this is not what you need to care for!
 how we can deceive cmake so that i can work without problem?
 
 ___
 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] Changing the build-mode

2010-01-28 Thread Michael Wild

On 28. Jan, 2010, at 11:19 , Micha Renner wrote:

 There is a library, which has the suffix d, if it is compiled in
 Debug-Mode
 
 ADD_LIBRARY(${_targetname} SHARED ${_src} ${_imIncludeFiles})
 SET_TARGET_PROPERTIES(${_targetname} PROPERTIES DEBUG_OUTPUT_NAME
 ${_targetname}d)
 INSTALL(TARGETS ${_targetname} EXPORT SLibName 
   RUNTIME DESTINATION dll
   LIBRARY DESTINATION lib
   ARCHIVE DESTINATION lib)
 INSTALL(EXPORT SLibName NAMESPACE mp_ DESTINATION lib/SLibName)
 
 In an other project an application uses the library:
 INCLUDE(${CMAKE_INSTALL_PREFIX}/lib/SLibName/SLibName.cmake)
 ADD_EXECUTABLE(TestDll12 testC.c)
 TARGET_LINK_LIBRARIES(TestDll12 mp_SLib1)
 
 If I set CMAKE_BUILD_TYPE to Debug (CMAKE-GUI), the application
 program uses debug-library.
 After switching into the Release-Mode, the application program still
 uses the debug-library.
 The trick is to delete the cache, then it works.
 
 So is it really always necessary to delete the cache, if I change the
 build-mode?
 
 Micha

Not sure what's going on, I actually never tried to do that. But you'll 
certainly want to have a look at the CONFIG_POSTFIX target property or the 
CONFIG_POSTFIX variable for setting a postfix (such as d) depending on the 
configuration.

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] Compaq Visual Fortran

2010-01-28 Thread Arjen Markus

Hi Brad,

it does not work - I get a message that the Fortran compiler
identification is unknown. Does CMake run the compiler with the
/fpp option? If not, then that is the cause (without there is
no particular macro defined)

Regards,

Arjen

On 2010-01-28 14:27, Brad King wrote:

Arjen Markus wrote:

If you turn on the preprocessor option, then a number of macros
are defined, the most useful being:

_DF_VERSION_=660 and _VF_VERSION_==660


Please try out the patch below (applies to CMake from CVS HEAD).
With it, CMake should recognize the Compaq compiler out of the box.
It won't know what flags to use without the compiler info files, but
at least it should report the compiler identification.  If that works
for you I'll commit it upstream.  Then we can work on the compiler
info files.

Thanks,
-Brad

diff --git a/Modules/CMakeFortranCompilerId.F.in 
b/Modules/CMakeFortranCompilerId.F.in
index 107470c..a9aec76 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -10,6 +10,8 @@
 PRINT *, 'INFO:compiler[G95]'
 #elif defined(__PATHSCALE__)
 PRINT *, 'INFO:compiler[PathScale]'
+#elif defined(_DF_VERSION_) || defined(_VF_VERSION_)
+PRINT *, 'INFO:compiler[Compaq]'
 #elif defined(__GNUC__)
 PRINT *, 'INFO:compiler[GNU]'
 #elif defined(__IBMC__)


___
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] Compaq Visual Fortran

2010-01-28 Thread Brad King
Arjen Markus wrote:
 it does not work - I get a message that the Fortran compiler
 identification is unknown. Does CMake run the compiler with the
 /fpp option? If not, then that is the cause (without there is
 no particular macro defined)

In CMakeDetermineFortranCompiler.cmake we list the possible flags
to try if it can't find a compiler id:

  SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only.
-c

# Intel on windows does not preprocess by default.
-fpp
)

It should have tried -fpp.  Look in CMakeFiles/CMakeError.log
to see if it reports what happened.

Also, please try building the compiler id source by hand.
Copy CMakeFortranCompilerId.F.in and rename it to drop
the .in part.  Then run

  f90 -fpp CMakeFortranCompilerId.F

Please send me whatever files this produces.

Thanks,
-Brad
___
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] Would there be a need for Subversion_WC_UPDATE??

2010-01-28 Thread John Drescher
On Thu, Jan 28, 2010 at 3:28 AM, Marcel Loose lo...@astron.nl wrote:
 Hi all,

 For my project, I'm working on automatic 'svn update' of (parts of) my
 source tree, prior to building. I was wondering whether someone else
 might be interested in that kind of functionality. If so, maybe it could
 be added as a macro to FindSubversion?


Yes I could definitely use that feature.

-- 
John M. Drescher
___
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] Compaq Visual Fortran

2010-01-28 Thread Arjen Markus

Hi Brad,

the program is compiled and linked without a problem. But
it writes:
INFO:compiler[]
INFO:platform[Windows]

I have examined the preprocessed source code and re-read the
online documentation: all the macros defined in the table I
looked at are available to the preprocessor, except, indeed
_DF_VERSION_ and _VF_VERSION_.

I tried to set the flag -fpp to /fpp /D_DF_VERSION_=660 to
force the definition, but the compipler sees these flags
as a single flag and stops.

Regards,

Arjen

On 2010-01-28 14:53, Brad King wrote:

Arjen Markus wrote:

it does not work - I get a message that the Fortran compiler
identification is unknown. Does CMake run the compiler with the
/fpp option? If not, then that is the cause (without there is
no particular macro defined)


In CMakeDetermineFortranCompiler.cmake we list the possible flags
to try if it can't find a compiler id:

  SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only.
-c

# Intel on windows does not preprocess by default.
-fpp
)

It should have tried -fpp.  Look in CMakeFiles/CMakeError.log
to see if it reports what happened.

Also, please try building the compiler id source by hand.
Copy CMakeFortranCompilerId.F.in and rename it to drop
the .in part.  Then run

  f90 -fpp CMakeFortranCompilerId.F

Please send me whatever files this produces.

Thanks,
-Brad


___
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] Compaq Visual Fortran

2010-01-28 Thread Brad King
Arjen Markus wrote:
 the program is compiled and linked without a problem. But
 it writes:
 INFO:compiler[]
 INFO:platform[Windows]
 
 I have examined the preprocessed source code and re-read the
 online documentation: all the macros defined in the table I
 looked at are available to the preprocessor, except, indeed
 _DF_VERSION_ and _VF_VERSION_.

In the Compaq Visual Fortran Programmer's Guide (cvf_pg.pdf) I see:

The following preprocessor symbols are predefined by the compiler system
 and are available to compiler directives and FPP (except _DF_VERSION_):
 _DF_VERSION_= 650 (650 for Version 6.5; compiler only) ...

Perhaps this means that _DF_VERSION_ is available only as a Fortran
language symbol.

So we conclude that the compiler provides no way to identify itself
using the preprocessor.  This will need non-trivial work in CMake to
recognize it.  We'll have to start running unrecognized compilers
with various -V, --version, etc. arguments hoping to find one
that prints the compiler name.

What is the output of

  f90 -what

?

-Brad
___
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] Compaq Visual Fortran

2010-01-28 Thread Arjen Markus

Hi Brad,



Perhaps this means that _DF_VERSION_ is available only as a Fortran
language symbol.



It would look that way, but what use would it have then?


So we conclude that the compiler provides no way to identify itself
using the preprocessor.  This will need non-trivial work in CMake to
recognize it.  We'll have to start running unrecognized compilers
with various -V, --version, etc. arguments hoping to find one
that prints the compiler name.

What is the output of

  f90 -what



I ran f90 -what:

Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.

Compaq Visual Fortran 6.6-4088-47D3B
C:\Program Files\Microsoft Visual Studio\DF98\BIN\decfor90.exe

Regards,

Arjen
___
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] FindSubversion does not handle REQUIRED option

2010-01-28 Thread David Cole
The wiki page that lists module maintainers is found here:
http://www.itk.org/Wiki/CMake:Module_Maintainers

For FindSubversion.cmake, Tristan Carel is listed as the maintainer.

Perhaps patches for FindSubversion.cmake would more appropriately be added
to patch files attached to a bug report / feature request. (And then that
bug would be assigned to the module maintainer for whatever module it
belongs to.)

Patches tend to get lost in the shuffle on this mailing list.


David


On Thu, Jan 28, 2010 at 4:07 AM, Marcel Loose lo...@astron.nl wrote:

 There's a bug in the current FindSubversion.cmake, which causes it to
 ignore the REQUIRED option, when option QUIET is not given. The
 following patch solves this. IMHO, it would be even better to use FPHSA
 for this.

 Furthermore, I'm not sure whether it's desirable to conditionally define
 macros. This puts the burden on the user to check Subversion_FOUND
 first, before calling, e.g., Subversion_WC_INFO. I'd prefer to do this
 inside the macro Subversion_WC_INFO.

 Just my 2 cents.
 Marcel Loose.


 Index: FindSubversion.cmake
 ===
 RCS file: /cvsroot/CMake/CMake/Modules/FindSubversion.cmake,v
 retrieving revision 1.5
 diff -u -r1.5 FindSubversion.cmake
 --- FindSubversion.cmake28 Sep 2009 15:45:46 -  1.5
 +++ FindSubversion.cmake28 Jan 2010 08:54:18 -
 @@ -110,13 +110,13 @@
  ENDIF(Subversion_SVN_EXECUTABLE)

  IF(NOT Subversion_FOUND)
 -  IF(NOT Subversion_FIND_QUIETLY)
 -MESSAGE(STATUS Subversion was not found.)
 -  ELSE(NOT Subversion_FIND_QUIETLY)
 -IF(Subversion_FIND_REQUIRED)
 -  MESSAGE(FATAL_ERROR Subversion was not found.)
 -ENDIF(Subversion_FIND_REQUIRED)
 -  ENDIF(NOT Subversion_FIND_QUIETLY)
 +  IF(Subversion_FIND_REQUIRED)
 +MESSAGE(FATAL_ERROR Subversion was not found.)
 +  ELSE(Subversion_FIND_REQUIRED)
 +IF(NOT Subversion_FIND_QUIETLY)
 +  MESSAGE(STATUS Subversion was not found.)
 +ENDIF(NOT Subversion_FIND_QUIETLY)
 +  ENDIF(Subversion_FIND_REQUIRED)
  ENDIF(NOT Subversion_FOUND)

  # FindSubversion.cmake ends here.


 ___
 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] Compaq Visual Fortran

2010-01-28 Thread Brad King
Arjen Markus wrote:
 Perhaps this means that _DF_VERSION_ is available only as a Fortran
 language symbol.
 
 It would look that way, but what use would it have then?

Perhaps it can be used in regular (runtime) IF tests?  Of course other
compilers won't define it, so it's useful only in vendor-specific code.

 I ran f90 -what:
 
 Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
 Copyright 2003 Compaq Computer Corp. All rights reserved.
 
 Compaq Visual Fortran 6.6-4088-47D3B
 C:\Program Files\Microsoft Visual Studio\DF98\BIN\decfor90.exe

Thanks.  Undo the previous patch and try the one below instead.

-Brad


diff --git a/Modules/CMakeDetermineCompilerId.cmake 
b/Modules/CMakeDetermineCompilerId.cmake
index a70c6ab..bf4176c 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -42,6 +42,11 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
 ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
   ENDFOREACH(flags)

+  # If the compiler is still unknown, try to query its vendor.
+  IF(NOT CMAKE_${lang}_COMPILER_ID)
+CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
+  ENDIF()
+
   # if the format is unknown after all files have been checked, put Unknown 
in the cache
   IF(NOT CMAKE_EXECUTABLE_FORMAT)
 SET(CMAKE_EXECUTABLE_FORMAT Unknown CACHE INTERNAL Executable file 
format)
@@ -245,3 +250,32 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
 PARENT_SCOPE)
   SET(CMAKE_EXECUTABLE_FORMAT ${CMAKE_EXECUTABLE_FORMAT} PARENT_SCOPE)
 ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
+
+#-
+# Function to query the compiler vendor.
+FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
+  FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
+SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
+SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
+EXECUTE_PROCESS(
+  COMMAND ${CMAKE_${lang}_COMPILER}
+  ${CMAKE_${lang}_COMPILER_ID_ARG1}
+  ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+  ${flags}
+  WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
+  OUTPUT_VARIABLE output ERROR_VARIABLE output
+  RESULT_VARIABLE result
+  )
+IF(${output} MATCHES ${regex})
+  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+Checking whether the ${lang} compiler is ${vendor} using \${flags}\ 

+matched \${regex}\:\n${output})
+  SET(CMAKE_${lang}_COMPILER_ID ${vendor} PARENT_SCOPE)
+  BREAK()
+ELSE()
+  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+Checking whether the ${lang} compiler is ${vendor} using \${flags}\ 

+did not match \${regex}\:\n${output})
+ENDIF()
+  ENDFOREACH()
+ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake 
b/Modules/CMakeDetermineFortranCompiler.cmake
index 44e45d8..0637d20 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -162,6 +162,11 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
 -fpp
 )

+  # Table of per-vendor compiler id flags with expected output.
+  LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
+  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq -what)
+  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq Compaq Visual Fortran)
+
   # Try to identify the compiler.
   SET(CMAKE_Fortran_COMPILER_ID)
   INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.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] Compaq Visual Fortran

2010-01-28 Thread Arjen Markus

Hi Brad,

I will try the new patch tomorrow.

I tried printing it as an ordinary variable or constant, but that did
not work: variable names are not allowed to start with an underscore.

Regards,

Arjen

On 2010-01-28 17:18, Brad King wrote:

Arjen Markus wrote:

Perhaps this means that _DF_VERSION_ is available only as a Fortran
language symbol.

It would look that way, but what use would it have then?


Perhaps it can be used in regular (runtime) IF tests?  Of course other
compilers won't define it, so it's useful only in vendor-specific code.


I ran f90 -what:

Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.

Compaq Visual Fortran 6.6-4088-47D3B
C:\Program Files\Microsoft Visual Studio\DF98\BIN\decfor90.exe


Thanks.  Undo the previous patch and try the one below instead.

-Brad


diff --git a/Modules/CMakeDetermineCompilerId.cmake 
b/Modules/CMakeDetermineCompilerId.cmake
index a70c6ab..bf4176c 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -42,6 +42,11 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
 ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
   ENDFOREACH(flags)

+  # If the compiler is still unknown, try to query its vendor.
+  IF(NOT CMAKE_${lang}_COMPILER_ID)
+CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
+  ENDIF()
+
   # if the format is unknown after all files have been checked, put Unknown 
in the cache
   IF(NOT CMAKE_EXECUTABLE_FORMAT)
 SET(CMAKE_EXECUTABLE_FORMAT Unknown CACHE INTERNAL Executable file 
format)
@@ -245,3 +250,32 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
 PARENT_SCOPE)
   SET(CMAKE_EXECUTABLE_FORMAT ${CMAKE_EXECUTABLE_FORMAT} PARENT_SCOPE)
 ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
+
+#-
+# Function to query the compiler vendor.
+FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
+  FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
+SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
+SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
+EXECUTE_PROCESS(
+  COMMAND ${CMAKE_${lang}_COMPILER}
+  ${CMAKE_${lang}_COMPILER_ID_ARG1}
+  ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+  ${flags}
+  WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
+  OUTPUT_VARIABLE output ERROR_VARIABLE output
+  RESULT_VARIABLE result
+  )
+IF(${output} MATCHES ${regex})
+  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+Checking whether the ${lang} compiler is ${vendor} using \${flags}\ 

+matched \${regex}\:\n${output})
+  SET(CMAKE_${lang}_COMPILER_ID ${vendor} PARENT_SCOPE)
+  BREAK()
+ELSE()
+  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+Checking whether the ${lang} compiler is ${vendor} using \${flags}\ 

+did not match \${regex}\:\n${output})
+ENDIF()
+  ENDFOREACH()
+ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake 
b/Modules/CMakeDetermineFortranCompiler.cmake
index 44e45d8..0637d20 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -162,6 +162,11 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
 -fpp
 )

+  # Table of per-vendor compiler id flags with expected output.
+  LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
+  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq -what)
+  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq Compaq Visual Fortran)
+
   # Try to identify the compiler.
   SET(CMAKE_Fortran_COMPILER_ID)
   INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)


___
Powered by www.kitware.com

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

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

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


[CMake] Tips to create a UseXYZ.cmake

2010-01-28 Thread Anton Deguet
Hello,

Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ... is there a 
short description of the philosophy and basic commands to  use?   Any pointer 
is welcome.  This would be for a project with multiple external dependencies, 
i.e. libxml, openCV, Python, numpy, ...

Thanks,

Anton


---
Anton Deguet, Research Engineer, ERC-CISST/LCSR, Johns Hopkins University
e-mail: anton.deg...@jhu.edu, iChat: anton.deg...@mac.com
office phone: 410-516-5261, cell phone: 410-790-0456
JHU, LCSR, CSEB 137b, 3400 North Charles Street, Baltimore, MD 21218, USA




___
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] How to determine a ABI version of the arm-linux-gcc?

2010-01-28 Thread Alexander Neundorf
On Thursday 28 January 2010, Hendrik Sattler wrote:
 Zitat von Yegor Yefremov yegor_s...@visionsystems.de:
  are these two statements not doubled?
 
  +#elif defined(__GNU__)  defined(__ELF__)  defined(__ARMEL__)
  +# define ABI_ID ELF ARM
  +#elif defined(__GNU__)  defined(__ELF__)  defined(__ARMEL__)
  +# define ABI_ID ELF ARM

 One of them should be __ARMEB__ instead of __ARMEL__, I guess.

Like ARM, Endian little and .. big ?

Alex
___
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] Tips to create a UseXYZ.cmake

2010-01-28 Thread Mateusz Loskot
Anton Deguet wrote:
 Hello,
 
 Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ...
 is there a short description of the philosophy and basic commands to
 use?   Any pointer is welcome.  This would be for a project with
 multiple external dependencies, i.e. libxml, openCV, Python, numpy,
 ...
 

What's the difference between Use*.cmake and Find*.cmake?

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Tips to create a UseXYZ.cmake

2010-01-28 Thread Michael Wild

On 28. Jan, 2010, at 19:01 , Anton Deguet wrote:

 Hello,
 
 Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ... is there 
 a short description of the philosophy and basic commands to  use?   Any 
 pointer is welcome.  This would be for a project with multiple external 
 dependencies, i.e. libxml, openCV, Python, numpy, ...
 
 Thanks,
 
 Anton

I usually do it like this:

XYZConfig.cmake:
- import targets
- deal with version requirements and COMPONENTS
- define variables, such as XYZ_INCLUDE_DIR, XYZ_LIBRARIES, XYZ_COMPILE_FLAGS 
and XYZ_USE_FILE
- anything else to make it work like a FindXYZ.cmake module, just the bare 
minimum

XYZUse.cmake (or UseXYZ.cmake):
- perhaps call include_directories (personally I don't like this)
- call add_definitions if required
- define useful macros/functions (such as qt4_wrap_ui)
- anything else that makes working with XYZ comfortable


If you don't plan on calling include_directories and add_definitions (and 
similar) in your USE-file and the macros/functions are few and short, it might 
be reasonable to put them in the CONFIG-file directly.


HTH

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] New Kitware's Developer Blog

2010-01-28 Thread Bill Hoffman




Kitware launched
its first developer
blog today
with contributions from Company technical and business leaders.
Following the
blog is a great way to obtain early access to evolving technology and
provide
commentary feedback. Blog postings may be followed by topic area, or on
an
individual basis. You may wish to subscribe to blog notifications via email
or RSS
feed
or you may subscribe to posts written by specific members of our
RD team. As always
feedback and comments are welcome.


If there is something
specific about CMake that would would like to hear my thoughts on, feel
free to send me an email.

Of interest to CMake users, is this blog entry about dll manifest
issues:
http://www.kitware.com/blog/home/post/4

Enjoy!

-Bill






___
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] Cross compilation and native executables

2010-01-28 Thread Guillaume Duhamel
 (3)
 Use execute_process() to run the CMake command line tool and configure the
 host-only project during the configuration step of the main project.  This
 will make the results of the export() command from the subproject available
 for loading by the main project.  Then add a custom target to drive the
 subproject build during the main project build using cmake --build.


I tried using that method with a minor change: I'm launching the generated
native
executable from the native project, so I don't have to export / include any
target.

So I just had to replace:

subdirs(c68k)

with:

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)
execute_process(COMMAND cmake ${CMAKE_CURRENT_SOURCE_DIR}/c68k
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)
add_custom_target(c68kinc COMMAND cmake --build
${CMAKE_CURRENT_BINARY_DIR}/c68k)

It does run the configuration and build step at the right time, but for some
reason
it detects the cross-compiler instead of the native one ; it almost looks
like the
sub-porjects inherits some values from the parent project despite being
run from
a separate CMake process.

Guillaume
___
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] Build only what you need in third party libs

2010-01-28 Thread Brian Davis
Update: currently crying uncle ... and switching to ExternalProject_Add.
CMake and the third party libs were simply not designed for this.

Question on ExternalProject_Add above:

ExternalProject_Add(
  DOWNLOAD_COMMAND 
  CMAKE_ARGS
-DMYPROJ_UBERBUILD:BOOL=OFF
  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
  ...
)

I had in my project:

SET( THIRD_PARTY_SRC_DIR  3rdParty/Win )
add_subdirectory( ${THIRD_PARTY_SRC_DIR}/vtk-5.4.2 ./vtk-5.4.2  )

and so I replaced it with:

ExternalProject_Add(
vtk-5.4.2
DOWNLOAD_COMMAND 
SOURCE_DIR ${THIRD_PARTY_SRC_DIR}/vtk-5.4.2
#SOURCE_DIR
C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\vtk-5.4.2
SOURCE_DIR /source/cpp/lib/3rdParty/Win/vtk-5.4.2

)

Where these lines are in a CMakeLists.txt file located at:

C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\CMakeLists.txt

but I get the error in Visual Studio:

2CMake Error: The source directory
C:/projects/NIH2009/source/branches/trunk/build/dvip4-Win64/cpp_source/lib/3rdParty/Win/vtk-5.4.2
does not appear to contain CMakeLists.txt.

Note the prefixing of
C:/projects/NIH2009/source/branches/trunk/build/dvip4-Win64/cpp_source/lib

vtk is located at
C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\vtk-5.4.2

and project root CMakeLists.txt is at
C:\projects\NIH2009\source\branches\trunk



ExternalProject_Add(
vtk-5.4.2
DOWNLOAD_COMMAND 
SOURCE_DIR /source/cpp/lib/3rdParty/Win/vtk-5.4.2

)

and get:

2CMake Error: The source directory /source/cpp/lib/3rdParty/Win/vtk-5.4.2
does not appear to contain CMakeLists.txt.

so I try:

SOURCE_DIR /3rdParty/Win/vtk-5.4.2

2CMake Error: The source directory /3rdParty/Win/vtk-5.4.2 does not
appear to contain CMakeLists.txt.


so I try absolute path:


ExternalProject_Add(
vtk-5.4.2
DOWNLOAD_COMMAND 
SOURCE_DIR
C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\vtk-5.4.2
}

Ahhh the hacking... I am going to find my way out of this forest one day...
and onto a desert.

And now CMake finds the vtk goop.   Now the question: Is there a project
relative directory syntax to use here or is ExternalProject not like
add_subdirectory in this regard?

-- 
Brian J. Davis
___
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] Cross compilation and native executables

2010-01-28 Thread Brad King
Guillaume Duhamel wrote:
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)
 execute_process(COMMAND cmake ${CMAKE_CURRENT_SOURCE_DIR}/c68k
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)
 add_custom_target(c68kinc COMMAND cmake --build
 ${CMAKE_CURRENT_BINARY_DIR}/c68k)
 
 It does run the configuration and build step at the right time, but for
 some reason it detects the cross-compiler instead of the native one ; it 
 almost
 looks like the sub-porjects inherits some values from the parent project 
 despite
 being run from a separate CMake process.

The execute_process() will run the child CMake with the same environment
variables that the outer CMake uses.  If you have CC or CXX set for the
cross compiler then the inner project will choose that.

I expect the entire native project uses a different toolchain altogether.
You need to pass this toolchain on the inner cmake command line.
Something like this might work:

execute_process(
  COMMAND cmake ${CMAKE_CURRENT_SOURCE_DIR}/c68k
-DCMAKE_C_COMPILER=/path/to/native/cc
-DCMAKE_C_FLAGS=
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k
  )

-Brad
___
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] WPP and Generated Headers

2010-01-28 Thread Mike Roberts
Hi Everyone,

 

I'm currently having a problem with generated headers in a Visual Studio
2005/2008 project generated with CMake. 

 

Visual Studio is regenerating the headers even when nothing has changed.

 

The project requires headers generated by a tool called 'tracewpp',
which is part of the Windows DDK. In short, it generates a header from a
given C/CPP source file and the header is included in the original
source file. I don't know if this is important but it appears to me that
this is a circular dependency.

 

For example, in 'foo.cpp', there will be an include directive that says:

 

#include foo.cpp.tmh

 

and I have written CMake code to generate 'foo.cpp.tmh':

 

---8---Wpp.cmake--

 

function ( tracewpp OUTPUT_VAR INI OUTPUT_DIR SOURCE )

 

# [mlr] list of .tmh files to be generated - TMH

get_filename_component ( FILEN ${SOURCE} NAME )

set ( TMH_FILEN ${FILEN}.tmh )

set ( TMH ${CMAKE_CURRENT_BINARY_DIR}/${TMH_FILEN} )

set ( EXTENSIONS .h.H.c.C.hpp.HPP.cpp.CPP )



# [mlr] cmake only converts the command name to the
native path format. the

# path names to be used in arguments must be converted
manually.

file ( TO_NATIVE_PATH ${SOURCE} NATIVE_SOURCE )

file ( TO_NATIVE_PATH ${WPP_DIR} NATIVE_WPP_DIR )

file ( TO_NATIVE_PATH ${INI} NATIVE_INI )

file ( TO_NATIVE_PATH ${OUTPUT_DIR} NATIVE_OUTPUT_DIR )



# [mlr] note that if -preserveext: occurs after the
source file specification, it has

# no effect.

add_custom_command(

OUTPUT ${TMH}

COMMAND

 
${WPP_DIR}/bin/tracewpp.exe -ext:${EXTENSIONS}
-preserveext:${EXTENSIONS} -cfgdir:${NATIVE_WPP_DIR} -ini:${NATIVE_INI}
-odir:${NATIVE_OUTPUT_DIR} ${NATIVE_SOURCE} 

DEPENDS ${SOURCE}

)

# [mlr] export the value of TMH into OUTPUT_VAR.

set ( ${OUTPUT_VAR} ${TMH} PARENT_SCOPE )



endfunction ()

 

# [mlr] TODO: INI should be an optional argument.

function ( wpp OUTPUT_VAR INI OUTPUT_DIR SOURCES )

 

# [mlr] invoke tracewpp() for each source file, adding
the resulting file to a list 

# named TMH.

foreach ( I ${SOURCES} )

tracewpp ( J ${INI} ${OUTPUT_DIR} ${I} )

list ( APPEND TMH ${J} )

endforeach ()



source_group( WPP Files (generated) REGULAR_EXPRESSION
.+\\.tmh$ )



# [mlr] export the value of TMH into OUTPUT_VAR.

set ( ${OUTPUT_VAR} ${TMH} PARENT_SCOPE )



endfunction ()

 

---8---Wpp.cmake--

 

The list created by wpp() is added to the source file listing that's
passed into add_library() in CMakeList.txt files elsewhere, as described
in the CMake FAQ.

 

The result is that Visual Studio will regenerate 'foo.cpp.tmh'
regardless of whether 'foo.cpp' has been modified or not. This has the
effect of producing a full rebuild since all files in the project are
integrated with 'tracewpp'.

 

Is there something I'm doing wrong? What can I do to prevent full
rebuilds when they're unnecessary?

 

Thanks,

Mike

 

 

___
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] Help with cross-platform app's cmake setup

2010-01-28 Thread Timothy Reaves
I help contribute to Stellarium, which is a cross-platfor planetarium 
app, written using Qt.  It uses cmake for the build system; it just doesn't do 
it well.  I think the files are much more complex than they need to be, and as 
usual, the Mac stuff doesn't really work.  I've looked at the example from 
http://www.bluequartz.net/software/files/QtTest.tar.gz but there are some 
significant differences in the project.

If anyone would like to help out, it'd be greatly appreciated.  
Something as complex as this doesn't work posting snippits of the files to talk 
about.  The source really needs to be looked at.  Have a look at 
http://stellarium.sourceforge.net/

Thanks!
___
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