Re: [cmake-developers] [CMake] CMake 2.8.3-rc1 ready for testing!

2010-09-29 Thread Alexander Neundorf
On Tuesday 28 September 2010, Brad King wrote:
 On 09/28/2010 05:20 PM, Alexander Neundorf wrote:
  On Tuesday 28 September 2010, Alexander Neundorf wrote:
  Is this intended this way ?
 
  The attached tiny patch seems to make CMAKE_PARENT_LIST_FILE work more
  like I expected.

 Yes, but who knows what it will break.  I'm not prepared to do
 this during a release candidate series.

No, no, this was just meant as a comment, not something to be changed for 
2.8.3.

Alex
___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] Problem with Intel Fortran and the Visual Studio 2008 generator

2010-09-29 Thread Arjen Markus

Hi Brad,

I am glad it was something this simple (even though with far-reaching
consequences)! It is not something I could have found out myself.

Regards,

Arjen

On 2010-09-28 16:18, Brad King wrote:

On 9/28/2010 6:35 AM, Arjen Markus wrote:

for the PLplot project (http://plplot.sf.net) I have tried to use
the Visual Studio 2008 generator in combination with Intel Fortran
(version 11.1). Generating the solution and the project files
works fine, but when I try to build it all, I get error messages
about various symbols being doubly defined (in libcmt.lib - __aenvptr,
__wenvptr, ___error_mode and ___app_type) and also a missing symbol
in libifcoremt.lib (_MAIN__).

These are system libraries that get included automatically during the
link step.

If I use the NMake Makefiles generator, however, all goes well.


I can reproduce this with VS 2008 and Intel 11.1 in 32-bit mode:

LIBCMT.lib(dllcrt0.obj) : error LNK2005: __aenvptr already defined in 
LIBCMT.lib(crt0.obj)
LIBCMT.lib(dllcrt0.obj) : error LNK2005: __wenvptr already defined in 
LIBCMT.lib(crt0.obj)
LIBCMT.lib(dllcrt0.obj) : error LNK2005: ___error_mode already defined in 
LIBCMT.lib(crt0.obj)
LIBCMT.lib(dllcrt0.obj) : error LNK2005: ___app_type already defined in 
LIBCMT.lib(crt0.obj)

Note that one comes from dllcrt0.obj and the other from crt0.obj.
The build is mixing static and shared runtime libraries.

It looks like the Platform/Windows-ifort.cmake module is not getting
loaded for this generator.  This is due to a dumb bug in the language
information files.  I've pushed out a fix:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20f49730

-Brad




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


[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


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:
 
 http://www.cmake.org/pipermail/cmake/2010-July/038083.html
 
 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


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 PACKAGE_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] 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


[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


[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] 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] 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

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:
 
  http://www.cmake.org/pipermail/cmake/2010-July/038083.html
 
  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


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

2010-09-29 Thread Campbell Barton
On Wed, Sep 29, 2010 at 10:02 AM, elizabeta petreska
elizabeta.petre...@gmail.com 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] 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] 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] 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 ideasma...@gmail.comwrote:

 On Wed, Sep 29, 2010 at 10:02 AM, elizabeta petreska
 elizabeta.petre...@gmail.com 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] 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
Just checked. same issue

On Wed, Sep 29, 2010 at 3:50 PM, Bill Hoffman bill.hoff...@kitware.comwrote:

 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: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
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 bill.hoff...@kitware.comwrote:

 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 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
elizabeta.petre...@gmail.com 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
bill.hoff...@kitware.com 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 http://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
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 bill.hoff...@kitware.comwrote:

 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
 elizabeta.petre...@gmail.com 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
bill.hoff...@kitware.com 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 http://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] 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


[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 -GNMake 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


[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] 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] 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


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


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] 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] 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-commits] CMake branch, next, updated. v2.8.2-961-g176bd81

2010-09-29 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, next has been updated
   via  176bd81347cec089d23aebb5dd04a795a1a0b1ff (commit)
   via  a2bbe4bef93f9846144a738799f3b405e1666b9f (commit)
  from  57064f198c7db2ddc325be44fe1e3a27d0ba51b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=176bd81347cec089d23aebb5dd04a795a1a0b1ff
