Re: [CMake] linker associated to ifort fortran compiler

2010-09-29 Thread Arjen Markus

Hello Eric,

On 2010-09-29 17:51, pellegrini wrote:

Hello everybody,

I would like to compile my project using intel fortran compiler on my 
windows machine.


When running the following commands:

cmake -DCMAKE_Fortran_Compiler=ifort -G"NMake Makefiles"
nmake VERBOSE=1

I can see that nmake use the linker 'lib' provided with the intel 
fortran compiler.


But, looking at my generated CMakeCache.txt I see just at the beginning:

CMAKE_AR:FILEPATH=C:/MinGW/bin/ar.exe (I have the Mingw tools installed 
on my machine


Two questions:
   - why cmake uses the 'lib' linker if another one was set in the 
CMakeCache.txt file ?


The compiler is but one of a set of related tools (the toolchain as
it is sometimes called). Choosing one means choosing all these others
as well.

CMAKE_AR is simply a variable that is used for other sets of tools.
The modules that come with CMake contain the information about what
tools to use and where to find them. There is no magic involved -
just hard labour.

If you leave the choice of the compiler to CMake, then - in my
experience - it is the generator you specify that determines
what compilers are tried first.

Regards,

Arjen


DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.




___
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 specify -fpic ?

2010-09-29 Thread Michael Wild

On 29. Sep, 2010, at 18:25 , David Aldrich wrote:

> Hi
> 
> My C++ code consists of an executable and several shared libraries.
> 
> With my CMake build files, I find that the executable fails to load the 
> shared libraries ( the dlopen() call results in error 'undefined symbol...' ).
> 
> The software works fine under our production build system that uses manually 
> coded makefiles.
> 
> I notice that the production system linker command invokes -fpic, while CMake 
> uses -fPIC. I am wondering if that is the reason.
> 
> I set the compile flags with:
> 
> set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wall -m64" )
> 
> How can I replace -fPIC with -fpic in CMake please?
> 
> Best regards
> David


The only difference between -fpic and -fPIC is that the latter has no limit on 
the size of the global offsets table and this is only relevant for the m68k, 
PowerPC and SPARC architectures (according to the GCC manual page). So I really 
doubt this is the problem. Are you using -fvisibility=hidden somewhere?

Michael

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



PGP.sig
Description: This is a digitally signed message part
___
Powered by www.kitware.com

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

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

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

Re: [CMake] Re-configuration, ExternalProjects, etc.

2010-09-29 Thread Michael Wild

On 29. Sep, 2010, at 20:09 , Clifford Yapp wrote:

> After working for a while at converting a project to CMake, I would
> like to ask a question/suggest a feature for CMake.
> 
> The project I am working on (BRL-CAD) includes various external
> libraries that it relies on on a subdirectory, with a variety of
> options for enabling and disabling use of the local and system copies.
> One of my biggest challenges when expressing our build logic in CMake
> was supporting the ability to "turn on" and "turn off" these third
> party builds cleanly and robustly.  I have (more or less) managed to
> get this working with macros (although I have yet to set it up for
> MSVC - gulp), but I have a few quirks I'd like to ask for opinions on:
> 
> 1. CMake has an extremely annoying habit of looking for libraries in
> the CMAKE_INSTALL_PREFIX directory after it is defined and picking up
> old versions of libraries from previous make install results in those
> directories.  In order to get it not to do this I literally had to
> force CMAKE_INSTALL_PREFIX to be empty in the Cache file, which
> doesn't feel right.  I'd MUCH rather set some option that tells CMake
> to not look for anything in the CMAKE_INSTALL_PREFIX directory (which
> for BRL-CAD is often different from system paths) with any of it's
> Find* commands. If this is supported I have yet to spot the option -
> can anyone enlighten me?  Am I making some obvious mistake?  It seems
> like a problem people would have had to solve before this, but maybe
> I'm doing something wrong.

I too would like an answer to that question. Also, it seems to be undocumented 
behavior. Of course, you could use NO_DEFAULT_PATH or some such (would be 
interesting to see which of the NO_* options turns this off), but that is 
rather kludgy...

> 
> 2.  Because ExternalProject_Add does a full build and install prior to
> building other targets (which I think is fine) I sometimes put myself
> in the annoying position of building the whole system, then realizing
> I forgot to clean an old build out of the install directory prior to
> performing the build.  Then I do the classic rm -rf to clear it, only
> to realize I just wiped out all of my ExternalProject install results.
> This wouldn't be a problem, except I can't find a way to get the
> build logic to check that the external projects are installed when
> make install is run and re-do the install if necessary - they think
> they're done because all steps were completed.  Admittedly this is a
> minor annoyance, but if there is a way to avoid having to re-do  the
> whole thing because I messed up clearing out the install directory
> ahead of time I would be grateful :-)

Don't install external projects directly into CMAKE_INSTALL_PREFIX, that's a 
recipe for disaster (after all, someone might want to use DESTDIR when doing a 
"make install"!) Instead install somewhere inside CMAKE_BINARY_DIR and then use 
the standard CMake facilities to install exactly what your project requires to 
run into CMAKE_INSTALL_PREFIX, e.g. using the BundleUtilities. In my project I 
have a some macros and functions which handle all of this for me, see here: 
http://freefoam.git.sourceforge.net/git/gitweb.cgi?p=freefoam/freefoam;f=CMake/FOAMThirdPartyUtilities.cmake;hb=pu
 (start with the foam_thirdparty_option function).

> 
> 3.  I'm in the process of writing CMake macros to replace things like
> AC_HEADER_STDC, AC_HEADER_DIRENT, etc. - is there already a macro
> package that defines CMAKE_HEADER_STDC and friends to replace these
> common autoconf macros?

No. Using AC_HEADER_STDC is no longer required, there is virtually no 
system/compiler which doesn't fulfill that one (the Autoconf manual says "This 
macro is obsolescent, as current systems have conforming header files. New 
programs need not use this macro.") The same goes for AC_HEADER_DIRENT. Most of 
these standard macros can be safely skipped...

