Re: [CMake] Writing a custom Find*.cmake file for Pantheios

2012-07-12 Thread Rolf Eike Beer
Am Freitag, 13. Juli 2012, 02:41:50 schrieb Philipp Berger:
> Hello everybody,
> 
> I'm relatively new to CMake, but managed to learn everything I needed,
> up until now.
> For a software project in C++ we want to use Pantheios (
> http://www.pantheios.org  ) as logging framework.
> Sadly, there is no FindPantheios.cmake file readily available, so I set of
> to write my own.
> 
> The part for searching the include files/path was easy.
> 
> The big problem I am facing and find myself unable to solve is the wide
> variety of library files.
> The amount of available lib files is huge, see the attached file for the
> list.
> 
> For example, the core libs:
> pantheios.1.core.vc10.x64.dll.debug.lib
> pantheios.1.core.vc10.x64.dll.lib
> pantheios.1.core.vc10.x64.mt.debug.lib
> pantheios.1.core.vc10.x64.mt.lib
> pantheios.1.core.vc10.x64.widestring.dll.debug.lib
> pantheios.1.core.vc10.x64.widestring.dll.lib
> pantheios.1.core.vc10.x64.widestring.mt.debug.lib
> pantheios.1.core.vc10.x64.widestring.mt.lib
> 
> I would like to have a checkbox to select Widestring capability yes/no.
> 
> A main problem for me is to check that the selected libs are valid for
> the current configuration (if VC10 x64 was selected as compiler, only
> allow vc10.x64 libs) - is there a way to securely achieve that? Or
> should I rather let the user select arbitrary lib files and hope that
> they will work?
> 
> What I need is six fields for the user to select lib files - the core
> lib, one frontend and a backend. And that for both Debug and Release. It
> would be much more useful if the user could select from a dropdown menu
> which Front-/Backend he would like together with the Widestring checkbox
> and the CMake file would assign the required Debug and Release libs to
> the variables, but as sated above, I do not know how to produce the
> required version string and how to create such mechanisms in CMake in
> general.

The debug/release stuff can be handled by CMake, just put both of them in the 
result variable prefixed with "debug" and "optimized". See what I've done 
recently in e.g. FindBZip2.cmake.

I would put the backends in the COMPONENTS section, as well as the widestring, 
so you could do something like this:

find_package(Pantheios COMPONENTS SomeBackend WideString)

Choose one backend as default for the case the user does not select any and 
raise an error if more than one is specified (unless that actually makes sense, 
dunno).

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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

[CMake] Set C compiler flags but not linker flags

2012-07-12 Thread Roland Schulz
Hi,

if I set compiler flags using CMAKE_C_FLAGS these flags are also added
to the linker flags for C executables and libraries. How can I set
compiler flags without those same flags also appended to the linker
flags?

In this specific case I would like to add "-fopenmp" to the compiler
but do not want this flag to be added to the linker because I want the
openmp library to be linked statically.  For GCC this can be done with
"-Wl,-static -lgomp -lrt -Wl,-Bdynamic -lpthread" but only works if
"-fopenmp" is not also given as a linker flag. Thus it is important
that "-fopenmp" which is needed as compile time option is not appended
to the linker flags.

This is with GCC on Linux with "Unix Makesfiles" and cmake 2.8.8.

Roland
-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
--

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] Writing a custom Find*.cmake file for Pantheios

2012-07-12 Thread Philipp Berger
Hello everybody,

I'm relatively new to CMake, but managed to learn everything I needed,
up until now.
For a software project in C++ we want to use Pantheios (
http://www.pantheios.org  ) as logging framework.
Sadly, there is no FindPantheios.cmake file readily available, so I set
of to write my own.

The part for searching the include files/path was easy.

The big problem I am facing and find myself unable to solve is the wide
variety of library files.
The amount of available lib files is huge, see the attached file for the
list.

For example, the core libs:
pantheios.1.core.vc10.x64.dll.debug.lib
pantheios.1.core.vc10.x64.dll.lib
pantheios.1.core.vc10.x64.mt.debug.lib
pantheios.1.core.vc10.x64.mt.lib
pantheios.1.core.vc10.x64.widestring.dll.debug.lib
pantheios.1.core.vc10.x64.widestring.dll.lib
pantheios.1.core.vc10.x64.widestring.mt.debug.lib
pantheios.1.core.vc10.x64.widestring.mt.lib

I would like to have a checkbox to select Widestring capability yes/no.

A main problem for me is to check that the selected libs are valid for
the current configuration (if VC10 x64 was selected as compiler, only
allow vc10.x64 libs) - is there a way to securely achieve that? Or
should I rather let the user select arbitrary lib files and hope that
they will work?

What I need is six fields for the user to select lib files - the core
lib, one frontend and a backend. And that for both Debug and Release. It
would be much more useful if the user could select from a dropdown menu
which Front-/Backend he would like together with the Widestring checkbox
and the CMake file would assign the required Debug and Release libs to
the variables, but as sated above, I do not know how to produce the
required version string and how to create such mechanisms in CMake in
general.

Please excuse my noobishnes, I would really like to make this work and
contribute the FindPantheios.cmake file to the community - if I manage
to create a working one :)

