Re: [CMake] Baffled by CDT4 link_directories

2011-05-05 Thread Rolf Eike Beer
Am Donnerstag, 5. Mai 2011, 22:21:49 schrieb Dan Furtney:
> I have a CMakelists.txt file that works properly for the “Unix Makefiles”
> type build (Linux) and for VS 2008. When generating a CDT4 project (Linux)
> from the same file, library paths are not resolved and the project won’t
> link. The library paths are specified using the link_directories command
> exclusively.  The cmake files are at the same level as the “Src”
directory
> that contains all source. I am totally stumped as to why this doesn’t work
> under CDT4.

The answer is rather simple: don't use link_directories(). If you use it and
it gives you trouble that means that you don't understand what it does and
that means that you don't need it. Really. Use target_link_libraries() with a
full path to the library you want to use and let CMake do everything else.

Can we please get a big fat warning message into the link_directories()
documentation telling people that if they come from Makefiles or whereever they
should not use this function as this works different than in plain makefiles and
is usually a bad idea to use? I'm often doing support in #cmake on Freenode
and this is likely the most misunderstood concept of everyone coming from
plain Makefiles.

Eike

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

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

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

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

[CMake] Baffled by CDT4 link_directories

2011-05-05 Thread Dan Furtney
I have a CMakelists.txt file that works properly for the “Unix Makefiles” type 
build (Linux) and for VS 2008. When generating a CDT4 project (Linux) from the 
same file, library paths are not resolved and the project won’t link. The 
library paths are specified using the link_directories command exclusively.  
The cmake files are at the same level as the “Src” directory that contains all 
source. I am totally stumped as to why this doesn’t work under CDT4.

cmake_minimum_required(VERSION 2.6)
project(SecondTest_UT)

# Compiler options
if(CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_CXX_FLAGS "-m32 -D USE_STD_HEADERS -D NO_CSF_INTEROPERABILITY")
elseif(MSVC)
   add_definitions(/MTd )
endif(CMAKE_COMPILER_IS_GNUCXX)

# Platform dependency controls
if(WIN32)
   set(COE_OS windows)
   set(COE_LIB_DIR nt)
   set(GENSOFT_LIB_DIR NTLib_80)
   set(LIB_EXTENSION .lib)
   set(PLATFORM_SPECIFIC_LIBS ws2_32.lib)
   set(PLATFORM_SPECIFIC_LINK_DIRS $ENV{COE}/lib/${COE_LIB_DIR})
   set(PLATFORM_SPECIFIC_INC_DIRS )
elseif(UNIX)
   set(COE_OS posix)
   set(COE_LIB_DIR linux_pc)
   set(GENSOFT_LIB_DIR Linux)
   set(LIB_EXTENSION )
   set(PLATFORM_SPECIFIC_LIBS gs_esw eswHelpers Infrastructure)
   set(PLATFORM_SPECIFIC_LINK_DIRS $ENV{SIMDIR}/lib $ENV{ESWDIR}/Esw)
   set(PLATFORM_SPECIFIC_INC_DIRS 
$ENV{SIMDIR}/sim/src/dropIns/eswInterface/eswHelpers 
$ENV{SIMDIR}/sm3Sim/src/dropIns/eswInterface/eswHelpers/intLibStub)
endif(WIN32)

# COE and genSoft Includes
include_directories(AFTER 
   $ENV{GTEST_ROOT}/include
   $ENV{GENSOFT_HOME}/include
   $ENV{GENSOFT_HOME}/include/genMath
   $ENV{GENSOFT_HOME}/include/genSoftLLE
   $ENV{GENSOFT_HOME}/include/genSoftLog
   $ENV{COE}/include
   $ENV{COE}/include/${COE_OS}
)

# GS-ESW Includes
include_directories(AFTER 
   ${PLATFORM_SPECIFIC_INC_DIRS}
)

# Library directory paths
link_directories(
   $ENV{GTEST_ROOT}/lib
   $ENV{COE}/lib/${COE_LIB_DIR}/cpp
   ${PLATFORM_SPECIFIC_LINK_DIRS}
   $ENV{GENSOFT_HOME}/lib/genSoftComponentFramework_${GENSOFT_LIB_DIR}
)

# Additional Libraries
set(GENSOFT_LIBS genSoftD${LIB_EXTENSION} coeD${LIB_EXTENSION} 
od_coeD${LIB_EXTENSION} socket_media_bindingD${LIB_EXTENSION})
set(GTEST_LIBS gtest_maind${LIB_EXTENSION} gtestd${LIB_EXTENSION})

# Get local files
file(GLOB_RECURSE fileNameListStr Src/*.cpp)

# Add the targets
add_library(SecondTest SHARED ${fileNameListStr})
add_executable(SecondTestExec ${fileNameListStr})

# Associate the additional libs with the targets
target_link_libraries(SecondTestExec ${GTEST_LIBS} ${GENSOFT_LIBS} 
${PLATFORM_SPECIFIC_LIBS} )
target_link_libraries(SecondTest ${GTEST_LIBS} ${GENSOFT_LIBS} 
${PLATFORM_SPECIFIC_LIBS} )___
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-2.8.4.tar.gz can't decompress (wrong checksum)

2011-05-05 Thread Paulo Silva
Followup, apparently it's chrome's fault.
Tried it with safari and it works, but with chrome I "always" get the wrong
checksum.
wget also downloads correctly.
Maybe a need to reinstall chrome... :p
Sorry about that.

On Fri, May 6, 2011 at 1:58 PM, Paulo Silva  wrote:

> Ok, lets forget about this.
> I downloaded the file from another computer and if came out with the
> correct checksum. Go figure.
> In the end the problem is somewhere on my pc, but I guess I will never find
> out what it was.
>
> Cheers
>
>
> On Fri, May 6, 2011 at 12:59 PM, Paulo Silva wrote:
>
>> Hi there,
>> I'm trying to install cmake-2.8.4.tar.gz.
>> I tried to download it a number of times from
>> http://www.cmake.org/files/v2.8/, but this file seems to be corrupted.(?)
>> I always get a file with md5 026a61867cb0dd9375c2523282e28e7b which can't
>> be decompressed.
>> while the theoretically correct checksums apparently should be
>> md5 209b7d1d04b2e00986538d74ba764fcf \
>> sha16c42699bd63fdfcc7743d4906e3208d051d7f19b \
>> rmd160  8b92eb11391b07433e7fe02bbb80c3ebcaaf1893
>>
>> Can anyone confirm this? And if possible can anyone give me a pointer to a
>> "correct" file.
>>
>> Thanks.
>> Paulo
>>
>
>
___
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-2.8.4.tar.gz can't decompress (wrong checksum)

2011-05-05 Thread Paulo Silva
Ok, lets forget about this.
I downloaded the file from another computer and if came out with the correct
checksum. Go figure.
In the end the problem is somewhere on my pc, but I guess I will never find
out what it was.

Cheers

On Fri, May 6, 2011 at 12:59 PM, Paulo Silva  wrote:

> Hi there,
> I'm trying to install cmake-2.8.4.tar.gz.
> I tried to download it a number of times from
> http://www.cmake.org/files/v2.8/, but this file seems to be corrupted.(?)
> I always get a file with md5 026a61867cb0dd9375c2523282e28e7b which can't
> be decompressed.
> while the theoretically correct checksums apparently should be
> md5 209b7d1d04b2e00986538d74ba764fcf \
> sha16c42699bd63fdfcc7743d4906e3208d051d7f19b \
> rmd160  8b92eb11391b07433e7fe02bbb80c3ebcaaf1893
>
> Can anyone confirm this? And if possible can anyone give me a pointer to a
> "correct" file.
>
> Thanks.
> Paulo
>
___
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-2.8.4.tar.gz can't decompress (wrong checksum)

2011-05-05 Thread Jean-Christophe Fillion-Robin
Hi Paulo,

I just downloaded the file and everything seems to be fine.

See below ...


jchris@karakoram:~ $ wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
--2011-05-06 00:29:15--  http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
Resolving www.cmake.org... 66.194.253.19
Connecting to www.cmake.org|66.194.253.19|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5477628 (5.2M) [application/x-gzip]
Saving to: `cmake-2.8.4.tar.gz'

100%[==>] 5,477,628   1.59M/s   in
4.9s

2011-05-06 00:29:21 (1.06 MB/s) - `cmake-2.8.4.tar.gz' saved
[5477628/5477628]

jchris@karakoram:~ $ md5sum  cmake-2.8.4.tar.gz
209b7d1d04b2e00986538d74ba764fcf  cmake-2.8.4.tar.gz



Hth
Jc

On Thu, May 5, 2011 at 11:59 PM, Paulo Silva  wrote:

> Hi there,
> I'm trying to install cmake-2.8.4.tar.gz.
> I tried to download it a number of times from
> http://www.cmake.org/files/v2.8/, but this file seems to be corrupted.(?)
> I always get a file with md5 026a61867cb0dd9375c2523282e28e7b which can't
> be decompressed.
> while the theoretically correct checksums apparently should be
> md5 209b7d1d04b2e00986538d74ba764fcf \
> sha16c42699bd63fdfcc7743d4906e3208d051d7f19b \
> rmd160  8b92eb11391b07433e7fe02bbb80c3ebcaaf1893
>
> Can anyone confirm this? And if possible can anyone give me a pointer to a
> "correct" file.
>
> Thanks.
> Paulo
>
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
+1 919 869 8849
___
Powered by www.kitware.com

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

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

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

[CMake] cmake-2.8.4.tar.gz can't decompress (wrong checksum)

2011-05-05 Thread Paulo Silva
Hi there,
I'm trying to install cmake-2.8.4.tar.gz.
I tried to download it a number of times from
http://www.cmake.org/files/v2.8/, but this file seems to be corrupted.(?)
I always get a file with md5 026a61867cb0dd9375c2523282e28e7b which can't be
decompressed.
while the theoretically correct checksums apparently should be
md5 209b7d1d04b2e00986538d74ba764fcf \
sha16c42699bd63fdfcc7743d4906e3208d051d7f19b \
rmd160  8b92eb11391b07433e7fe02bbb80c3ebcaaf1893

Can anyone confirm this? And if possible can anyone give me a pointer to a
"correct" file.

Thanks.
Paulo
___
Powered by www.kitware.com

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

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

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

Re: [CMake] How to add a target link library, but only for a custom configuration ?

2011-05-05 Thread Michael Hertling
On 05/05/2011 12:51 PM, Glenn Coombs wrote:
> Thanks for that link Michael.  It doesn't please me, but I can confirm that
> it does work :-)  It's a nice hack around a deficiency in cmake.  I ended up
> using this code:
> 
> # First create a dummy library to hang the pthreads
> # dependency on via the IMPORTED_LINK_INTERFACE_LIBRARIES property.
> file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pthreads_dummy.c "")
> add_library(pthreads_dummy STATIC
> ${CMAKE_CURRENT_BINARY_DIR}/pthreads_dummy.c)
> 
> # make sure the dummy library gets built
> add_dependencies(systemc pthreads_dummy)
> 
> # export the dummy library so we can include it as an imported target
> export(TARGETS pthreads_dummy NAMESPACE imported FILE
> importedpthreads_dummy.cmake)
> include(${CMAKE_CURRENT_BINARY_DIR}/importedpthreads_dummy.cmake)
> 
> # use the imported target to add pthread dependency for the DEBUGPTHREADS
> config
> set_target_properties(importedpthreads_dummy
> PROPERTIES
> IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUGPTHREADS ${PTHREADS_LIBRARIES})
> 
> target_link_libraries(myLib importedpthreads_dummy)
> 
> which is a lot of extra lines when all I really want is something like this:
> 
> target_link_libraries(myLib CONFIG DebugPthreads pthreads)

Yes, absolutely. Although setups with libraries which are needed in some
configurations only are quite rare, AFAIK, your case shows that this may
well happen. ;-) Possible - and more appropriate - solutions could be:

- New target properties, say, EXTRA_LINK_LIBRARIES[_] that
  are just added to the respective targets' link command lines.
- Permission of empty or absent IMPORTED_LOCATION[_]
  properties; with these, you might just have said

ADD_LIBRARY(pthreads SHARED IMPORTED)
SET_TARGET_PROPERTIES(pthreads PROPERTIES
IMPORTED_LOCATION_DEBUGPTHREADS ${PTHREADS_LIBRARIES})
TARGET_LINK_LIBRARIES(myLib pthreads)

and that's it. Perhaps, this would be worth a feature request.

Regards,

Michael

> On 26 April 2011 15:15, Michael Hertling  wrote:
> 
>>
>> There is a possibility with an intermediate empty static library which
>> gets reimported into the project and equipped with the target property
>> IMPORTED_LINK_INTERFACE_LIBRARIES_, but I don't know if that
>> approach will please you... ;) Anyway, see [1] for the details.
>>
>> Regards,
>>
>> Michael
>>
>> [1] http://www.mail-archive.com/cmake@cmake.org/msg34680.html
>>
>> PS: Empty static libraries aren't allowed on Windows; use
>>
>> FILE(WRITE ${CMAKE_BINARY_DIR}/dummy.c "")
>> ADD_LIBRARY(dummy STATIC dummy.c)
>>
>> to satisfy the Visual Studio tools.
___
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] ProjectConfig.cmake files with both dynamic and static libraries?

2011-05-05 Thread Michael Hertling
On 05/04/2011 02:30 PM, Ben Morgan wrote:
> Hi,
> 
> I've been working on adding Config.cmake support to my CMake based
> projects, and just had a quick question regarding 'best practice' in writing
> these when the project builds both dynamic and (optionally) static
> libraries, with clients of the project wishing to choose one or the other.
> 
> Thanks to the ProjectConfig tutorial on the Wiki :-), I've got the basic
> files for a test project 'mlvl' working nicely from the build and install
> trees.
> By default, mlvl builds a dynamic library with a user option to additionally
> build a static version, hence the mlvlLibraryDepends.cmake files
> have the imported targets
> 
> mlvl
> mlvl-static
> 
> though the mlvl-static target will only be present if the build static
> option was enabled. The relevant section of my mlvlConfig.cmake.in file
> then contains
> 
> 
> include("@mlvl_CMAKE_DIR@/mlvlLibraryDepends.cmake")
> 
> set(mlvl_LIBRARY mlvl)
> 
> set(mlvl_LIBRARY_STATIC "mlvl_LIBRARY_STATIC-NOTFOUND")
> if(TARGET mlvl-static)
> set(mlvl_LIBRARY_STATIC mlvl-static)
> endif()
> 
> if(mlvl_USE_STATIC)
> if(mlvl_LIBRARY_STATIC)
> set(mlvl_LIBRARIES ${mlvl_LIBRARY_STATIC})
> else()
> message(WARNING "no static build of mlvl available, falling back to
> use dynamic library")
> set(mlvl_LIBRARIES ${mlvl_LIBRARY})
> endif()
> else()
> set(mlvl_LIBRARIES ${mlvl_LIBRARY})
> endif()
> 
> 
> where mlvl_USE_STATIC is a variable clients of mlvl can set before calling
> find_package. This seems to work o.k., but I'm a
> little unsure about:
> 
> a) if it looks reasonable, and within the scope of what a Config.cmake
> script is supposed to do (my impression from reading the lists
> is that they're supposed to be very simple...).
> 
> b) If a FATAL_ERROR could/should be issued if the client has requested use
> of the static library but the install of mlvl that's been found doesn't have
> it.
> 
> Replacing message(WARNING ...) with message(FATAL_ERROR ...) does work, and
> I'm not sure if this should be done within the config script or
> whether I should just leave it up to the client to decide what to do post
> the find_package call - it would seem within the spirit of module mode
> find_package to emit a FATAL_ERROR if both mlvl_USE_STATIC is set and
> find_package was called with REQUIRED...?
> 
> I realize I could make my life much easier by always building both libraries
> ;-), but I'm interested in the limits of what should be done in a
> ProjectConfig.cmake
> file versus how much responsibility to pass onto the user.. This seems to
> relate to previous discussions on this list about how to write config files
> for
> projects with components or/and using external third-party packages, though
> I didn't find a definitive answer (apologies if I missed an obvious
> posting...).
> 
> Thanks,
> 
> Ben.

IMO, your approach looks quite reasonable; however, I'm not completely
happy with it... ;) Please note that the following remarks are just my
personal point of view, and of course, one can have different notions.

The information if there is a static library is already available at
mlvl's configuration time, so there's no actual need for the config
file to make a dynamic decision, i.e. "if(TARGET mlvl-static)" and
"if(mlvl_LIBRARY_STATIC)"; this is typically done by find modules.
Instead, one might consider to hard-code the affected passages,
e.g. as an additional include file next to the export file:

# mlvlConfig.cmake.in:
include("@mlvl_CMAKE_DIR@/mlvlLibraryDepends.cmake")
include("@mlvl_CMAKE_DIR@/mlvlLibrarySetup.cmake")
set(mlvl_LIBRARIES ${mlvl_LIBRARY})

# mlvlLibrarySetup.cmake with mlvl-static:
if(mlvl_USE_STATIC)
set(mlvl_LIBRARY mlvl-static CACHE STRING "...")
else()
set(mlvl_LIBRARY mlvl CACHE STRING "...")
endif()

# mlvlLibrarySetup.cmake w/o mlvl-static:
if(mlvl_USE_STATIC)
if(mlvl_FIND_REQUIRED)
message(FATAL_ERROR "no static build of...")
elseif(NOT mlvl_FIND_QUIETLY)
message(WARNING "no static build of...")
endif()
endif()
set(mlvl_LIBRARY mlvl CACHE STRING "...")

During mlvl's configuration, you decide which mlvlLibrarySetup.cmake
file is installed along with mlvlConfig.cmake. In this way, you even
get rid of the rather unusual mlvl_LIBRARY_STATIC variable, provided
that the project's users are not to refer to the shared *and* static
library at the same time. Additionally, the entire stuff gets a bit
simpler. BTW, variables as mlvl_LIBRARY should definitely be cached.

Having said that, an alternative solution would be a multi-component
package with shared and static library components, e.g. as follows:

# mlvlConfig.cmake.in:
include("@mlvl_CMAKE_DIR@/mlvlLibraryDepends.cmake")
# Handle default component(s):
if(NOT mlvl_FIND_COMPONENTS)
set(mlvl_FIND_COMPONENTS shared)
set(mlvl_FIND_REQUIRED_shared true)
endif()
# Handle inter-component dependencies:
if(mlvl_FIND_REQUIRED_shared AND mlvl_FIND_REQUIRED_static)

Re: [CMake] RPM packages and install(SCRIPT...)

2011-05-05 Thread Eric Noulard
2011/5/5 Judicaël Bedouet :
> Hi,

Hi Judicaël,

> I use install(SCRIPT...) to make links during installation. It works with a
> normal installation (make install) but the script seems not to be executed
> by CPack or CPack RPM (I have not tested other generators). I could solve
> the problem by making a specific RPM spec but the post-install code would be
> duplicated in two files.
>
> Is it intended that CPack doesn't execute install(SCRIPT...) ?

In fact it does but you did not see what happened.
Your install script:

execute_process(
  COMMAND ${CMAKE_COMMAND} -E create_symlink file link
  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/TestLink
  )

does not support DESTDIR, which is used by CPack in order to install locally
(inside build/_CPack_Packages ... )
before packaging.

You should use:
execute_process(
  COMMAND ${CMAKE_COMMAND} -E create_symlink file link
  WORKING_DIRECTORY $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/TestLink
  )

and this should work in both cases (make install and CPack run).

> Is there a better way to create links between files ?

>From a "pure" RPM perspective you should write an RPM post install script
and
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "your-script.sh")
now I understand you want to have a single script for all package format
so the INSTALL(SCRIPT ...) should work for all of them as soon as
symlinks are supported (which may not be the case on Windows).


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Enabling C++0x support

2011-05-05 Thread Alexander Neundorf
On Wednesday 04 May 2011, Guido Winkelmann wrote:
> Hi,
> 
> Is there a way to specify, in a cross-platform compatible manner, that a
> given C++ source file (or a target or an entire project) requires support
> for C++ 0x, so that whatever compiler flags would be necessary for that

No, cmake doesn't offer such generic flags.
The only thing it has is such a generic setting for IPO optimization, but I 
think that's about it.

Alex
___
Powered by www.kitware.com

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

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

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


[CMake] copile error cmake-2.8.4

2011-05-05 Thread Mizuho Matsunaga
Hi all

I compile cmake-2.8.4 on Sparc Solaris10 by solstudio12.2.
But this error occured.

Linking CXX executable ../bin/ccmake
ld: warning: file /lib/64/libmvec.so: linked to /usr/lib/sparcv9/libmvec.so: 
attempted multiple inclusion of file
Undefined   first referenced
 symbol in file
archive_write_set_format_pax_restricted libCMakeLib.a(cmArchiveWrite.o)
ld: fatal: Symbol referencing errors. No output written to ../bin/ccmake
gmake[2]: *** [bin/ccmake] Error 2
gmake[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2
gmake: *** [all] Error 2

What library is this ?
I search web site. I don't found this error on Solaris (Only BSD).

Please teach me!

松永 瑞穂 - Mizuho Matsunaga - 

___
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] CTest dependencies on tests

2011-05-05 Thread Neil Chittenden

On 05/05/11 16:46, David Cole wrote:



On Thu, May 5, 2011 at 11:10 AM, Neil Chittenden
mailto:neilchitten...@quintessa.org>> wrote:

Hi

Using CTest, it is possible to set a dependency on another test using:

  add_test(test1 test1.sh this is test 1)
  add_test(test2 test2.sh this is test 2)
  set_tests_properties(test1 PROPERTIES DEPENDS test2)

Is it possible to:
a) only run a test (test1 in my example) if the test it depends on
(test2) is successful rather than always running the test


No. The DEPENDS clause simply indicates the order of the test runs. But
ctest will always attempt to run all tests. (Unless you limit it from
the ctest command line via index, label or name matching, i.e., with -I
or -L or -R)


b) set an expected return code for the test. e.g. test1 is only
successful if it returns 1 and returning 0 or 2 is a fail.


No. ctest uses 0 == no error == pass, and non-0 == error == fail. You
can invert the sense of it with the WILL_FAIL property. But there is
currently no mechanism for specifying an exact expected return value.


I know I could handle these in my test scripts but was just
wondering if there was a more elegant solution using CTest.

Cheers
---
Neil


Handling it in your scripts is the best way to go right now.


HTH,
David


OK, thanks for the info.

---
Neil
___
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] RPM packages and install(SCRIPT...)

2011-05-05 Thread Judicaël Bedouet
Hi,

I use install(SCRIPT...) to make links during installation. It works with a
normal installation (make install) but the script seems not to be executed
by CPack or CPack RPM (I have not tested other generators). I could solve
the problem by making a specific RPM spec but the post-install code would be
duplicated in two files.

Is it intended that CPack doesn't execute install(SCRIPT...) ? Is there a
better way to create links between files ?

Thanks,

J. Bedouet

P.S. My little test below


mkdir build
/opt/cmake-2.8.4/bin/cmake -D CMAKE_INSTALL_PREFIX=../install ..
make install

ls -l ../install/share/TestLink/
total 4
-rw-r--r-- 1   16 May  5 17:18 file
lrwxrwxrwx 1    4 May  5 17:31 link -> file

cpack -G RPM

rpm -qlp TestLink-0.1.1-Linux.rpm
/usr/share/TestLink/file
cmake_minimum_required(VERSION 2.6)

project(TestLink)

install(FILES file DESTINATION share/TestLink)
install(SCRIPT script)

include(CPack)


file
Description: Binary data


script
Description: Binary data
___
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] CTest dependencies on tests

2011-05-05 Thread David Cole
On Thu, May 5, 2011 at 11:10 AM, Neil Chittenden <
neilchitten...@quintessa.org> wrote:

> Hi
>
> Using CTest, it is possible to set a dependency on another test using:
>
>  add_test(test1 test1.sh this is test 1)
>  add_test(test2 test2.sh this is test 2)
>  set_tests_properties(test1 PROPERTIES DEPENDS test2)
>
> Is it possible to:
> a) only run a test (test1 in my example) if the test it depends on (test2)
> is successful rather than always running the test
>

No. The DEPENDS clause simply indicates the order of the test runs. But
ctest will always attempt to run all tests. (Unless you limit it from the
ctest command line via index, label or name matching, i.e., with -I or -L or
-R)



> b) set an expected return code for the test. e.g. test1 is only successful
> if it returns 1 and returning 0 or 2 is a fail.
>

No. ctest uses 0 == no error == pass, and non-0 == error == fail. You can
invert the sense of it with the WILL_FAIL property. But there is currently
no mechanism for specifying an exact expected return value.


>
> I know I could handle these in my test scripts but was just wondering if
> there was a more elegant solution using CTest.
>
> Cheers
> ---
> Neil
>

Handling it in your scripts is the best way to go right now.


HTH,
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
>
___
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] CTest dependencies on tests

2011-05-05 Thread Neil Chittenden

Hi

Using CTest, it is possible to set a dependency on another test using:

  add_test(test1 test1.sh this is test 1)
  add_test(test2 test2.sh this is test 2)
  set_tests_properties(test1 PROPERTIES DEPENDS test2)

Is it possible to:
a) only run a test (test1 in my example) if the test it depends on 
(test2) is successful rather than always running the test
b) set an expected return code for the test. e.g. test1 is only 
successful if it returns 1 and returning 0 or 2 is a fail.


I know I could handle these in my test scripts but was just wondering if 
there was a more elegant solution using CTest.


Cheers
---
Neil
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Changing installation prefix triggers re-linking of all libraries

2011-05-05 Thread Pere Mato Vila


> If I understand correctly, it's this second point which causes your
> astonishment, but it already happens during the build phase in the
> build tree, not just when installing with "make install", right?

Yes,  this is indeed my astonishment. I understand that for 'normal' projects 
this re-link in the build tree will be almost unnoticeable. Unfortunately in 
our project we build at least one executable using these libraries that is a 
code generator and therefore all generated code for many other libraries gets 
regenerated, re-compiled and re-linked. It is a major re-build just for 
changing the length of the installation directory. So, I see that the only 
solution I have is to avoid using CMAKE_INSTALL_RPATH. Thanks very much for 
your explanations.
Regards,

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] Alternative toolchains? (alchemy, android ndk)

2011-05-05 Thread Michael Wild
On 05/05/2011 03:44 PM, Doug wrote:
> I've seen a few things that use alternative gnu toolchains to build things.
> 
> I haven't been able to figure out how to do this with cmake. Has anyone
> managed?
> 
> Examples:
> http://labs.adobe.com/technologies/alchemy/
> http://developer.android.com/sdk/ndk/index.html
> 
> Basically it seems I somehow need to cutout the root /usr/include and pass a
> new one in, as well as a specific alternative version of gcc; but I can't
> figure out how to do that in the cmake directives...
> 
> ~
> Doug.

I'm by no means a cross-compiling expert, but from what I know, you have
to provide a toolchain-file specifying the root directory containing the
toolchain (compilers, headers, libraries etc.), the target system name,
etc. The CMake WIKI [1] should be able to help you further. For Android
there's a project trying to build a common set of scripts and utilities [2].

HTH

Michael

[1] http://www.cmake.org/Wiki/CMake_Cross_Compiling
[2] http://code.google.com/p/android-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] Alternative toolchains? (alchemy, android ndk)

2011-05-05 Thread Doug
I've seen a few things that use alternative gnu toolchains to build things.

I haven't been able to figure out how to do this with cmake. Has anyone
managed?

Examples:
http://labs.adobe.com/technologies/alchemy/
http://developer.android.com/sdk/ndk/index.html

Basically it seems I somehow need to cutout the root /usr/include and pass a
new one in, as well as a specific alternative version of gcc; but I can't
figure out how to do that in the cmake directives...

~
Doug.
___
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] 'recursive' or multiple level @@ replacement in configure_file

2011-05-05 Thread David Cole
On Thu, May 5, 2011 at 7:08 AM, J.S. van Bethlehem <
j.s.van.bethle...@astro.rug.nl> wrote:

> Hello,
>
> Today I was trying something along the following lines:
> in CMakeLists.txt
> set(BASENAME some_text)
> set(${BASENAME}_DIR /some/path)
> set(${BASENAME}_SHARE /some/other/path)
> set(${BASENAME}_INCLUDES file1.h;file2.h;file3.h)
> configure_file(config.h.in config.h @ONLY)
>
> and in config.h.in do:
> set(INSTALL_PATH @@BASENAME@_DIR@)
> foreach(incl ${INSTALL_PATH})
> # do something
> endforeach(incl ${INSTALL_PATH})
>
> My expectation was that first @BASENAME@ would evaluate to 'some_text'
> after which @some_text_DIR@ would evaluate to the respective value. This
> fails, so the obvious question is: am I trying something that is simply not
> possible, or should I use different syntax to accomplish this?
>
> Yours sincerely,
> Jakob van Bethlehem
> ___
> 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
>


Why are you putting CMake script code into the file config.h.in?

Seems like you want to generate the .h.in file based on a CMake loop, and
*then* use it in a configure_file call...

What do you want the final .h file to look like?
___
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] license

2011-05-05 Thread Adolfo Rodríguez Tsouroukdissian
On Thu, May 5, 2011 at 1:48 PM, gekso  wrote:

> Hello! Please help me to find details on the license about use of
> CMake in commercial product. Is it BSD?
>

 http://cmake.org/cmake/project/license.html

HTH,

-- 
Adolfo Rodríguez Tsouroukdissian

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
contain confidential information which is privileged and intended only for
the individual or entity to whom they are addressed.  If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution or use of this e-mail and/or accompanying document(s) is
strictly prohibited.  If you have received this e-mail in error, please
immediately notify the sender at the above e-mail address.
___
Powered by www.kitware.com

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

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

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

[CMake] license

2011-05-05 Thread gekso
Hello! Please help me to find details on the license about use of
CMake in commercial product. Is it BSD?
Thanks.
___
Powered by www.kitware.com

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

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

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


[CMake] 'recursive' or multiple level @@ replacement in configure_file

2011-05-05 Thread J.S. van Bethlehem

Hello,

Today I was trying something along the following lines:
in CMakeLists.txt
set(BASENAME some_text)
set(${BASENAME}_DIR /some/path)
set(${BASENAME}_SHARE /some/other/path)
set(${BASENAME}_INCLUDES file1.h;file2.h;file3.h)
configure_file(config.h.in config.h @ONLY)

and in config.h.in do:
set(INSTALL_PATH @@BASENAME@_DIR@)
foreach(incl ${INSTALL_PATH})
# do something
endforeach(incl ${INSTALL_PATH})

My expectation was that first @BASENAME@ would evaluate to 'some_text' 
after which @some_text_DIR@ would evaluate to the respective value. This 
fails, so the obvious question is: am I trying something that is simply 
not possible, or should I use different syntax to accomplish this?


Yours sincerely,
Jakob van Bethlehem
___
Powered by www.kitware.com

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

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

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


Re: [CMake] How to add a target link library, but only for a custom configuration ?

2011-05-05 Thread Glenn Coombs
Thanks for that link Michael.  It doesn't please me, but I can confirm that
it does work :-)  It's a nice hack around a deficiency in cmake.  I ended up
using this code:

# First create a dummy library to hang the pthreads
# dependency on via the IMPORTED_LINK_INTERFACE_LIBRARIES property.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pthreads_dummy.c "")
add_library(pthreads_dummy STATIC
${CMAKE_CURRENT_BINARY_DIR}/pthreads_dummy.c)

# make sure the dummy library gets built
add_dependencies(systemc pthreads_dummy)

# export the dummy library so we can include it as an imported target
export(TARGETS pthreads_dummy NAMESPACE imported FILE
importedpthreads_dummy.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/importedpthreads_dummy.cmake)

# use the imported target to add pthread dependency for the DEBUGPTHREADS
config
set_target_properties(importedpthreads_dummy
PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUGPTHREADS ${PTHREADS_LIBRARIES})

target_link_libraries(myLib importedpthreads_dummy)

which is a lot of extra lines when all I really want is something like this:

target_link_libraries(myLib CONFIG DebugPthreads pthreads)

--
Glenn


On 26 April 2011 15:15, Michael Hertling  wrote:

>
> There is a possibility with an intermediate empty static library which
> gets reimported into the project and equipped with the target property
> IMPORTED_LINK_INTERFACE_LIBRARIES_, but I don't know if that
> approach will please you... ;) Anyway, see [1] for the details.
>
> Regards,
>
> Michael
>
> [1] http://www.mail-archive.com/cmake@cmake.org/msg34680.html
>
> PS: Empty static libraries aren't allowed on Windows; use
>
> FILE(WRITE ${CMAKE_BINARY_DIR}/dummy.c "")
> ADD_LIBRARY(dummy STATIC dummy.c)
>
> to satisfy the Visual Studio tools.
> ___
> 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