I hope this helps a bit.

Michael

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



PGP.sig
Description: This is a digitally signed message part
___
Powered by www.kitware.com

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

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

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

Re: [CMake] How to specify -fpic ?

2010-09-29 Thread Michael Hertling
On 09/29/2010 06:25 PM, David Aldrich wrote:
> Hi
> 
> My C++ code consists of an executable and several shared libraries.
> 
> With my CMake build files, I find that the executable fails to load the 
> shared libraries ( the dlopen() call results in error 'undefined symbol...' ).
> 
> The software works fine under our production build system that uses manually 
> coded makefiles.
> 
> I notice that the production system linker command invokes -fpic, while CMake 
> uses -fPIC. I am wondering if that is the reason.
> 
> I set the compile flags with:
> 
> set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wall -m64" )
> 
> How can I replace -fPIC with -fpic in CMake please?

STRING(REGEX REPLACE "-fPIC" "-fpic" CMAKE_SHARED_LIBRARY_CXX_FLAGS
${CMAKE_SHARED_LIBRARY_CXX_FLAGS})

Is this option the only difference of the link commands? Do the compile
commands differ, too? Are there any options in the compile commands
which should also be present in the link commands but are missing?

Regards,

Michael
___
Powered by www.kitware.com

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

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

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


[CMake] CMakeDetermineVSServicePack.cmake support for vs2010

2010-09-29 Thread aaron.meadows
Hi all.  I noticed that CMakeDetermineVSServicePack.cmake only supports
vs2005, vs2005 sp1, vs2008, vs2008 sp1.  I wanted to use it for vs2010.

 

I looked for a bug but the only one I found was the one that resulted in
the scripts creation: http://public.kitware.com/Bug/view.php?id=8803

 

I have a patch to fix it: (also attached)

 

*** CMakeDetermineVSServicePack.cmake   2010-06-28 09:42:36.0
-0500

--- CMakeDetermineVSServicePackWith2010.cmake   2010-09-29
20:26:20.530212900 -0500

***

*** 47,52 

--- 47,54 

 set(_version "vc90")

 elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")

 set(_version "vc90sp1")

+elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")

+set(_version "vc100")

 else()

 set(_version "")

 endif()

 

Should I open a new bug for this and add a patch to it, or reopen the
old bug (feature request) with this patch?

 

Thanks!

 

--aaron

 

Aaron Meadows
Software Engineer

Thomson Reuters

Phone: 314.468.3530
Mobile: 636.541.6139
aaron.mead...@thomsonreuters.com
thomsonreuters.com

 



This email was sent to you by Thomson Reuters, the global news and information 
company.
Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Thomson Reuters.



CMakeDetermineVSServicePack.cmake.patch
Description: CMakeDetermineVSServicePack.cmake.patch
___
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] embedding lib into a shared object

2010-09-29 Thread Michael Hertling
On 09/29/2010 12:26 PM, Ovanes Markarian wrote:
> Hello *,
> 
> I have some library available as a Linux lib file. Now I need to create a
> shared object (actually a MODULE in terms of CMake) out of this lib. The
> module is later on loaded using the dlopen-API function.
> 
> I created a sample project with
> 
> /
> +-- testlib
> +-- so
> 
> 
> testlib - consists of a single cpp file haveing a global variable and a
> function returning it.
> 
> CMake script:
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> 
> PROJECT(testlib CXX)
> 
> add_library(testlib STATIC functions.cpp)
> 
> 
> so - consists of a cpp file and links against testlib.
> 
> CMake script:
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> 
> PROJECT(so CXX)
> 
> add_library(so MODULE main.cpp)
> target_link_libraries(so testlib)
> set_target_properties (so PROPERTIES VERSION 1.0 LINKER_LANGUAGE CXX)
> 
> and the Root CMakeLists.txt which should build both:
> 
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> 
> PROJECT(dll_test CXX)
> 
> add_subdirectory(lib)
> add_subdirectory(so)
> add_dependencies(so lib)
> 
> 
> Now my problem is that after the build I can find the symbols from
> functions.cpp in the lib file using the nm tool. But these symbols are not
> part of the so. How can I force them to be part of the so-Module?

man ld:

[...]
--whole-archive
For each archive mentioned on the command line after the --whole-
archive option, include every object file in the archive in the
link, rather than searching the archive for the required object
files. This is normally used to turn an archive file into a
shared library, forcing every object to be included in the
resulting shared library. This option may be used more than once.

Two notes when using this option from gcc: First, gcc doesn’t know
about this option, so you have to use -Wl,-whole-archive. Second,
don’t forget to use -Wl,-no-whole-archive after your list of
archives, because gcc will add its own list of archives to your
link and you may not want this flag to affect those as well.
[...]

E.g., you can use the LINK_FLAGS target property to enable this option,
and don't forget -fPIC and 'extern "C"' for functions.cpp's dlopening.

Besides, the ADD_DEPENDENCIES() is not necessary because of the
TARGET_LINK_LIBRARIES(), and wouldn't it be worth considering to
compile the dl-suitable module from the static library's sources?

Regards,

Michael
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Visual Studio 2010 generator and custom command

2010-09-29 Thread Bill Hoffman

On 9/29/2010 11:02 AM, elizabeta petreska wrote:

This is the link to bug report http://www.paraview.org/Bug/view.php?id=11274



OK, I have fixed the issue in CMake next.

To get around the problem you can use MAIN_DEPENDENCY like this:

ADD_CUSTOM_COMMAND(
 OUTPUT "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
 COMMAND ${CMAKE_COMMAND} -E copy
  "${PROJECT_SOURCE_DIR}/myfile.txt"
  "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
 DEPENDS "${PROJECT_SOURCE_DIR}/myfile.txt"
 MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/myfile.txt"
 )

-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] CMake, JOM and multiple top-level targets

2010-09-29 Thread Bill Hoffman

On 9/24/2010 1:03 PM, Óscar Fuentes wrote:

JOM does a nice work compiling multiple files of the same top-level
product (.exe, .dll etc) but for some reason it doesn't build multiple
top-level targets in parallel. Here I have a project that generates
several independent dlls, each based on one or two source files. JOM
wont build DLL_N+1 until DLL_N is finished. This means that only one cpu
core is working for a long part of the build.

Is this a limitation of JOM or an oversight of CMake?



This is a job limitation.

-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


[CMake] Re-configuration, ExternalProjects, etc.

2010-09-29 Thread Clifford Yapp
After working for a while at converting a project to CMake, I would
like to ask a question/suggest a feature for CMake.

The project I am working on (BRL-CAD) includes various external
libraries that it relies on on a subdirectory, with a variety of
options for enabling and disabling use of the local and system copies.
 One of my biggest challenges when expressing our build logic in CMake
was supporting the ability to "turn on" and "turn off" these third
party builds cleanly and robustly.  I have (more or less) managed to
get this working with macros (although I have yet to set it up for
MSVC - gulp), but I have a few quirks I'd like to ask for opinions on:

1. CMake has an extremely annoying habit of looking for libraries in
the CMAKE_INSTALL_PREFIX directory after it is defined and picking up
old versions of libraries from previous make install results in those
directories.  In order to get it not to do this I literally had to
force CMAKE_INSTALL_PREFIX to be empty in the Cache file, which
doesn't feel right.  I'd MUCH rather set some option that tells CMake
to not look for anything in the CMAKE_INSTALL_PREFIX directory (which
for BRL-CAD is often different from system paths) with any of it's
Find* commands. If this is supported I have yet to spot the option -
can anyone enlighten me?  Am I making some obvious mistake?  It seems
like a problem people would have had to solve before this, but maybe
I'm doing something wrong.

2.  Because ExternalProject_Add does a full build and install prior to
building other targets (which I think is fine) I sometimes put myself
in the annoying position of building the whole system, then realizing
I forgot to clean an old build out of the install directory prior to
performing the build.  Then I do the classic rm -rf to clear it, only
to realize I just wiped out all of my ExternalProject install results.
 This wouldn't be a problem, except I can't find a way to get the
build logic to check that the external projects are installed when
make install is run and re-do the install if necessary - they think
they're done because all steps were completed.  Admittedly this is a
minor annoyance, but if there is a way to avoid having to re-do  the
whole thing because I messed up clearing out the install directory
ahead of time I would be grateful :-)

3.  I'm in the process of writing CMake macros to replace things like
AC_HEADER_STDC, AC_HEADER_DIRENT, etc. - is there already a macro
package that defines CMAKE_HEADER_STDC and friends to replace these
common autoconf macros?

Cheers,
CY
___
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 specify -fpic ?

2010-09-29 Thread David Aldrich
Hi

My C++ code consists of an executable and several shared libraries.

With my CMake build files, I find that the executable fails to load the shared 
libraries ( the dlopen() call results in error 'undefined symbol...' ).

The software works fine under our production build system that uses manually 
coded makefiles.

I notice that the production system linker command invokes -fpic, while CMake 
uses -fPIC. I am wondering if that is the reason.

I set the compile flags with:

set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wall -m64" )

How can I replace -fPIC with -fpic in CMake please?

Best regards
David



___
Powered by www.kitware.com

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

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

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

[CMake] Overriding intel default compiler flags

2010-09-29 Thread pellegrini

Hello everybody,

I come back with a question I asked yesterday but that I surely 
misformulated. In the meantime I turned around

the problem all the day but still without any results ...

I would like to build my project using ifort fortran compiler with a set 
of compiler flags different from the
ones set by default by cmake in the "Windows-ifort.cmake" file of the 
distribution.


I was advised on the list to not introduce any specific compiler flags 
declaration in my CMakeLists.txt and to
introduce in my Src directory a Compiler/Intel-Fortran.cmake file 
storing the following compiler flags I would like to be

the default ones:

   SET(CMAKE_BUILD_TYPE_INIT Release)
   SET(CMAKE_Fortran_FLAGS_INIT "")
   SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback 
/nologo")

   SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0")
   SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0")
   SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback 
/debug:full")


Now my CMakeLists.txt file starts with:

cmake_minimum_required(VERSION 2.6.2)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
project(my_library Fortran)

Problem:
in doing so, cmake actually parses my Intel-Fortran.cmake file but all 
the variables stored in there are subsequently replaced by the
values stored in "Windows-ifort.cmake" during the "project" call. This 
does not happen when using the G95 to build my project because none
of these variables are set in the Windows-G95-Fortran.cmake file (and 
its dependancies).


Is that a known bug for intel fortran compiler ? Would you see any 
work-around or should I introduce in the CMakeLists a conditional for intel
compiler breaking in that special case one of the cmake programming 
rules ? !


thanks for your help

Eric



--
Eric Pellegrini
Calcul Scientifique
Insitut Laue-Langevin
Grenoble, France

___
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] linker associated to ifort fortran compiler

2010-09-29 Thread pellegrini

Hello everybody,

I would like to compile my project using intel fortran compiler on my 
windows machine.


When running the following commands:

cmake -DCMAKE_Fortran_Compiler=ifort -G"NMake Makefiles"
nmake VERBOSE=1

I can see that nmake use the linker 'lib' provided with the intel 
fortran compiler.


But, looking at my generated CMakeCache.txt I see just at the beginning:

CMAKE_AR:FILEPATH=C:/MinGW/bin/ar.exe (I have the Mingw tools installed 
on my machine


Two questions:
   - why cmake uses the 'lib' linker if another one was set in the 
CMakeCache.txt file ?
   - as it actually uses 'lib', how cmake did find the appropriated 
linker ?


thanks

Eric






--
Eric Pellegrini
Calcul Scientifique
Insitut Laue-Langevin
Grenoble, France

___
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] setting Visual Studio solution name

