-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
68 lines (59 loc) · 2.86 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
#
# Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#HAVE TO BE UNDER WINDOWS
if(WIN32)
set(NAME "hamamatsu")
#SOURCEs
set(${NAME}_srcs src/HamamatsuInterface.cpp src/HamamatsuCamera.cpp
src/HamamatsuBinCtrlObj.cpp src/HamamatsuDCAMSDKHelper.cpp
src/HamamatsuDetInfoCtrlObj.cpp src/HamamatsuRoiCtrlObj.cpp
src/HamamatsuSyncCtrlObj.cpp)
add_library(lima${NAME} SHARED ${${NAME}_srcs})
#INCLUDES
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sdk/msvc/include")
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sdk/msvc/include/legacy")
target_compile_definitions(lima${NAME} PRIVATE LIBPHAMAMATSU_EXPORTS)
#LIBRARIES
find_library(HAMAMATSU_DCAMAPI_LIB dcamapi "{CMAKE_CURRENT_SOURCE_DIR}/sdk/msvc/bin")
if("${HAMAMATSU_DCAMAPI_LIB}" STREQUAL "HAMAMATSU_DCAMAPI_LIB-NOTFOUND")
message(FATAL_ERROR "${NAME} : dcamapi.lib not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
find_library(HAMAMATSU_DCIMGAPI_LIB dcimgapi "{CMAKE_CURRENT_SOURCE_DIR}/sdk/msvc/bin")
if("${HAMAMATSU_DCIMGAPI_LIB}" STREQUAL "HAMAMATSU_DCIMGAPI_LIB-NOTFOUND")
message(FATAL_ERROR "${NAME} : dcimgapi.lib not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${HAMAMATSU_DCAMAPI_LIB})
target_link_libraries(lima${NAME} ${HAMAMATSU_DCIMGAPI_LIB})
limatools_set_library_soversion(lima${NAME} "VERSION")
set_target_properties(lima${NAME} PROPERTIES PREFIX "lib")
install(TARGETS lima${NAME} DESTINATION lib)
#if(LIMA_ENABLE_PYTHON)
# limatools_run_sip_for_camera(${NAME})
# install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Hamamatsu")
#endif()
else()
message(FATAL_ERROR "This camera has to be compiled on Windows")
endif()