Yours faithfully,
Philipp Berger
pantheios.1.appl.vc10.x64.dll.debug.lib
pantheios.1.appl.vc10.x64.dll.lib
pantheios.1.appl.vc10.x64.mt.debug.lib
pantheios.1.appl.vc10.x64.mt.lib
pantheios.1.appl.vc10.x64.widestring.dll.debug.lib
pantheios.1.appl.vc10.x64.widestring.dll.lib
pantheios.1.appl.vc10.x64.widestring.mt.debug.lib
pantheios.1.appl.vc10.x64.widestring.mt.lib
pantheios.1.be.COMErrorObject.vc10.x64.dll.debug.lib
pantheios.1.be.COMErrorObject.vc10.x64.dll.lib
pantheios.1.be.COMErrorObject.vc10.x64.mt.debug.lib
pantheios.1.be.COMErrorObject.vc10.x64.mt.lib
pantheios.1.be.COMErrorObject.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.COMErrorObject.vc10.x64.widestring.dll.lib
pantheios.1.be.COMErrorObject.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.COMErrorObject.vc10.x64.widestring.mt.lib
pantheios.1.be.fail.vc10.x64.dll.debug.lib
pantheios.1.be.fail.vc10.x64.dll.lib
pantheios.1.be.fail.vc10.x64.mt.debug.lib
pantheios.1.be.fail.vc10.x64.mt.lib
pantheios.1.be.fail.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.fail.vc10.x64.widestring.dll.lib
pantheios.1.be.fail.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.fail.vc10.x64.widestring.mt.lib
pantheios.1.be.file.vc10.x64.dll.debug.lib
pantheios.1.be.file.vc10.x64.dll.lib
pantheios.1.be.file.vc10.x64.mt.debug.lib
pantheios.1.be.file.vc10.x64.mt.lib
pantheios.1.be.file.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.file.vc10.x64.widestring.dll.lib
pantheios.1.be.file.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.file.vc10.x64.widestring.mt.lib
pantheios.1.be.fprintf.vc10.x64.dll.debug.lib
pantheios.1.be.fprintf.vc10.x64.dll.lib
pantheios.1.be.fprintf.vc10.x64.mt.debug.lib
pantheios.1.be.fprintf.vc10.x64.mt.lib
pantheios.1.be.fprintf.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.fprintf.vc10.x64.widestring.dll.lib
pantheios.1.be.fprintf.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.fprintf.vc10.x64.widestring.mt.lib
pantheios.1.be.lrsplit.vc10.x64.dll.debug.lib
pantheios.1.be.lrsplit.vc10.x64.dll.lib
pantheios.1.be.lrsplit.vc10.x64.mt.debug.lib
pantheios.1.be.lrsplit.vc10.x64.mt.lib
pantheios.1.be.lrsplit.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.lrsplit.vc10.x64.widestring.dll.lib
pantheios.1.be.lrsplit.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.lrsplit.vc10.x64.widestring.mt.lib
pantheios.1.be.N.vc10.x64.dll.debug.lib
pantheios.1.be.N.vc10.x64.dll.lib
pantheios.1.be.N.vc10.x64.mt.debug.lib
pantheios.1.be.N.vc10.x64.mt.lib
pantheios.1.be.N.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.N.vc10.x64.widestring.dll.lib
pantheios.1.be.N.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.N.vc10.x64.widestring.mt.lib
pantheios.1.be.null.vc10.x64.dll.debug.lib
pantheios.1.be.null.vc10.x64.dll.lib
pantheios.1.be.null.vc10.x64.mt.debug.lib
pantheios.1.be.null.vc10.x64.mt.lib
pantheios.1.be.null.vc10.x64.widestring.dll.debug.lib
pantheios.1.be.null.vc10.x64.widestring.dll.lib
pantheios.1.be.null.vc10.x64.widestring.mt.debug.lib
pantheios.1.be.null.vc10.x64.widestring.mt.lib
pantheios.1.be.speech.vc10.x64.

Re: [CMake] add additional lib