2010-09-29 Thread John Drescher
I am not exactly sure what you are doing but on all my CMake projects
I put only 1 target at the root level project. All other subprojects
are in subdirectories of the root target. The CMakeLists for these
subprojects can have project names but this is not needed. The
solution gets the name from the root project.

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] Visual Studio 2010 generator and custom command

2010-09-29 Thread elizabeta petreska
This is the link to bug report http://www.paraview.org/Bug/view.php?id=11274

On Wed, Sep 29, 2010 at 4:41 PM, Bill Hoffman wrote:

> On 9/29/2010 10:31 AM, elizabeta petreska wrote:
>
>>
>>
>>
> OK, can you send a complete project that shows the issue and create a bug
> report.
>
> Thanks.
>
>> On Wed, Sep 29, 2010 at 4:31 PM, elizabeta petreska
>> mailto:elizabeta.petre...@gmail.com>>
>> wrote:
>>
>>I did the test. Unfortunately the problem remains.
>>
>>
>>On Wed, Sep 29, 2010 at 4:16 PM, Bill Hoffman
>>mailto:bill.hoff...@kitware.com>> wrote:
>>
>>On 9/29/2010 9:55 AM, elizabeta petreska wrote:
>>
>>Just checked. same issue
>>
>>
>>Can you try the 2.8.3 rc1 :
>>
>>http://www.cmake.org/files/v2.8/cmake-2.8.3-rc1-win32-x86.exe
>>
>>Also try this one:
>>
>> http://www.cmake.org/files/dev/cmake-2.8.2.20100928-g1b0e5-win32-x86.exe
>>
>>
>>-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
>>
>>
>>
>>
>>
>> ___
>> 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
>>
>
>
> --
> Bill Hoffman
> Kitware, Inc.
> 28 Corporate Drive
> Clifton Park, NY 12065
> bill.hoff...@kitware.com
> http://www.kitware.com
> 518 881-4905 (Direct)
> 518 371-3971 x105
> Fax (518) 371-4573
>
> ___
> 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] Visual Studio 2010 generator and custom command

2010-09-29 Thread Bill Hoffman

On 9/29/2010 10:31 AM, elizabeta petreska wrote:





OK, can you send a complete project that shows the issue and create a 
bug report.


Thanks.

On Wed, Sep 29, 2010 at 4:31 PM, elizabeta petreska
mailto:elizabeta.petre...@gmail.com>> wrote:

I did the test. Unfortunately the problem remains.


On Wed, Sep 29, 2010 at 4:16 PM, Bill Hoffman
mailto:bill.hoff...@kitware.com>> wrote:

On 9/29/2010 9:55 AM, elizabeta petreska wrote:

Just checked. same issue


Can you try the 2.8.3 rc1 :

http://www.cmake.org/files/v2.8/cmake-2.8.3-rc1-win32-x86.exe

Also try this one:
http://www.cmake.org/files/dev/cmake-2.8.2.20100928-g1b0e5-win32-x86.exe


-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





___
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



--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
___
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] Visual Studio 2010 generator and custom command

2010-09-29 Thread elizabeta petreska
On Wed, Sep 29, 2010 at 4:31 PM, elizabeta petreska <
elizabeta.petre...@gmail.com> wrote:

> I did the test. Unfortunately the problem remains.
>
>
> On Wed, Sep 29, 2010 at 4:16 PM, Bill Hoffman wrote:
>
>> On 9/29/2010 9:55 AM, elizabeta petreska wrote:
>>
>>> Just checked. same issue
>>>
>>>
>> Can you try the 2.8.3 rc1 :
>>
>> http://www.cmake.org/files/v2.8/cmake-2.8.3-rc1-win32-x86.exe
>>
>> Also try this one:
>> http://www.cmake.org/files/dev/cmake-2.8.2.20100928-g1b0e5-win32-x86.exe
>>
>>
>> -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
>>
>
>
___
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] Visual Studio 2010 generator and custom command

2010-09-29 Thread Bill Hoffman

On 9/29/2010 9:55 AM, elizabeta petreska wrote:

Just checked. same issue



Can you try the 2.8.3 rc1 :

http://www.cmake.org/files/v2.8/cmake-2.8.3-rc1-win32-x86.exe

Also try this one:
http://www.cmake.org/files/dev/cmake-2.8.2.20100928-g1b0e5-win32-x86.exe

-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] Visual Studio 2010 generator and custom command

2010-09-29 Thread elizabeta petreska
Just checked. same issue

On Wed, Sep 29, 2010 at 3:50 PM, Bill Hoffman wrote:

> On 9/29/2010 9:38 AM, elizabeta petreska wrote:
>
>> If I use such a script for comparing time stamps of input and output
>> files, I would need to rewrite every cmakelists.txt that uses
>> add_custom_command, and execute the needed commands only if input file
>> is older than output,or maybe I did not understand you idea with the
>> script.  This seems like a lot of mess for something that cmake should do.
>>
>> Also is anybody experiencing this issue with vs2010 generator ?
>> Can anybody confirm that this is bug with vs2010 generator, and maybe
>> some workaround ?
>>
>> One more observation:
>> This problem seems to happen only when the output file goes to
>> subdirectory in PROJECT_BINARY_DIR, in the example the subdirectory is
>> PROJECT_BINARY_DIR/$(ConfigurationName).
>>
>> If I put the generated file to go straight under PROJECT_BINARY_DIR than
>> everything works ok. Also if I put the generated files to go under
>> PROJECT_SOURCE_DIR or its subdirectories everything works well.
>>
>> Thanks
>>
>
>
> }/$(ConfigurationName)/
> should use:
> ${CMAKE_CFG_INTDIR}
>
>
> That might be the problem.
>
> -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
>
___
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] Visual Studio 2010 generator and custom command

2010-09-29 Thread Bill Hoffman

On 9/29/2010 9:38 AM, elizabeta petreska wrote:

If I use such a script for comparing time stamps of input and output
files, I would need to rewrite every cmakelists.txt that uses
add_custom_command, and execute the needed commands only if input file
is older than output,or maybe I did not understand you idea with the
script.  This seems like a lot of mess for something that cmake should do.

Also is anybody experiencing this issue with vs2010 generator ?
Can anybody confirm that this is bug with vs2010 generator, and maybe
some workaround ?

One more observation:
This problem seems to happen only when the output file goes to
subdirectory in PROJECT_BINARY_DIR, in the example the subdirectory is
PROJECT_BINARY_DIR/$(ConfigurationName).

If I put the generated file to go straight under PROJECT_BINARY_DIR than
everything works ok. Also if I put the generated files to go under
PROJECT_SOURCE_DIR or its subdirectories everything works well.

Thanks



}/$(ConfigurationName)/
should use:
${CMAKE_CFG_INTDIR}


That might be the problem.

-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] Visual Studio 2010 generator and custom command

2010-09-29 Thread elizabeta petreska
If I use such a script for comparing time stamps of input and output files,
I would need to rewrite every cmakelists.txt that uses add_custom_command,
and execute the needed commands only if input file is older than output,or
maybe I did not understand you idea with the script.  This seems like a lot
of mess for something that cmake should do.

Also is anybody experiencing this issue with vs2010 generator ?
Can anybody confirm that this is bug with vs2010 generator, and maybe some
workaround ?

One more observation:
This problem seems to happen only when the output file goes to subdirectory
in PROJECT_BINARY_DIR, in the example the subdirectory is
PROJECT_BINARY_DIR/$(ConfigurationName).

If I put the generated file to go straight under PROJECT_BINARY_DIR than
everything works ok. Also if I put the generated files to go under
PROJECT_SOURCE_DIR or its subdirectories everything works well.

Thanks

On Wed, Sep 29, 2010 at 1:38 PM, Campbell Barton wrote:

> On Wed, Sep 29, 2010 at 10:02 AM, elizabeta petreska
>  wrote:
> > Hi,
> >
> > I asked this question some time ago in the mailing list. Unfortunately, I
> > did not try to resolve this issue since then, so I am trying again. :)
> >
> > I am using Visual Studio 2010 generator and cmake 2.8.2.
> >
> > Why the following custom command is runing all the time, although the
> input
> > dependency ( myfile.txt ) is not changed ? With Visual Studio 2005 it is
> > working ok.
> >
> > CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
> > PROJECT(quick_test)
> >
> > ADD_CUSTOM_COMMAND(
> >  OUTPUT "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
> >  COMMAND ${CMAKE_COMMAND} -E copy
> >   "${PROJECT_SOURCE_DIR}/myfile.txt"
> >   "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
> >  DEPENDS "${PROJECT_SOURCE_DIR}/myfile.txt"
> >  )
> > ADD_CUSTOM_TARGET(${PROJECT_NAME} DEPENDS
> > "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt")
>
> Was just about to mail this list with the same problem, but using
> Makefiles on linux so its probably not build system spesific.
> Basically the command to generate always runs even if the inputs are
> older then the outputs.
>
> The only work around I can think of is to write a cmake script which
> is called rather then the generator directly, this cmake script can do
> the file comparisons to work out if generating the files is really
> needed, but would prefer if this wasnt needed.
> ___
> 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] cmake do not read my ifort compiler fllags - correct version

2010-09-29 Thread pellegrini

Marcel Loose a écrit :

On Wed, 2010-09-29 at 12:06 +0200, pellegrini wrote:
  

Hello everybody,

I would like to set my own compiler flags to compile a library using 
intel fortran compiler.


To do so, I created in my Src/ directory a 
"Compiler/Intel-Fortran.cmake" file that contains my preferences such


as:
  

SET(CMAKE_BUILD_TYPE_INIT Release)
SET(CMAKE_Fortran_FLAGS_INIT "")
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback


/nologo")
  

SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0")
SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0")
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback 
/debug:full")

SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")

but, when running cmake and then nmake, the compiler flags used are

not 
  

the ones I set but the default ones. I do not
understand because I used to do the same with g95 and it worked 
perfectly. By the way, the flags used seem to be the ones

set in the  "Modules/Platform/Windows-ifort.cmake" cmake distribution,



  
as if that file was parsed instead of mine ! However, when I put a 
message("hello") inside my file, it appears when building the cmake


files.
  

would you have any idea ?

thanks

Eric



Hi Eric,

Just when exactly do you set these variables. As the name of these
variables suggest, these are initialisation variables. When CMake
processes the PROJECT() command, it also configures the compilers that
you define there (C and C++ by default). After that, none of the changes
you make to these *_INIT variables will be picked up.

HTH,
Marcel Loose.

  

Hi Marcel,

In fact my CMakeLists.txt file starts with the following lines:

cmake_minimum_required(VERSION 2.6.2)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
project(my_project Fortran)

in that case I have the problem described previously e.g. the 
Compiler/G95-Fortran.cmake file is actually parsed but its contents not 
used.


If I try in the following order:

cmake_minimum_required(VERSION 2.6.2)
project(my_project Fortran)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})

the file is even not parsed at all.

--
Eric Pellegrini
Calcul Scientifique
Insitut Laue-Langevin
Grenoble, France

___
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] Running tests using [C++/Python] modules from the build tree

2010-09-29 Thread Pere Mato Vila

Hi Marcel,

> You could write a wrapper script that sets your environment variables.
> Since you don't know the actual values for these variables beforehand,
> you should let CMake generate this script, using configure_file().
> That's the way I do it, and it works great.

