From b5c90a21f289bb67c4806a8563d96fc674bba583 Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Tue, 24 Apr 2012 08:53:21 +0200 Subject: pylon (basler) camera added --- cmake/FindPylon.cmake | 47 +++++++++++++++++++++++++++++++++++++++++++++++ cmake/FindYAT.cmake | 6 ++++++ 2 files changed, 53 insertions(+) create mode 100644 cmake/FindPylon.cmake create mode 100644 cmake/FindYAT.cmake (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake new file mode 100644 index 0000000..f446df2 --- /dev/null +++ b/cmake/FindPylon.cmake @@ -0,0 +1,47 @@ + +# Try to find libpco.so +# +# Defines +# +# PCO_FOUND - system has libpco +# PCO_INCLUDE_DIRS - libpco include directory +# PCO_LIBRARIES - pco library + +find_package(YAT) + +find_package(PackageHandleStandardArgs) + +find_path(PYLON_DIRS include/pylon/PylonBase.h HINTS /opt/pylon ENV PYLON_ROOT) +set(GENICAM_ROOT ${PYLON_DIRS}/genicam) +set(PYLON_INCLUDE_DIRS ${PYLON_DIRS}/include ${GENICAM_ROOT}/library/CPP/include) + +# check for 32/64 bit +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(PYLON_LIB_DIRS ${PYLON_DIRS}/lib64 ${PYLON_DIRS}/bin ${GENICAM_ROOT}/bin/Linux64_x64 + ${GENICAM_ROOT}/bin/Linux64_x64/GenApi/Generic) +else() + set(PYLON_LIB_DIRS ${PYLON_DIRS}/lib64 ${PYLON_DIRS}/bin ${GENICAM_ROOT}/bin/Linux32_i86 + ${GENICAM_ROOT}/bin/Linux32_i86/GenApi/Generic) +endif() + +find_library(PYLONBASE_LIB pylonbase PATHS ${PYLON_LIB_DIRS}) +find_library(PYLONUTILITY_LIB pylonutility PATHS ${PYLON_LIB_DIRS}) +find_library(PYLONGIGESUPP_LIB pylongigesupp PATHS ${PYLON_LIB_DIRS}) +find_library(GENAPI_LIB GenApi_gcc40_v2_1 PATHS ${PYLON_LIB_DIRS}) +find_library(GCBASE_LIB GCBase_gcc40_v2_1 PATHS ${PYLON_LIB_DIRS}) +set (PYLON_LIBS ${PYLONBASE_LIB} + ${PYLONUTILITY_LIB} + ${PYLONGIGESUPP_LIB} + ${GENAPI_LIB} + ${GCBASE_LIB} + ${YAT_LIB}) + +find_package_handle_standard_args(PYLON DEFAULT_MSG PYLON_LIBS PYLON_INCLUDE_DIRS) + +find_package(PkgConfig) +pkg_check_modules(BASLER_PYLON baslerpylon>=0.1.0 REQUIRED) +MESSAGE(LIBRARY_DIRS ${BASLER_PYLON_LIBRARY_DIRS}) +find_library(BASLERPYLON_LIB baslerpylon PATHS ${BASLER_PYLON_LIBRARY_DIRS}) + +#set (PYLON_LIBS ${PYLON_LIBS} ${BASLERPYLON_LIB}) + diff --git a/cmake/FindYAT.cmake b/cmake/FindYAT.cmake new file mode 100644 index 0000000..92da3c8 --- /dev/null +++ b/cmake/FindYAT.cmake @@ -0,0 +1,6 @@ + +find_package(PkgConfig) +pkg_check_modules(YAT yat>=1.7.7 REQUIRED) + +find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS}) + -- cgit v1.2.3 From 38d6d18e83b0c33a18ef6f68c22c161d39abc449 Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Tue, 8 May 2012 14:49:11 +0200 Subject: basler camera works --- cmake/FindPylon.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index f446df2..142f432 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -43,5 +43,5 @@ pkg_check_modules(BASLER_PYLON baslerpylon>=0.1.0 REQUIRED) MESSAGE(LIBRARY_DIRS ${BASLER_PYLON_LIBRARY_DIRS}) find_library(BASLERPYLON_LIB baslerpylon PATHS ${BASLER_PYLON_LIBRARY_DIRS}) -#set (PYLON_LIBS ${PYLON_LIBS} ${BASLERPYLON_LIB}) +set (PYLON_LIBS ${PYLON_LIBS} ${BASLERPYLON_LIB}) -- cgit v1.2.3 From 0b5720d0414f7e9f196664677899e999179a49f6 Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Wed, 1 Aug 2012 14:06:50 +0200 Subject: extracted pylon_camera C-wrapper into own project; enhanced cmake build for pylon cameras --- cmake/FindPylon.cmake | 55 +++++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index 142f432..be3ce85 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -3,45 +3,30 @@ # # Defines # -# PCO_FOUND - system has libpco -# PCO_INCLUDE_DIRS - libpco include directory -# PCO_LIBRARIES - pco library +# PYLON_FOUND - system has libpco +# PYLON_INCLUDE_DIR - libpco include directory +# PYLON_LIB - pco library -find_package(YAT) +# check for environment variable PYLON_ROOT +message("DEFINED PYLON ROOT $ENV{PYLON_ROOT}") +if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") + message("PYLON_ROOT=$ENV{PYLON_ROOT}") + set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:$ENV{PYLON_ROOT}/lib") + set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/lib64") + set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux64_x64") + set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux32_i86") -find_package(PackageHandleStandardArgs) -find_path(PYLON_DIRS include/pylon/PylonBase.h HINTS /opt/pylon ENV PYLON_ROOT) -set(GENICAM_ROOT ${PYLON_DIRS}/genicam) -set(PYLON_INCLUDE_DIRS ${PYLON_DIRS}/include ${GENICAM_ROOT}/library/CPP/include) + find_package(YAT) + find_package(PackageHandleStandardArgs) -# check for 32/64 bit -if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(PYLON_LIB_DIRS ${PYLON_DIRS}/lib64 ${PYLON_DIRS}/bin ${GENICAM_ROOT}/bin/Linux64_x64 - ${GENICAM_ROOT}/bin/Linux64_x64/GenApi/Generic) -else() - set(PYLON_LIB_DIRS ${PYLON_DIRS}/lib64 ${PYLON_DIRS}/bin ${GENICAM_ROOT}/bin/Linux32_i86 - ${GENICAM_ROOT}/bin/Linux32_i86/GenApi/Generic) -endif() - -find_library(PYLONBASE_LIB pylonbase PATHS ${PYLON_LIB_DIRS}) -find_library(PYLONUTILITY_LIB pylonutility PATHS ${PYLON_LIB_DIRS}) -find_library(PYLONGIGESUPP_LIB pylongigesupp PATHS ${PYLON_LIB_DIRS}) -find_library(GENAPI_LIB GenApi_gcc40_v2_1 PATHS ${PYLON_LIB_DIRS}) -find_library(GCBASE_LIB GCBase_gcc40_v2_1 PATHS ${PYLON_LIB_DIRS}) -set (PYLON_LIBS ${PYLONBASE_LIB} - ${PYLONUTILITY_LIB} - ${PYLONGIGESUPP_LIB} - ${GENAPI_LIB} - ${GCBASE_LIB} - ${YAT_LIB}) + find_path(PYLON_INCLUDE_DIR libpyloncam/pylon_camera.h) + find_library(PYLON_LIB pyloncam) -find_package_handle_standard_args(PYLON DEFAULT_MSG PYLON_LIBS PYLON_INCLUDE_DIRS) + message("INCLUDE ${PYLON_INCLUDE_DIR}") -find_package(PkgConfig) -pkg_check_modules(BASLER_PYLON baslerpylon>=0.1.0 REQUIRED) -MESSAGE(LIBRARY_DIRS ${BASLER_PYLON_LIBRARY_DIRS}) -find_library(BASLERPYLON_LIB baslerpylon PATHS ${BASLER_PYLON_LIBRARY_DIRS}) - -set (PYLON_LIBS ${PYLON_LIBS} ${BASLERPYLON_LIB}) + find_package_handle_standard_args(PYLON DEFAULT_MSG PYLON_LIB PYLON_INCLUDE_DIR) +else() + message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support") +endif() -- cgit v1.2.3 From 6683a6e9a6fc0259d5e5dfd97279680e292d7938 Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Wed, 1 Aug 2012 14:58:46 +0200 Subject: fixed pylon build --- cmake/FindPylon.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index be3ce85..9c678bc 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -8,7 +8,9 @@ # PYLON_LIB - pco library # check for environment variable PYLON_ROOT -message("DEFINED PYLON ROOT $ENV{PYLON_ROOT}") +find_package(YAT) +find_package(PkgConfig) + if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") message("PYLON_ROOT=$ENV{PYLON_ROOT}") set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:$ENV{PYLON_ROOT}/lib") @@ -16,16 +18,16 @@ if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux64_x64") set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux32_i86") + pkg_check_modules(LIBPYLONCAM pyloncam>=0.1 REQUIRED) - find_package(YAT) + find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS}) find_package(PackageHandleStandardArgs) - find_path(PYLON_INCLUDE_DIR libpyloncam/pylon_camera.h) - find_library(PYLON_LIB pyloncam) - - message("INCLUDE ${PYLON_INCLUDE_DIR}") + find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) - find_package_handle_standard_args(PYLON DEFAULT_MSG PYLON_LIB PYLON_INCLUDE_DIR) + mark_as_advanced( + LIBPYLONCAM_INCLUDEDIR + LIBPYLONCAM_LIBRARIES) else() message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support") -- cgit v1.2.3 From c22c7e1254228c43cc56eecb03bd6ac171768a0d Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Thu, 2 Aug 2012 10:22:28 +0200 Subject: use LIBPYLONCAM_OTHER_PREFIX to change prefix found with pkg-config --- cmake/FindPylon.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index 9c678bc..a8b7182 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -10,6 +10,7 @@ # check for environment variable PYLON_ROOT find_package(YAT) find_package(PkgConfig) +find_package(PackageHandleStandardArgs) if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") message("PYLON_ROOT=$ENV{PYLON_ROOT}") @@ -21,13 +22,18 @@ if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") pkg_check_modules(LIBPYLONCAM pyloncam>=0.1 REQUIRED) find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS}) - find_package(PackageHandleStandardArgs) find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) mark_as_advanced( LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) + if (DEFINED LIBPYLONCAM_OTHER_PREFIX) + string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} + LIBPYLONCAM_INCLUDEDIR ${LIBPYLONCAM_INCLUDEDIR}) + string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} + LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES}) + endif() else() message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support") -- cgit v1.2.3 From a48438344b1e36588ded72a2bb3ca5c309c3d656 Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Thu, 2 Aug 2012 10:34:23 +0200 Subject: enhanced usage of LIBPYLONCAM_OTHER_PREFIX --- cmake/FindPylon.cmake | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index a8b7182..fc9624b 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -14,20 +14,10 @@ find_package(PackageHandleStandardArgs) if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") message("PYLON_ROOT=$ENV{PYLON_ROOT}") - set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:$ENV{PYLON_ROOT}/lib") - set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/lib64") - set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux64_x64") - set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux32_i86") - - pkg_check_modules(LIBPYLONCAM pyloncam>=0.1 REQUIRED) find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS}) - find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) - - mark_as_advanced( - LIBPYLONCAM_INCLUDEDIR - LIBPYLONCAM_LIBRARIES) + pkg_check_modules(LIBPYLONCAM pyloncam>=0.1 REQUIRED) if (DEFINED LIBPYLONCAM_OTHER_PREFIX) string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} LIBPYLONCAM_INCLUDEDIR ${LIBPYLONCAM_INCLUDEDIR}) @@ -35,6 +25,12 @@ if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES}) endif() + find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) + + mark_as_advanced( + LIBPYLONCAM_INCLUDEDIR + LIBPYLONCAM_LIBRARIES) + else() message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support") endif() -- cgit v1.2.3 From 91daa3bdebd1fc1e368ff9fa2e99b4ea1131361e Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Thu, 2 Aug 2012 11:44:17 +0200 Subject: using LIBDIR --- cmake/FindPylon.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index fc9624b..c1a4af1 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -23,13 +23,16 @@ if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") LIBPYLONCAM_INCLUDEDIR ${LIBPYLONCAM_INCLUDEDIR}) string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES}) + string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} + LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR}) endif() find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) mark_as_advanced( LIBPYLONCAM_INCLUDEDIR - LIBPYLONCAM_LIBRARIES) + LIBPYLONCAM_LIBRARIES + LIBPYLONCAM_LIBDIR) else() message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support") -- cgit v1.2.3 From c64797a677c3ec4869f0a143fbde654522e8b6d0 Mon Sep 17 00:00:00 2001 From: Volker Kaiser Date: Thu, 2 Aug 2012 12:43:25 +0200 Subject: propagating LIBPYLONCAM_LIBDIR to PARENT_SCOPE --- cmake/FindPylon.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index c1a4af1..9820201 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -25,6 +25,7 @@ if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES}) string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR}) + set(LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR} PARENT_SCOPE) endif() find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES) -- cgit v1.2.3 From 859a6a6802e1891628af988a83a3e24b5b75c007 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 9 Aug 2012 12:36:28 +0200 Subject: Drop REQUIRED flag from Basler dependencies If they are required, they cannot be built on machines without that dependency. --- cmake/FindPylon.cmake | 2 +- cmake/FindYAT.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmake') diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index 9820201..01cee02 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -17,7 +17,7 @@ if (NOT "$ENV{PYLON_ROOT}" STREQUAL "") find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS}) - pkg_check_modules(LIBPYLONCAM pyloncam>=0.1 REQUIRED) + pkg_check_modules(LIBPYLONCAM pyloncam>=0.1) if (DEFINED LIBPYLONCAM_OTHER_PREFIX) string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX} LIBPYLONCAM_INCLUDEDIR ${LIBPYLONCAM_INCLUDEDIR}) diff --git a/cmake/FindYAT.cmake b/cmake/FindYAT.cmake index 92da3c8..1f9a98b 100644 --- a/cmake/FindYAT.cmake +++ b/cmake/FindYAT.cmake @@ -1,6 +1,6 @@ find_package(PkgConfig) -pkg_check_modules(YAT yat>=1.7.7 REQUIRED) +pkg_check_modules(YAT yat>=1.7.7) find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS}) -- cgit v1.2.3