2012-07-12 Thread Yixun Liu
I use VTK5.8 enabling Qt.
The missing lib is QVTK.

Thanks.

On Thu, Jul 12, 2012 at 3:51 PM, Bill Lorensen wrote:

> Which lib is missing. There should be no VTK-related libs missing. What
> version of VTK are you using?
>
>  On Thu, Jul 12, 2012 at 12:30 PM, Yixun Liu  wrote:
>
>>  Hi,
>> I am using
>> # Find VTK
>> FIND_PACKAGE(VTK REQUIRED)
>> IF(VTK_FOUND)
>>   INCLUDE(${VTK_USE_FILE})
>> ENDIF(VTK_FOUND)
>>
>> VTK_LIBRARIES does not include one lib.
>>
>> TARGET_LINK_LIBRARIES(ProjecctName  ${VTK_LIBRARIES}
>>
>> How to add this lib into the variable VTK_LIBRARIES  or
>> TARGET_LINK_LIBRARIES?
>>
>> Thank you.
>>
>> Yixun
>>
>> --
>>
>> 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
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot 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] Xcode without 'command line tools' & xcrun & CMake

2012-07-12 Thread David Cole
On Thu, Jul 12, 2012 at 4:55 PM, Sean McBride wrote:

> Hi all,
>
> Nowadays, Xcode is distributed as a standalone .app instead of an
> installer that copies files all over the place.  As a consequence of this,
> nothing gets installed at /usr/bin/make, /usr/bin/cc, etc.
>
> Optionally, one can install a separate 'command line tools' package that
> places things at those venerable locations.  Without installing that, one
> can still find and use 'make' and other tools using 'xcrun' (see 'man
> xcrun').  ex:
>
> $ xcrun make --version
> GNU Make 3.81
>
> $ xcrun -find make
> /Applications/Xcode.app/Contents/Developer/usr/bin/make
>
> Without the 'command line tools' installed, CMake seems unable to get far:
>
> Error(s) when configuring the project
> CMake Error: CMake was unable to find a build program corresponding to
> "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
> select a different build tool.
>
> It would be nice if CMake would invoke 'xcrun -find' to find the paths to
> the tools it needs.  Or can it already, and I'm missing something?
>
> Thanks,
>
> --
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
>
>
> --
>
> 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
>


Good idea, but no, this is not implemented yet. We did not know about
"xcrun" yet. Thanks for the info.

For now, install the command line tools.

And, of course, patches are welcome. :-)
--

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 for windows on Darwin with nighlty build fails

2012-07-12 Thread Claus Klein

I found a way, but now the CMAKE_EXECUTABLE_SUFFIX is not empty?

/opt/local/bin/cmake -G "Unix Makefiles" \
-DCMAKE_C_COMPILER=/opt/local/bin/i386-mingw32-gcc - 
DCMAKE_CXX_COMPILER=/opt/local/bin/i386-mingw32-g++ \

-DCMAKE_SYSTEM_NAME=Windows-GNU -DCMAKE_INSTALL_PREFIX="C:/usr" \
--check-system-vars \
-DCMAKE_RC_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-windres \
..