Thanks for the suggestion. I am doing something similar but on installation. I 
generate a setup script that then can be used by clients of the project to get 
the correct environment. I was thinking to have something internal  for running 
the test cases from within the build tree.
Thanks again,

Pere   

-
Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
  e-mail: pere.m...@cern.ch  tel: +41 22 76 78696
  fax:  +41 22 76 68792gsm: +41 76 48 70855


___
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] Visual Studio 2010 generator and custom command

2010-09-29 Thread Campbell Barton
On Wed, Sep 29, 2010 at 10:02 AM, elizabeta petreska
 wrote:
> Hi,
>
> I asked this question some time ago in the mailing list. Unfortunately, I
> did not try to resolve this issue since then, so I am trying again. :)
>
> I am using Visual Studio 2010 generator and cmake 2.8.2.
>
> Why the following custom command is runing all the time, although the input
> dependency ( myfile.txt ) is not changed ? With Visual Studio 2005 it is
> working ok.
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
> PROJECT(quick_test)
>
> ADD_CUSTOM_COMMAND(
>  OUTPUT "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
>  COMMAND ${CMAKE_COMMAND} -E copy
>   "${PROJECT_SOURCE_DIR}/myfile.txt"
>   "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
>  DEPENDS "${PROJECT_SOURCE_DIR}/myfile.txt"
>  )
> ADD_CUSTOM_TARGET(${PROJECT_NAME} DEPENDS
> "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt")

Was just about to mail this list with the same problem, but using
Makefiles on linux so its probably not build system spesific.
Basically the command to generate always runs even if the inputs are
older then the outputs.

The only work around I can think of is to write a cmake script which
is called rather then the generator directly, this cmake script can do
the file comparisons to work out if generating the files is really
needed, but would prefer if this wasnt needed.
___
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] embedding lib into a shared object

2010-09-29 Thread Marcel Loose
On Wed, 2010-09-29 at 12:26 +0200, Ovanes Markarian wrote:
> Hello *,
> 
> 
> I have some library available as a Linux lib file. Now I need to
> create a shared object (actually a MODULE in terms of CMake) out of
> this lib. The module is later on loaded using the dlopen-API function.
> 
> 
> I created a sample project with
> 
> 
> /
> +-- testlib
> +-- so
> 
> 
> 
> 
> testlib - consists of a single cpp file haveing a global variable and
> a function returning it.
> 
> 
> CMake script:
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> 
> 
> PROJECT(testlib CXX)
> 
> 
> add_library(testlib STATIC functions.cpp)
> 
> 
> 
> 
> so - consists of a cpp file and links against testlib.
> 
> 
> CMake script:
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> 
> 
> PROJECT(so CXX)
> 
> 
> add_library(so MODULE main.cpp)
> target_link_libraries(so testlib)
> set_target_properties (so PROPERTIES VERSION 1.0 LINKER_LANGUAGE CXX)
> 
> 
> and the Root CMakeLists.txt which should build both:
> 
> 
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> 
> 
> PROJECT(dll_test CXX)
> 
> 
> add_subdirectory(lib)
> add_subdirectory(so)
> add_dependencies(so lib)
> 
> 
> 
> 
> Now my problem is that after the build I can find the symbols from
> functions.cpp in the lib file using the nm tool. But these symbols are
> not part of the so. How can I force them to be part of the so-Module?
> 
> 
> 
> 
> Thanks in advance,
> Ovanes
> 
Hi Ovanes,

Short answer: you can't.
This has been discussed several times on the mailing list. 

Longer answer: you can do it, but not in a portable way.
Check the wiki: http://www.itk.org/Wiki/CMake_FAQ#Library_questions.
There, you can also read that it is possible to do what you want if you
want to use GNU GCC/LD-specific features like the link option
--whole-archive. Needless to say that that's not portable. Besides, for
this to work, you must have compiled your sources with -fPIC -DPIC which
is not the default when building static libraries.

HTH,
Marcel Loose.


___
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] cmake do not read my ifort compiler fllags - correct version

2010-09-29 Thread Marcel Loose
On Wed, 2010-09-29 at 12:06 +0200, pellegrini wrote:
> Hello everybody,
> 
> I would like to set my own compiler flags to compile a library using 
> intel fortran compiler.
> 
> To do so, I created in my Src/ directory a 
> "Compiler/Intel-Fortran.cmake" file that contains my preferences such
as:
> 
> SET(CMAKE_BUILD_TYPE_INIT Release)
> SET(CMAKE_Fortran_FLAGS_INIT "")
> SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback
/nologo")
> SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0")
> SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0")
> SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback 
> /debug:full")
> SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
> SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
> 
> but, when running cmake and then nmake, the compiler flags used are
not 
> the ones I set but the default ones. I do not
> understand because I used to do the same with g95 and it worked 
> perfectly. By the way, the flags used seem to be the ones
> set in the  "Modules/Platform/Windows-ifort.cmake" cmake distribution,

> as if that file was parsed instead of mine ! However, when I put a 
> message("hello") inside my file, it appears when building the cmake
files.
> 
> would you have any idea ?
> 
> thanks
> 
> Eric
> 
Hi Eric,

Just when exactly do you set these variables. As the name of these
variables suggest, these are initialisation variables. When CMake
processes the PROJECT() command, it also configures the compilers that
you define there (C and C++ by default). After that, none of the changes
you make to these *_INIT variables will be picked up.

HTH,
Marcel Loose.

___
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 set compiler flags?

2010-09-29 Thread David Aldrich
Hi

> If that is so, I plan to assign my desired release options to
> CMAKE_CXX_FLAGS_RELEASE and assign that variable to CMAKE_CXX_FLAGS. That way,
> a release build will happen by default (no build type specified) or if
> "Release" is specified. I can handle debug builds using CMAKE_CXX_FLAGS_DEBUG.

Sorry, I have misunderstood. No need to answer.

David

