From b3d674ae64965d69db746d3dcfee7acd5f5b1fd6 Mon Sep 17 00:00:00 2001
From: Samuel Debionne <samuel.debionne@esrf.fr>
Date: Mon, 22 Oct 2018 10:20:12 +0200
Subject: [PATCH] Rename SDK cmake package to PvAPI to avoid name clash with
 the prosilica plugin (installed as prosilica). Fix module path (use
 CMAKE_CURRENT_SOURCE_DIR).

---
 CMakeLists.txt            | 10 +++++-----
 cmake/FindProsilica.cmake | 12 ------------
 cmake/FindPvAPI.cmake     | 12 ++++++++++++
 3 files changed, 17 insertions(+), 17 deletions(-)
 delete mode 100644 cmake/FindProsilica.cmake
 create mode 100644 cmake/FindPvAPI.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7b06e9..a00b99e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,7 +56,7 @@ if (CAMERA_MASTER_PROJECT)
 endif()
 
 # CMake additional macros
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH})
 
 # Set version
 include(project_version)
@@ -89,7 +89,7 @@ if (CAMERA_ENABLE_PYTHON)
   find_package(NumPy REQUIRED)
 endif()
 
-find_package(Prosilica REQUIRED)
+find_package(PvAPI REQUIRED)
 
 file(GLOB_RECURSE PROSILICA_INCS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
 
@@ -124,11 +124,11 @@ target_include_directories(prosilica
 
 target_link_libraries(prosilica PUBLIC limacore)
 
-target_compile_definitions(prosilica PUBLIC ${PROSILICA_DEFINITIONS})
+target_compile_definitions(prosilica PUBLIC ${PVAPI_DEFINITIONS})
 
-target_include_directories(prosilica PUBLIC ${PROSILICA_INCLUDE_DIRS})
+target_include_directories(prosilica PUBLIC ${PVAPI_INCLUDE_DIRS})
 
-target_link_libraries(prosilica PUBLIC ${PROSILICA_LIBRARIES})
+target_link_libraries(prosilica PUBLIC ${PVAPI_LIBRARIES})
 
 if(WIN32)
   target_compile_definitions(prosilica
diff --git a/cmake/FindProsilica.cmake b/cmake/FindProsilica.cmake
deleted file mode 100644
index ca91772..0000000
--- a/cmake/FindProsilica.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-set(PROSILICA_INCLUDE_DIRS)
-set(PROSILICA_LIBRARIES)
-set(PROSILICA_DEFINITIONS)
-
-find_path(PROSILICA_INCLUDE_DIRS "PvApi.h")
-find_library(PROSILICA_LIBRARIES PvAPI)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Prosilica DEFAULT_MSG
-  PROSILICA_LIBRARIES
-  PROSILICA_INCLUDE_DIRS
-)
diff --git a/cmake/FindPvAPI.cmake b/cmake/FindPvAPI.cmake
new file mode 100644
index 0000000..f2e2511
--- /dev/null
+++ b/cmake/FindPvAPI.cmake
@@ -0,0 +1,12 @@
+set(PVAPI_INCLUDE_DIRS)
+set(PVAPI_LIBRARIES)
+set(PVAPI_DEFINITIONS)
+
+find_path(PVAPI_INCLUDE_DIRS "PvApi.h")
+find_library(PVAPI_LIBRARIES PvAPI)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PvAPI DEFAULT_MSG
+  PVAPI_LIBRARIES
+  PVAPI_INCLUDE_DIRS
+)
-- 
GitLab