claus-kleins-macbook-pro:build clausklein$ ls -lrta lib/* bin/*
-rw-r--r-- 1 clausklein staff  28606 Jul 12 22:59 lib/libftpcpp.a
-rwxr-xr-x 1 clausklein staff 280615 Jul 12 22:59 bin/ftpList
-rwxr-xr-x 1 clausklein staff 279929 Jul 12 22:59 bin/ftpGet
-rwxr-xr-x 1 clausklein staff 279242 Jul 12 22:59 bin/ftpPut
claus-kleins-macbook-pro:build clausklein$ !gre
grep -w FILEPATH CMakeCache.txt
CMAKE_AR:FILEPATH=/opt/local/bin/i386-mingw32-ar
CMAKE_CXX_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-g++
CMAKE_C_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-gcc
CMAKE_INSTALL_NAME_TOOL:FILEPATH=/opt/local/bin/install_name_tool
CMAKE_LINKER:FILEPATH=/opt/local/bin/i386-mingw32-ld
CMAKE_MAKE_PROGRAM:FILEPATH=/opt/local/bin/gmake
CMAKE_NM:FILEPATH=/opt/local/bin/i386-mingw32-nm
CMAKE_OBJCOPY:FILEPATH=/opt/local/bin/i386-mingw32-objcopy
CMAKE_OBJDUMP:FILEPATH=/opt/local/bin/i386-mingw32-objdump
CMAKE_RANLIB:FILEPATH=/opt/local/bin/i386-mingw32-ranlib
CMAKE_RC_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-windres
CMAKE_STRIP:FILEPATH=/opt/local/bin/i386-mingw32-strip
claus-kleins-macbook-pro:build clausklein$

On 12.07.2012, at 22:23, Claus Klein wrote:


The ranlib and ar from build host is used.

Any idea what I should try or do would help?


--

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] Xcode without 'command line tools' & xcrun & CMake

2012-07-12 Thread Sean McBride
Hi all,

Nowadays, Xcode is distributed as a standalone .app instead of an installer 
that copies files all over the place.  As a consequence of this, nothing gets 
installed at /usr/bin/make, /usr/bin/cc, etc.

Optionally, one can install a separate 'command line tools' package that places 
things at those venerable locations.  Without installing that, one can still 
find and use 'make' and other tools using 'xcrun' (see 'man xcrun').  ex:

$ xcrun make --version
GNU Make 3.81

$ xcrun -find make
/Applications/Xcode.app/Contents/Developer/usr/bin/make

Without the 'command line tools' installed, CMake seems unable to get far:

Error(s) when configuring the project
CMake Error: CMake was unable to find a build program corresponding to "Unix 
Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a 
different build tool.

It would be nice if CMake would invoke 'xcrun -find' to find the paths to the 
tools it needs.  Or can it already, and I'm missing something?

Thanks,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

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] Two toolchains simultaneously within the same project?

2012-07-12 Thread Ingolf Steinbach
Hi,

is it possible to use two different toolchains within the same
project? This is what I want to achieve:

Most of the project uses a cross-compilation toolchain, so I'd call
cmake with the appropriate CMAKE_TOOLCHAIN_FILE settings for the cross
compiler.

There is however one subdirectory which contains tools to be used on
the host machine. I'd like to keep this subdirectory within the
project (as these tools directly belong to the project) but would like
cmake to use the native compiler instead -- ideally without having to
explicitly call cmake again in that subdirectory.

Kind regards
Ingolf
--

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] Cross-compilation for windows on Darwin with nighlty build fails

2012-07-12 Thread Claus Klein
I tried with the current nightly cmake binary to cross compile with  
mingw tools on Darwin.


But it fails and I have no right idea what goes wrong.

First, the rc compile was not found:

+ cmake -G 'Unix Makefiles' -DCMAKE_C_COMPILER=i386-mingw32-gcc - 
DCMAKE_CXX_COMPILER=i386-mingw32-g++ -DCMAKE_SYSTEM_NAME=Windows-GNU - 
DCMAKE_INSTALL_PREFIX=C:/usr --check-system-vars ..
Also check system files when warning about unused and uninitialized  
variables.

-- The C compiler identification is GNU 3.4.5
-- The CXX compiler identification is GNU 3.4.5
CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not  
found.   Please set CMAKE_RC_COMPILER to a valid compiler path or name.

-- Check for working C compiler: /opt/local/bin/i386-mingw32-gcc
CMake Error at /usr/local/share/cmake-2.8/Modules/ 
CMakeRCInformation.cmake:22 (GET_FILENAME_COMPONENT):

  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  /usr/local/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:60  
(enable_language)
  /usr/local/share/cmake-2.8/Modules/ 
CMakeSystemSpecificInformation.cmake:36 (INCLUDE)

  CMakeLists.txt:2 (PROJECT)


CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: /opt/local/bin/i386-mingw32-gcc --  
broken
CMake Error at /usr/local/share/cmake-2.8/Modules/ 
CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "/opt/local/bin/i386-mingw32-gcc" is not able to  
compile a

  simple test program.

---

Than I defined it and the host binutils are used:

+ cmake -G 'Unix Makefiles' -DCMAKE_C_COMPILER=i386-mingw32-gcc - 
DCMAKE_CXX_COMPILER=i386-mingw32-g++ -DCMAKE_SYSTEM_NAME=Windows-GNU - 
DCMAKE_INSTALL_PREFIX=C:/usr -DCMAKE_RC_COMPILER=i386-mingw32-windres  
--check-system-vars ..
Also check system files when warning about unused and uninitialized  
variables.

-- The C compiler identification is GNU 3.4.5
-- The CXX compiler identification is GNU 3.4.5
-- Check for working C compiler: /opt/local/bin/i386-mingw32-gcc
-- Check for working C compiler: /opt/local/bin/i386-mingw32-gcc --  
works

-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++ --  
works

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
MINGW
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_RC_COMPILER= i386-mingw32-windres

-- The C compiler identification is GNU 3.4.5
-- The CXX compiler identification is GNU 3.4.5
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - no
-- Check for working C compiler: /opt/local/bin/i386-mingw32-gcc
-- Check for working C compiler: /opt/local/bin/i386-mingw32-gcc --  
works

-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag -  
no

-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++ --  
works

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
MINGW
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clausklein/Workspace/cpp/ 
ftplibpp-2.0.2/build

+ exit
claus-kleins-macbook-pro:build clausklein$ !gre
grep -w FILEPATH CMakeCache.txt
CMAKE_AR:FILEPATH=/opt/local/bin/ar
CMAKE_CXX_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-g++
CMAKE_C_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-gcc
CMAKE_INSTALL_NAME_TOOL:FILEPATH=/opt/local/bin/install_name_tool
CMAKE_LINKER:FILEPATH=/opt/local/bin/ld
CMAKE_MAKE_PROGRAM:FILEPATH=/opt/local/bin/gmake
CMAKE_NM:FILEPATH=/opt/local/bin/nm
CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND
CMAKE_OBJDUMP:FILEPATH=CMAKE_OBJDUMP-NOTFOUND
CMAKE_RANLIB:FILEPATH=/opt/local/bin/ranlib
CMAKE_RC_COMPILER:FILEPATH=i386-mingw32-windres
CMAKE_STRIP:FILEPATH=/opt/local/bin/strip
CMAKE_XCODE_SELECT:FILEPATH=/usr/bin/xcode-select
claus-kleins-macbook-pro:build clausklein$

--

A a third try I defined all binutils too:


cmake -G "Unix Makefiles" \
-DCMAKE_C_COMPILER=i386-mingw32-gcc -DCMAKE_CXX_COMPILER=i386- 
mingw32-g++ \

-DCMAKE_SYSTEM_NAME=Windows-GNU -DCMAKE_INSTALL_PREFIX="C:/usr" \
--check-system-vars \

Re: [CMake] add additional lib

2012-07-12 Thread Bill Lorensen
Which lib is missing. There should be no VTK-related libs missing. What
version of VTK are you using?

On Thu, Jul 12, 2012 at 12:30 PM, Yixun Liu  wrote:

> Hi,
> I am using
> # Find VTK
> FIND_PACKAGE(VTK REQUIRED)
> IF(VTK_FOUND)
>   INCLUDE(${VTK_USE_FILE})
> ENDIF(VTK_FOUND)
>
> VTK_LIBRARIES does not include one lib.
>
> TARGET_LINK_LIBRARIES(ProjecctName  ${VTK_LIBRARIES}
>
> How to add this lib into the variable VTK_LIBRARIES  or
> TARGET_LINK_LIBRARIES?
>
> Thank you.
>
> Yixun
>
> --
>
> 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
>



-- 
Unpaid intern in BillsBasement at noware dot 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] add additional lib

2012-07-12 Thread John Drescher
On Thu, Jul 12, 2012 at 2:31 PM, Mateusz Loskot  wrote:
> On 12 July 2012 18:44, Yixun Liu  wrote:
>> BTW, do you know how to set CMakeList to make it produce a window-based
>> application rather than a console-based application?
>
http://www.cmake.org/pipermail/cmake/2008-March/020577.html

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


Re: [CMake] add additional lib

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 18:44, Yixun Liu  wrote:
> BTW, do you know how to set CMakeList to make it produce a window-based
> application rather than a console-based application?

I'm sorry, but I'm not sure what you mean.
You asked about adding extra libs to linker.
I neither have idea how it's relevant to console vs window-based app,
or what you mean as "make it produce".

p.s. Please, be careful when you reply to post to cmake list,
but not to my address exclusively.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
--

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] find dynamic libs

2012-07-12 Thread Andreas Pakulat
Hi,

On Thu, Jul 12, 2012 at 6:12 PM, Yixun Liu  wrote:

> Hi,
> I am using FIND_PACKAGE(Qt4 REQUIRED) in the CMakeLists to find Qt libs.
> QT_LIBRARIES gives me QtGui, QtSql and QtCore, which are static libs.
>

How do you know that? Whats the actual content of the variable? Which
platform are you running on?


> How to force FIND_PACKAGE to find the dynamic libs: QtGui4, QtSql4 and
> QtCore4?
>

I think you're misinterpreting whats happening, QtCore is the name on *nix
platforms usually and QtCore4 is used only on Windows (and the name of the
frameworks on MacOSX). I doubt you have libraries with both names, one
being shared and one being static in the same directory and thats the only
way the wrong one would be preferred since FIND_LIBRARY only searches in
Qt's library-directory as reported by qmake.

Andreas
--

Powered by www.kitware.com

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

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

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

Re: [CMake] add additional lib

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 17:30, Yixun Liu  wrote:
> Hi,
> I am using
> # Find VTK
> FIND_PACKAGE(VTK REQUIRED)
> IF(VTK_FOUND)
>   INCLUDE(${VTK_USE_FILE})
> ENDIF(VTK_FOUND)
>
> VTK_LIBRARIES does not include one lib.
>
> TARGET_LINK_LIBRARIES(ProjecctName  ${VTK_LIBRARIES}
>
> How to add this lib into the variable VTK_LIBRARIES  or
> TARGET_LINK_LIBRARIES?

http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:target_link_libraries

 [item1 [item2 [...]]]

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

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

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

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


[CMake] add additional lib

2012-07-12 Thread Yixun Liu
Hi,
I am using
# Find VTK
FIND_PACKAGE(VTK REQUIRED)
IF(VTK_FOUND)
  INCLUDE(${VTK_USE_FILE})
ENDIF(VTK_FOUND)

VTK_LIBRARIES does not include one lib.

TARGET_LINK_LIBRARIES(ProjecctName  ${VTK_LIBRARIES}

How to add this lib into the variable VTK_LIBRARIES  or
TARGET_LINK_LIBRARIES?

Thank you.

Yixun
--

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] find dynamic libs

2012-07-12 Thread Yixun Liu
Hi,
I am using FIND_PACKAGE(Qt4 REQUIRED) in the CMakeLists to find Qt libs.
QT_LIBRARIES gives me QtGui, QtSql and QtCore, which are static libs.
How to force FIND_PACKAGE to find the dynamic libs: QtGui4, QtSql4 and
QtCore4?

Thank you in advance!

Yixun
--

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 14:24, Jean-Christophe Fillion-Robin
 wrote:
> I also think contributing this module back to CMake would be great.

+1

> This has been discuss on the list [1], few things need to be fixed and as
> discussed documentation updated.

Thanks for pointing that.

> The module could also probably be split into: FindGit.cmake and
> GitInfo.cmake (or similar name)

I agree, I just didn't want to make my request too bold.
The FindSubversion.cmake has also contributed to the general mess and
lack of unification across modules, so I assumed FindGit.cmake in current
shape would be accepted.

> First, we could improve the module within Slicer :) [2], then, when we are
> all happy with it, I believe the module could probably be contributed back
> to CMake [3].

Or, just improve it, submit to CMake and tell the Slicer folks here is
new version,
if you like, use it.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
--

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-12 Thread Jean-Christophe Fillion-Robin
Hi Folks,

I also think contributing this module back to CMake would be great.

This has been discuss on the list [1], few things need to be fixed and as
discussed documentation updated.

The module could also probably be split into: FindGit.cmake and
GitInfo.cmake (or similar name)

First, we could improve the module within Slicer :) [2], then, when we are
all happy with it, I believe the module could probably be contributed back
to CMake [3].

Hth
Jc

[1]
http://cmake.3232098.n2.nabble.com/Addition-to-FindGit-tp6441747p6446399.html
[2]
http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Developers/Tutorials/ContributePatch
[3] http://www.cmake.org/Wiki/CMake:Module_Maintainers

On Thu, Jul 12, 2012 at 6:52 AM, Mateusz Loskot  wrote:

> On 12 July 2012 07:52, Rolf Eike Beer  wrote:
> > Mateusz Loskot wrote:
> >> On 12 July 2012 00:24, Aashish Chaudhary 
> wrote:
> >> >
> >> > I don't have both files in front of me. Whats the difference between
> >> > the one in the slicer and once in the CMake?
> >>
> >> CMake's current version [1] defines:
> >>
> >>  #   GIT_EXECUTABLE - path to git command line client
> >> #   GIT_FOUND - true if the command line client was found
> >> #   GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
> >>
> >> Slicer's version [2] defines:
> >>
> >> # The module defines the following variables:
> >> #   GIT_EXECUTABLE - path to git command line client
> >> #   GIT_FOUND - true if the command line client was found
> >> #
> >> # If the command line client executable is found the macro
> >> #  GIT_WC_INFO( )
> >> # is defined to extract information of a git working copy at
> >> # a given location.
> >> #
> >> # The macro defines the following variables:
> >> #  _WC_REVISION_HASH - Current SHA1 hash
> >> #  _WC_REVISION - Current SHA1 hash
> >> #  _WC_REVISION_NAME - Name associated with
> >> _WC_REVISION_HASH
> >> #  _WC_URL - output of command `git config --get
> >> remote.origin.url' #  _WC_ROOT - Same value as working copy
> URL
> >> #  _WC_GITSVN - Set to false
> >> #
> >> # ... and also the following ones if it's a git-svn repository:
> >> #  _WC_GITSVN - Set to True if it is a
> >> #  _WC_INFO - output of command `git svn info'
> >> #  _WC_URL - url of the associated SVN repository
> >> #  _WC_ROOT - root url of the associated SVN repository
> >> #  _WC_REVISION - current SVN revision number
> >> #  _WC_LAST_CHANGED_AUTHOR - author of last commit
> >> #  _WC_LAST_CHANGED_DATE - date of last commit
> >> #  _WC_LAST_CHANGED_REV - revision of last commit
> >> #  _WC_LAST_CHANGED_LOG - last log of base revision
> >
> > I'm not against that change, but I find the documentation a bit
> misleading.
> > When reading it my first thought was that _WC_REVISION and _WC_GITSVN
> are junk,
> > just to learn later that they have different meaning when it's a git-svn
> repo.
>
> That's what documentation is for, to clarify unobvious.
>
> > Looking at the code I think that line 115 (which is: if(NOT
> > "${git_config_output}" STREQUAL "")) could be simplified to
> > "if(git_config_output)". The warning in line 144 looks suspicious to me,
> that
> > would e.g. trigger on a local only git repo, no? Maybe make this an
> > AUTHOR_WARNING?
>
> Let's assume it is a requirement specific to the Slicer project.
> I think, the warning could be simply removed.
>
> > And obviously the version extraction code is missing, but this should be
> > trivially fixable.
>
> What version you mean? Git program version?
> Or, the TODO comment in line 71 of the Slicer's FindGit.cmake?
>
> My main point is to get someone from CMake team to simply grab the
> Slicer's version
> and commit to CMake upstream. Can't see reasons why it couldn't be
> submitted really.
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> --
>
> 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
>



-- 
+1 919 869 8849
--

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] Double quotes being removed Windows removing compiler flags

2012-07-12 Thread Andreas Mohr
Hi,

On Thu, Jul 12, 2012 at 08:20:50AM +0200, François Best wrote:
> I was able to fix my problem by adding the replacement of "\\\"" (escaped
> quote) before the actual replacement of the non-escaped quote in the
> generator.
> 
> Here is the patch:
> 
> diff --git a/Source/cmVisualStudioGeneratorOptions.cxx
> b/Source/cmVisualStudioGeneratorOptions.cxx
> index 9369af6..5371d0f 100644
> --- a/Source/cmVisualStudioGeneratorOptions.cxx
> +++ b/Source/cmVisualStudioGeneratorOptions.cxx
> @@ -16,6 +16,7 @@ inline std::string
> cmVisualStudioGeneratorOptionsEscapeForXML(const char* s)
>  {
>std::string ret = s;
>cmSystemTools::ReplaceString(ret, "&", "&");
> +  cmSystemTools::ReplaceString(ret, "\\\"", """);
>cmSystemTools::ReplaceString(ret, "\"", """);
>cmSystemTools::ReplaceString(ret, "<", "<");
>cmSystemTools::ReplaceString(ret, ">", ">");

Perhaps a comment that order of replacements is crucial would be useful.



I'm a bit concerned about this mapping.
After all we're mapping *two* different symbols (\\\", \")
to one *identical* result only ("),
IOW we are producing "information loss",
i.e. a loss in expression variety, at this stage/layer of information
transmission
(relevance here: if someone else passed input of \\\",
expecting it to end up as a veritable "backslash", "quote" combination
- since he did *NOT* pass \" only -
then he'll be in for a rough awakening).

(probably see communication / encoding theory, sending information
over a series of various transmission channels,
and then obviously strongly attempting to end up with the same set
of fully qualified data payload at the sink side
as was put in at the source side).

So perhaps it's the prior layer which is broken
and thus should do things differently
(i.e., avoid passing a backslash-escaped unit despite only intending
for it to end up as quote-only, which the
cmVisualStudioGeneratorOptionsEscapeForXML() conversion handling
already accounted for but obviously did not match in this case!).


> Best,
> 
> François Best
> Hardware & Software Engineer

Better? :)

Andreas Mohr
--

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 07:52, Rolf Eike Beer  wrote:
> Mateusz Loskot wrote:
>> On 12 July 2012 00:24, Aashish Chaudhary  
>> wrote:
>> >
>> > I don't have both files in front of me. Whats the difference between
>> > the one in the slicer and once in the CMake?
>>
>> CMake's current version [1] defines:
>>
>>  #   GIT_EXECUTABLE - path to git command line client
>> #   GIT_FOUND - true if the command line client was found
>> #   GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
>>
>> Slicer's version [2] defines:
>>
>> # The module defines the following variables:
>> #   GIT_EXECUTABLE - path to git command line client
>> #   GIT_FOUND - true if the command line client was found
>> #
>> # If the command line client executable is found the macro
>> #  GIT_WC_INFO( )
>> # is defined to extract information of a git working copy at
>> # a given location.
>> #
>> # The macro defines the following variables:
>> #  _WC_REVISION_HASH - Current SHA1 hash
>> #  _WC_REVISION - Current SHA1 hash
>> #  _WC_REVISION_NAME - Name associated with
>> _WC_REVISION_HASH
>> #  _WC_URL - output of command `git config --get
>> remote.origin.url' #  _WC_ROOT - Same value as working copy URL
>> #  _WC_GITSVN - Set to false
>> #
>> # ... and also the following ones if it's a git-svn repository:
>> #  _WC_GITSVN - Set to True if it is a
>> #  _WC_INFO - output of command `git svn info'
>> #  _WC_URL - url of the associated SVN repository
>> #  _WC_ROOT - root url of the associated SVN repository
>> #  _WC_REVISION - current SVN revision number
>> #  _WC_LAST_CHANGED_AUTHOR - author of last commit
>> #  _WC_LAST_CHANGED_DATE - date of last commit
>> #  _WC_LAST_CHANGED_REV - revision of last commit
>> #  _WC_LAST_CHANGED_LOG - last log of base revision
>
> I'm not against that change, but I find the documentation a bit misleading.
> When reading it my first thought was that _WC_REVISION and _WC_GITSVN are 
> junk,
> just to learn later that they have different meaning when it's a git-svn repo.

That's what documentation is for, to clarify unobvious.

> Looking at the code I think that line 115 (which is: if(NOT
> "${git_config_output}" STREQUAL "")) could be simplified to
> "if(git_config_output)". The warning in line 144 looks suspicious to me, that
> would e.g. trigger on a local only git repo, no? Maybe make this an
> AUTHOR_WARNING?

Let's assume it is a requirement specific to the Slicer project.
I think, the warning could be simply removed.

> And obviously the version extraction code is missing, but this should be
> trivially fixable.

What version you mean? Git program version?
Or, the TODO comment in line 71 of the Slicer's FindGit.cmake?

My main point is to get someone from CMake team to simply grab the
Slicer's version
and commit to CMake upstream. Can't see reasons why it couldn't be
submitted really.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
--

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] An updated cross-platform FindGlew.cmake module

2012-07-12 Thread Benjamin Eikel
Hello Carlo,

Am Donnerstag, 12. Juli 2012, 09:18:10 schrieb Carlo Nicolini:
> Hi you all, I'm trying to find an updated, simple to use and effective
> FindGlew.cmake module, because I've to include and link Glew (
> http://glew.sourceforge.net/index.html ) in my project, which needs to be
> compiled on win32, linux and osx.
> 
> Can somebody help me?

I have a find module attached. It was written by me some time ago by using some 
information from the CMake wiki. I do not know if it complies with any CMake 
standards, but it works for me. It is used on GNU/Linux, Windows and OS X in 
our project.

Kind regards
Benjamin
# Try to find GLEW. Once done, this will define:
#
#   GLEW_FOUND - variable which returns the result of the search
#   GLEW_INCLUDE_DIRS - list of include directories
#   GLEW_LIBRARIES - options for the linker

find_package(PkgConfig)
pkg_check_modules(PC_GLEW QUIET glew)

find_path(GLEW_INCLUDE_DIR
	GL/glew.h
	HINTS ${PC_GLEW_INCLUDEDIR} ${PC_GLEW_INCLUDE_DIRS}
)
find_library(GLEW_LIBRARY
	GLEW
	HINTS ${PC_GLEW_LIBDIR} ${PC_GLEW_LIBRARY_DIRS}
)

set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
set(GLEW_LIBRARIES ${GLEW_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLEW DEFAULT_MSG
	GLEW_INCLUDE_DIR
	GLEW_LIBRARY
)

mark_as_advanced(
	GLEW_INCLUDE_DIR
	GLEW_LIBRARY
)
--

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] An updated cross-platform FindGlew.cmake module

2012-07-12 Thread Carlo Nicolini
Hi you all, I'm trying to find an updated, simple to use and effective
FindGlew.cmake module, because I've to include and link Glew (
http://glew.sourceforge.net/index.html ) in my project, which needs to be
compiled on win32, linux and osx.

Can somebody help me?
--

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