> > -Original Message-
> > From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
> > Michael Hertling
> > Sent: 29 September 2010 02:15
> > To: cmake@cmake.org
> > Subject: Re: [CMake] How to set compiler flags?
> >
> > On 09/28/2010 05:35 PM, David Aldrich wrote:
> > > Hi
> > >
> > > I am writing CMakeLists.txt files for my C++ application. Initially I set
> > the C++ compiler flags by setting CMAKE_CXX_FLAGS:
> > >
> > > set( CMAKE_CXX_FLAGS "-Wall -m64 -O3 " )
> > >
> > > Then I realised that those flags get passed to the linker as well, which
> > seemed a bit untidy. [...]
> >
> > But possibly necessary:
> >
> > 
> >
> > et seq.
> >
> > > [...] So I now use add_definitions instead:
> > >
> > > add_definitions( "-Wall -m64 -O3" )
> > >
> > > Is there a better way of doing this?
> >
> > Don't do this at all, and adhere to the flags.
> >
> > > My CMakeLists.txt files only handle a release build currently. If you
> could
> > give me a hint for how to go on to add a debug build option, I would be
> > grateful.
> >
> > Doesn't the DEBUG variant of the flags, e.g. CMAKE_CXX_FLAGS_DEBUG, and
> > other related variables - perhaps in connection with CMAKE_BUILD_TYPE -
> > work for you?
> >
> > Regards,
> >
> > Michael
> > ___
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
> >
> >
> >  Click
> >
> https://www.mailcontrol.com/sr/g!Zu+tz8WoHTndxI!oX7Uq0JINmXjwVqUAeEJxkrmVZ0jY
> > kyJOOpuMF6ri4kt+pzfxoBRqvSue5ICd5VsZuQpQ==  to report this email as spam.
> ___
> 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] embedding lib into a shared object

2010-09-29 Thread Ovanes Markarian
Hello *,

I have some library available as a Linux lib file. Now I need to create a
shared object (actually a MODULE in terms of CMake) out of this lib. The
module is later on loaded using the dlopen-API function.

I created a sample project with

/
+-- testlib
+-- so


testlib - consists of a single cpp file haveing a global variable and a
function returning it.

CMake script:
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(testlib CXX)

add_library(testlib STATIC functions.cpp)


so - consists of a cpp file and links against testlib.

CMake script:
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(so CXX)

add_library(so MODULE main.cpp)
target_link_libraries(so testlib)
set_target_properties (so PROPERTIES VERSION 1.0 LINKER_LANGUAGE CXX)

and the Root CMakeLists.txt which should build both:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(dll_test CXX)

add_subdirectory(lib)
add_subdirectory(so)
add_dependencies(so lib)


Now my problem is that after the build I can find the symbols from
functions.cpp in the lib file using the nm tool. But these symbols are not
part of the so. How can I force them to be part of the so-Module?


Thanks in advance,
Ovanes
___
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] Visual Studio 2010 generator and custom command

2010-09-29 Thread elizabeta petreska
Hi,

I asked this question some time ago in the mailing list. Unfortunately, I
did not try to resolve this issue since then, so I am trying again. :)

I am using Visual Studio 2010 generator and cmake 2.8.2.

Why the following custom command is runing all the time, although the input
dependency ( myfile.txt ) is not changed ? With Visual Studio 2005 it is
working ok.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(quick_test)

ADD_CUSTOM_COMMAND(
 OUTPUT "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
 COMMAND ${CMAKE_COMMAND} -E copy
  "${PROJECT_SOURCE_DIR}/myfile.txt"
  "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
 DEPENDS "${PROJECT_SOURCE_DIR}/myfile.txt"
 )
ADD_CUSTOM_TARGET(${PROJECT_NAME} DEPENDS
"${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt")
___
Powered by www.kitware.com

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

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

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

[CMake] cmake do not read my ifort compiler fllags - correct version

2010-09-29 Thread pellegrini

Hello everybody,

I would like to set my own compiler flags to compile a library using 
intel fortran compiler.


To do so, I created in my Src/ directory a 
"Compiler/Intel-Fortran.cmake" file that contains my preferences such as:


SET(CMAKE_BUILD_TYPE_INIT Release)
SET(CMAKE_Fortran_FLAGS_INIT "")
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback /nologo")
SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0")
SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0")
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback 
/debug:full")

SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")

but, when running cmake and then nmake, the compiler flags used are not 
the ones I set but the default ones. I do not
understand because I used to do the same with g95 and it worked 
perfectly. By the way, the flags used seem to be the ones
set in the  "Modules/Platform/Windows-ifort.cmake" cmake distribution, 
as if that file was parsed instead of mine ! However, when I put a 
message("hello") inside my file, it appears when building the cmake files.


would you have any idea ?

thanks

Eric




--
Eric Pellegrini
Calcul Scientifique
Insitut Laue-Langevin
Grenoble, France

___
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

--
Eric Pellegrini
Calcul Scientifique
Insitut Laue-Langevin
Grenoble, France

___
Powered by www.kitware.com

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

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

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


[CMake] cmake do not read my ifort compiler fllags

2010-09-29 Thread pellegrini

Hello everybody,

I would like to set my own compiler flags to compile a library using 
intel fortran compiler.


To do so, I created in my Src/ directory a 
"Compiler/Intel-Fortran.cmake" file that contains my preferences such as:


SET(CMAKE_BUILD_TYPE_INIT Release)
SET(CMAKE_Fortran_FLAGS_INIT "")
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback /nologo")
SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0")
SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0")
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback 
/debug:full")

SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")

but, when running cmake and then nmake, the compiler flags used are not 
the ones I set but the default ones. I do not
understand because I used to do the same with g95 and it worked 
perfectly. By the way, the flags used seem to be the ones
set in the  "Modules/Platform/Windows-ifort.cmake" cmake distribution, 
as if that file was parsed instead of mine !


would you have any idea ?

thanks

Eric




