kdeexamples buildsystem

Alexander Neundorf neundorf at kde.org
Fri Jul 15 21:37:03 CEST 2011


Hi,

On Friday 15 July 2011, Michael Jansen wrote:
> Hi
> 
> I pushed a small project to git at git.kde.org:scratch/mjansen/cmake_test .
> That should be git://anongit.kde.org/scratch/mjansen/cmake_test for you to
> clone (in a while after anongit catches up).
> 
> It contains 2 projects. A small helloworld lib and a binary using it. In
> the toplevel is a makefile that builds the projects in different
> configurations and shows what works and what not works. Have a look
> inside.
> 
> The case that now works is building the lib in 32bit and trying to compile
> it in 64bit (At least here in OpenSuSE). The find_library call accepts the
> 32bit lib and naturally the linking fails later.

please try whether it improves the situation for you if the buildsystem 
example in kdeexamples uses the attached file instead of as it is currently in 
git.
It additionally compares the 32/64bit of the installed version with the 
currently 32/64bitness of the currently searching project, and succeeds only 
if it matches.

Alex
-------------- next part --------------
# This is a very basic file for the new style find_package() search mode,
# i.e. Config-mode.
# In this mode find_package() searches for a <package>Config.cmake
# file and an associated <package>Version.cmake file, which it loads to check
# the version number.
# This file can be used with configure_file() to generate such a file for a project
# with very basic logic.
# It sets PACKAGE_VERSION_EXACT if the current version string and the requested
# version string are exactly the same and it sets PACKAGE_VERSION_COMPATIBLE
# if the current version is >= requested version.
# If this is not good enough for your project, you need to write your own
# improved <package>Version.cmake file.


set(PACKAGE_VERSION @BAR_VERSION_MAJOR at .@BAR_VERSION_MINOR at .@BAR_VERSION_PATCH@)

if(NOT "@CMAKE_SIZEOF_VOID_P@"  STREQUAL "${CMAKE_SIZEOF_VOID_P}")
   math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
   set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
#   return()
#endif()
else()

if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
   set(PACKAGE_VERSION_COMPATIBLE TRUE)
   if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
      set(PACKAGE_VERSION_EXACT TRUE)
   endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )

endif()


More information about the Kde-buildsystem mailing list