-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (54 loc) · 1.63 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
cmake_minimum_required(VERSION 3.5)
project(TUIIDC)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif()
enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
add_definitions(-DTUIIDCPP_CONF_DIR="${CMAKE_INSTALL_PREFIX}/etc")
if(APPLE)
set(MACOSX_RPATH TRUE)
endif()
find_package(PkgConfig REQUIRED)
find_package(Boost REQUIRED)
pkg_check_modules(LIBUSB-1.0 REQUIRED libusb-1.0)
pkg_check_modules(YAML-CPP REQUIRED yaml-cpp)
include_directories(
${PROJECT_SOURCE_DIR}
${CMAKE_INSTALL_PREFIX}/include
${Boost_INCLUDE_DIRS}
${LIBUSB-1.0_INCLUDE_DIRS}
${YAML-CPP_INCLUDE_DIRS}
)
link_directories(
${CMAKE_INSTALL_PREFIX}/lib
${LIBUSB-1.0_LIBRARY_DIRS}
${YAML-CPP_LIBRARY_DIRS}
)
file(GLOB sources *.cc)
add_library(${PROJECT_NAME} SHARED ${sources})
if(APPLE)
add_subdirectory(MacOSX)
include_directories(MacOSX)
target_link_libraries(${PROJECT_NAME}
TUTools raw1394
${LIBUSB-1.0_LIBRARIES} ${YAML-CPP_LIBRARIES})
else()
pkg_check_modules(LIBRAW1394 REQUIRED libraw1394)
include_directories(${LIBRAW1394_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME}
TUTools ${LIBRAW1394_LIBRARIES}
${LIBUSB-1.0_LIBRARIES} ${YAML-CPP_LIBRARIES})
endif()
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)
add_subdirectory(TU)
add_subdirectory(testIIDCcamera)
option(BUILD_TUIIDCPP_TEST_PROGRAMS "Building test programs for TUIIDC" OFF)
if(BUILD_TUIIDCPP_TEST_PROGRAMS)
add_subdirectory(testcam)
add_subdirectory(testcam2)
endif()