--
Eric Pellegrini
Calcul Scientifique
Insitut Laue-Langevin
Grenoble, France

___
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] Howto compile static executable?

2010-09-29 Thread Marcel Loose
On Tue, 2010-09-28 at 18:57 +0200, Eric Noulard wrote:
> Hi All,
> 
> I have project which (cross-)compile some simple C applications
> with some bare CMake statement like this:
> 
> add_executable(myapp myapp.c)
> 
> no target_link_libraries, no dep,  etc...
> 
> I want to build fully static executable (even for libc etc...)
> Currently I do:
> 
> set_target_properties(myapp PROPERTIES LINK_FLAGS_DEBUG "-static")
> 
> is there a better and portable way to require "static" executable?
> 
> I am aware of the BUILD_SHARED_LIBS var for globally controlling
> static vs dynamic libs but how can I do for executable?
> 
Hi Eric,

I use an option for this. See the code snippet below.

  if(BUILD_STATIC_EXECUTABLES)
set(CMAKE_EXE_LINKER_FLAGS -static)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)   # remove -Wl,-Bdynamic
set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)# remove -rdynamic
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
# Maybe this works as well, haven't tried yet.
# set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
  else(BUILD_STATIC_EXECUTABLES)
# Set RPATH to use for installed targets; append linker search path
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LOFAR_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  endif(BUILD_STATIC_EXECUTABLES)

HTH,
Marcel Loose.


___
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] Running tests using [C++/Python] modules from the build tree

2010-09-29 Thread Marcel Loose
On Tue, 2010-09-28 at 18:42 +0200, Pere Mato Vila wrote:
> Hi,
> 
>   I am seeking for advise. I would like to run some CTest tests from
the build tree, which require C++ or Python modules created in other
project directories (packages). For this I need to build correctly the
LD_LIBRARY_PATH and PYTHONPATH and use the command set_property(TEST xxx
PROPERTY ENVIRONMENT LD_LIBRARY_PATH=yyy PYTHONPATH=xxx). The question
is how to make this the most easy and transparent way as possible, since
the modules I would need in the tests are not easily known a priori.
> 
>If I could set a global variable in each package that creates a
module, something like _MODULE_DIRS and I could collect these
in the package that I want to run the test and build the ENVIRONMENT
property accordingly. The problem is that it is not so easy in CMake to
set global variables. 
> 
>   Another alternative would be to define  a function called 
module_directories(), which behaves like the command 
link_dicrectories(), that I could call every time I create/define a
module. I would then recover the list of directories using a specific
directory property,  as it is done in the case of LINK_DIRECTORIES.
> 
>   Does anybody has a similar problem and has found an elegant
solution? Many thanks  in advance.
> 
> 
Hi Pere,

You could write a wrapper script that sets your environment variables.
Since you don't know the actual values for these variables beforehand,
you should let CMake generate this script, using configure_file().
That's the way I do it, and it works great.

Best regards,
Marcel Loose.

___
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 set compiler flags?

2010-09-29 Thread David Aldrich
Hi Michael

> > [...] So I now use add_definitions instead:
> >
> > add_definitions( "-Wall -m64 -O3" )
> >
> > Is there a better way of doing this?
> 
> Don't do this at all, and adhere to the flags.

Thanks for your advice.

> Doesn't the DEBUG variant of the flags, e.g. CMAKE_CXX_FLAGS_DEBUG, and
> other related variables - perhaps in connection with CMAKE_BUILD_TYPE -
> work for you?

Regarding CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_RELEASE, is CMAKE_CXX_FLAGS used 
if no build type is specified and CMAKE_CXX_FLAGS_RELEASE used if the build 
type is "Release"?

If that is so, I plan to assign my desired release options to 
CMAKE_CXX_FLAGS_RELEASE and assign that variable to CMAKE_CXX_FLAGS. That way, 
a release build will happen by default (no build type specified) or if 
"Release" is specified. I can handle debug builds using CMAKE_CXX_FLAGS_DEBUG.

Am I understanding correctly?

Best regards 

David 


> -Original Message-
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
> Michael Hertling
> Sent: 29 September 2010 02:15
> To: cmake@cmake.org
> Subject: Re: [CMake] How to set compiler flags?
> 
> On 09/28/2010 05:35 PM, David Aldrich wrote:
> > Hi
> >
> > I am writing CMakeLists.txt files for my C++ application. Initially I set
> the C++ compiler flags by setting CMAKE_CXX_FLAGS:
> >
> > set( CMAKE_CXX_FLAGS "-Wall -m64 -O3 " )
> >
> > Then I realised that those flags get passed to the linker as well, which
> seemed a bit untidy. [...]
> 
> But possibly necessary:
> 
> 
> 
> et seq.
> 
> > [...] So I now use add_definitions instead:
> >
> > add_definitions( "-Wall -m64 -O3" )
> >
> > Is there a better way of doing this?
> 
> Don't do this at all, and adhere to the flags.
> 
> > My CMakeLists.txt files only handle a release build currently. If you could
> give me a hint for how to go on to add a debug build option, I would be
> grateful.
> 
> Doesn't the DEBUG variant of the flags, e.g. CMAKE_CXX_FLAGS_DEBUG, and
> other related variables - perhaps in connection with CMAKE_BUILD_TYPE -
> work for you?
> 
> Regards,
> 
> Michael
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 
>  Click
> https://www.mailcontrol.com/sr/g!Zu+tz8WoHTndxI!oX7Uq0JINmXjwVqUAeEJxkrmVZ0jY
> kyJOOpuMF6ri4kt+pzfxoBRqvSue5ICd5VsZuQpQ==  to report this email as spam.
___
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] RULE_XXX

2010-09-29 Thread Jesper Eskilson
I'm trying to use the RULE_XXX properties to customize make output. Is 
there a way to intercept ALL output from make, including the "Build 
target ...", "Building C object...", etc., messages as well?


--
/Jesper

___
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