Overview
Features
Download
Documentation
Community
Add-Ons & Services

Cmake & libfind

Discussion of ideas for features and new projects based on POCO.

Cmake & libfind

Postby p47l4f0n » 28 Feb 2010, 21:52

Hi,

I am starting to use Cmake and there exists some scripts, which search for the required libraries in the project you develop. And here: http://zi.fi/cmake/Modules/ are already some. Why not to add a new one for POCO there? Unfortunatelly there is no contatct to the owner of the site.. Does someone knows the owner? :D

Does someone has similar cmake file?
Y35, I'm 4 n00b !
p47l4f0n
 
Posts: 12
Joined: 17 Feb 2010, 22:25

FindPocoFoundation.cmake

Postby p47l4f0n » 28 Feb 2010, 22:11

Now, this is what I wrote, but it's not working :( Please, does someone knows where could be the problem? thx

Note: File FindPocoFoundation.cmake is included in CMakeLists.txt.

FindPocoFoundation.cmake:
Code: Select all
# - Try to find POCOFoundation library
# Once done, this will define
#
#  POCOFoundation_FOUND - system has POCOFoundation
#  POCOFoundation_INCLUDE_DIRS - the POCOFoundation include directories
#  POCOFoundation_LIBRARIES - link these to use POCOFoundation
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

#libfind_pkg_check_modules(POCOFoundation_PKGCONF pocofoundation)

find_path(POCOFoundation_INCLUDE_DIR
  NAMES Poco/Foundation.h
  PATHS ${POCOFoundation_PKGCONF_INCLUDE_DIRS}
)

find_library(POCOFoundation_LIBRARY
  NAMES pocofoundation
  PATHS ${POCOFoundation_PKGCONF_LIBRARY_DIRS}
)

set(POCOFoundation_PROCESS_INCLUDES POCOFoundation_INCLUDE_DIR)
set(POCOFoundation_PROCESS_LIBS POCOFoundation_LIBRARY)
libfind_process(POCOFoundation)


edit: Partialy solved :!:
This doesn't work, but now I don't know how to use packages and wtf is it.
Code: Select all
libfind_pkg_check_modules(POCOFoundation_PKGCONF pocofoundation)
Y35, I'm 4 n00b !
p47l4f0n
 
Posts: 12
Joined: 17 Feb 2010, 22:25

!! UPDATE !!

Postby p47l4f0n » 01 Mar 2010, 13:05

Everything was wrong :!: :roll:

But this is really working:

FindPocoFoundation.cmake:
Code: Select all
# - Try to find POCOFoundation library
# Once done, this will define
#
#  POCOFoundation_FOUND - system has POCOFoundation
#  POCOFoundation_INCLUDE_DIRS - the POCOFoundation include directories
#  POCOFoundation_LIBRARIES - link these to use POCOFoundation
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

find_path(POCOFoundation_INCLUDE_DIR
  NAMES Poco/Foundation.h
  PATHS ${POCOFoundation_PKGCONF_INCLUDE_DIRS}
)

find_library(POCOFoundation_LIBRARY
  NAMES PocoFoundation
  PATHS ${POCOFoundation_PKGCONF_LIBRARY_DIRS}
)

set(POCOFoundation_PROCESS_INCLUDES POCOFoundation_INCLUDE_DIR)
set(POCOFoundation_PROCESS_LIBS POCOFoundation_LIBRARY)
libfind_process(POCOFoundation)


:mrgreen:
Y35, I'm 4 n00b !
p47l4f0n
 
Posts: 12
Joined: 17 Feb 2010, 22:25

Re: Cmake & libfind

Postby itfront » 02 Jun 2010, 10:20

p47l4f0n wrote:Hi,

I am starting to use Cmake and there exists some scripts, which search for the required libraries in the project you develop. And here: http://zi.fi/cmake/Modules/ are already some. Why not to add a new one for POCO there? Unfortunatelly there is no contatct to the owner of the site.. Does someone knows the owner? :D

Does someone has similar cmake file?


I recommend the waf (http://code.google.com/p/waf),it's really a morden build system,power by python!!
CMake is the old style,especially its ugly syntax!CMake create a new language for build that is a bad design,just like recreate the wheel!
itfront
 
Posts: 1
Joined: 02 Jun 2010, 05:38


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 0 guests