commit 176bd81347cec089d23aebb5dd04a795a1a0b1ff
Merge: 57064f1 a2bbe4b
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Sep 29 08:42:41 2010 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Sep 29 08:42:41 2010 -0400

Merge topic 'xcode-generator-trailing-whitespace' into next

a2bbe4b Remove trailing whitespace from Xcode generator source


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2bbe4bef93f9846144a738799f3b405e1666b9f
commit a2bbe4bef93f9846144a738799f3b405e1666b9f
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Sep 29 08:38:18 2010 -0400
Commit: Brad King brad.k...@kitware.com
CommitDate: Wed Sep 29 08:38:18 2010 -0400

Remove trailing whitespace from Xcode generator source

Reverting abandoned topic xcode_source_group_fix_7932 left this source
slightly different due to trailing whitespace removal on some lines.
Remove all trailing whitespace from the file to make it consistent.

diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index 4e9969d..f989a5c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -131,8 +131,8 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string 
const version)
 
 //
 cmGlobalGenerator* cmGlobalXCodeGenerator::New()
-{ 
-#if defined(CMAKE_BUILD_WITH_CMAKE)  
+{
+#if defined(CMAKE_BUILD_WITH_CMAKE)
   cmXcodeVersionParser parser;
   parser.ParseFile
 (/Developer/Applications/Xcode.app/Contents/version.plist);
@@ -156,7 +156,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::New()
 void cmGlobalXCodeGenerator::EnableLanguage(std::vectorstd::stringconst
 lang,
 cmMakefile * mf, bool optional)
-{ 
+{
   mf-AddDefinition(XCODE,1);
   mf-AddDefinition(XCODE_VERSION, this-VersionString.c_str());
   if(this-XcodeVersion == 15)
@@ -175,12 +175,12 @@ void 
cmGlobalXCodeGenerator::EnableLanguage(std::vectorstd::stringconst
   mf-AddDefinition(CMAKE_GENERATOR_CC, gcc);
   mf-AddDefinition(CMAKE_GENERATOR_CXX, g++);
   mf-AddDefinition(CMAKE_GENERATOR_NO_COMPILER_ENV, 1);
-  // initialize Architectures so it can be used by 
+  // initialize Architectures so it can be used by
   //  GetTargetObjectFileDirectories
   this-cmGlobalGenerator::EnableLanguage(lang, mf, optional);
-const char* osxArch = 
+const char* osxArch =
   mf-GetDefinition(CMAKE_OSX_ARCHITECTURES);
-  const char* sysroot = 
+  const char* sysroot =
   mf-GetDefinition(CMAKE_OSX_SYSROOT);
   if(osxArch  sysroot)
 {
@@ -193,10 +193,10 @@ void 
cmGlobalXCodeGenerator::EnableLanguage(std::vectorstd::stringconst
 //
 std::string cmGlobalXCodeGenerator
 ::GenerateBuildCommand(const char* makeProgram,
-   const char *projectName, 
-   const char* additionalOptions, 
+   const char *projectName,
+   const char* additionalOptions,
const char *targetName,
-   const char* config, 
+   const char* config,
bool ignoreErrors,
bool)
 {
@@ -210,7 +210,7 @@ std::string cmGlobalXCodeGenerator
   Generator cannot find the appropriate make command.);
 return ;
 }
-  std::string makeCommand = 
+  std::string makeCommand =
 cmSystemTools::ConvertToOutputPath(makeProgram);
   std::string lowerCaseCommand = makeCommand;
   cmSystemTools::LowerCase(lowerCaseCommand);
@@ -284,7 +284,7 @@ void cmGlobalXCodeGenerator::Generate()
   // make sure extra targets are added before calling
   // the parent generate which will call trace depends
   for(it = this-ProjectMap.begin(); it!= this-ProjectMap.end(); ++it)
-{ 
+{
 cmLocalGenerator* root = it-second[0];
 this-SetGenerationRoot(root);
 // add ALL_BUILD, INSTALL, etc
@@ -293,7 +293,7 @@ void cmGlobalXCodeGenerator::Generate()
   this-ForceLinkerLanguages();
   this-cmGlobalGenerator::Generate();
   for(it = this-ProjectMap.begin(); it!= this-ProjectMap.end(); 

[Cmake-commits] CMake branch, next, updated. v2.8.2-963-g49041df

2010-09-29 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, next has been updated
   via  49041df013d77dc1af3e8bedbb2e632059395952 (commit)
   via  da5c8953b72028cfdf9090857b7012cad04e4bfa (commit)
  from  176bd81347cec089d23aebb5dd04a795a1a0b1ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49041df013d77dc1af3e8bedbb2e632059395952
commit 49041df013d77dc1af3e8bedbb2e632059395952
Merge: 176bd81 da5c895
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Sep 29 09:30:41 2010 -0400
Commit: Brad King brad.k...@kitware.com
CommitDate: Wed Sep 29 09:30:41 2010 -0400

Merge branch 'master' into next


---

Summary of changes:


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, next, updated. v2.8.2-965-gd9dc4db

2010-09-29 Thread Bill Hoffman
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, next has been updated
   via  d9dc4dbe4359c4da0cda11c479faa5a1a0386401 (commit)
   via  525320679887d7df4bad5e619ceafdf2bfe891c5 (commit)
  from  49041df013d77dc1af3e8bedbb2e632059395952 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9dc4dbe4359c4da0cda11c479faa5a1a0386401
commit d9dc4dbe4359c4da0cda11c479faa5a1a0386401
Merge: 49041df 5253206
Author: Bill Hoffman bill.hoff...@kitware.com
AuthorDate: Wed Sep 29 14:49:23 2010 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Sep 29 14:49:23 2010 -0400

Merge topic 'fix_hpux_test_failure' into next

5253206 Add a new line to the end of the generated main.cxx for the hpux 
compiler.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=525320679887d7df4bad5e619ceafdf2bfe891c5
commit 525320679887d7df4bad5e619ceafdf2bfe891c5
Author: Bill Hoffman bill.hoff...@kitware.com
AuthorDate: Wed Sep 29 14:46:45 2010 -0400
Commit: Bill Hoffman bill.hoff...@kitware.com
CommitDate: Wed Sep 29 14:46:45 2010 -0400

Add a new line to the end of the generated main.cxx for the hpux compiler.

Some HPUX compilers give this error: Error 690: /home/cport/Dashboards/My 
Tests/CMake-build/Tests/CheckCompilerRelatedVariables/main.cxx, line 1 # 
Nonempty source files must end with a newline that is not preceded by a 
backslash.

diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt 
b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
index 7206f1d..8095a1c 100644
--- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
+++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
@@ -76,7 +76,8 @@ endif()
 
 file(WRITE
   ${CMAKE_CURRENT_BINARY_DIR}/main.cxx
-  int main() { return 0; }
+  int main() { return 0; }
+
   )
 
 add_executable(

---

Summary of changes:
 Tests/CheckCompilerRelatedVariables/CMakeLists.txt |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v2.8.2-522-g4e137de

2010-09-29 Thread KWSys Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, master has been updated
   via  4e137de7b1e49db168228607864e80a6960ec52f (commit)
  from  da5c8953b72028cfdf9090857b7012cad04e4bfa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e137de7b1e49db168228607864e80a6960ec52f
commit 4e137de7b1e49db168228607864e80a6960ec52f
Author: KWSys Robot kwro...@kitware.com
AuthorDate: Thu Sep 30 00:01:06 2010 -0400
Commit: KWSys Robot kwro...@kitware.com
CommitDate: Thu Sep 30 00:10:39 2010 -0400

KWSys Nightly Date Stamp

diff --git a/Source/kwsys/kwsysDateStamp.cmake 
b/Source/kwsys/kwsysDateStamp.cmake
index 2863f87..6a34e92 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2010)
 SET(KWSYS_DATE_STAMP_MONTH 09)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   29)
+SET(KWSYS_DATE_STAMP_DAY   30)

---

Summary of changes:
 Source/kwsys/kwsysDateStamp.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits