Commit 7730f9df authored by Aitor Henry's avatar Aitor Henry

final cmake

parent ef66403a
......@@ -21,59 +21,57 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
set(NAME "andor")
if(UNIX)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--add-needed")
endif()
set(andor_srcs src/AndorCamera.cpp src/AndorInterface.cpp
set(${NAME}_srcs src/AndorCamera.cpp src/AndorInterface.cpp
src/AndorDetInfoCtrlObj.cpp src/AndorSyncCtrlObj.cpp
src/AndorBinCtrlObj.cpp src/AndorShutterCtrlObj.cpp
src/AndorRoiCtrlObj.cpp)
file(STRINGS "VERSION" andor_vers)
add_library(limaandor SHARED ${andor_srcs})
add_library(lima${NAME} SHARED ${${NAME}_srcs})
#INCLUDES
target_include_directories(limaandor PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
if(WIN32)
target_include_directories(limaandor PUBLIC "C:/Program files/Andor SDK")
target_include_directories(limaandor PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sdk/msvc/include")
target_include_directories(lima${NAME} PUBLIC "C:/Program files/Andor SDK")
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sdk/msvc/include")
endif()
if(WIN32)
target_compile_definitions(limaandor PRIVATE LIBANDOR_EXPORTS)
target_compile_definitions(lima${NAME} PRIVATE LIBANDOR_EXPORTS)
endif()
#LIBRARY
if(WIN32)
find_library(ANDOR_LIB atmcd64m "C:/Program files/Andor SDK")
if (("${ANDOR_LIB}" STREQUAL "ANDOR_LIB-NOTFOUND"))
message(FATAL_ERROR "andor : libatmcd32d not found, you can search it in cmake-gui or try to install it if it isn't here.")
find_library(ANDOR_ATMCD64M_LIB atmcd64m "C:/Program files/Andor SDK")
if (("${ANDOR_ATMCD64M_LIB}" STREQUAL "ANDOR_ATMCD64M_LIB-NOTFOUND"))
message(FATAL_ERROR "${NAME} : libatmcd32d not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
else()
find_library(ANDOR_LIB andor)
if (("${ANDOR_LIB}" STREQUAL "ANDOR_LIB-NOTFOUND"))
message(FATAL_ERROR "andor : libandor not found, you can search it in cmake-gui or try to install it if it isn't here.")
message(FATAL_ERROR "${NAME} : libandor not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
endif()
target_link_libraries(limaandor limacore)
target_link_libraries(limaandor ${ANDOR_LIB})
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${ANDOR_LIB})
set_target_properties(limaandor PROPERTIES VERSION ${andor_vers} SOVERSION "1")
include(CameraVERSION)
if(WIN32)
set_target_properties(limaandor PROPERTIES PREFIX "lib")
install(TARGETS limaandor DESTINATION lib)
set_target_properties(lima${NAME} PROPERTIES PREFIX "lib")
install(TARGETS lima${NAME} DESTINATION lib)
else()
install(TARGETS limaandor LIBRARY DESTINATION lib)
install(TARGETS lima${NAME} LIBRARY DESTINATION lib)
endif()
if(COMPILE_SIP)
set(NAME "andor")
include(CameraRunSIP)
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Andor")
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment