-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
56 lines (45 loc) · 1.33 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
PROJECT(LibHDR)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
# Allow the developer to select if Dynamic or Static libraries are built
OPTION(BUILD_SHARED_LIBS "Build Shared Libraries" ON)
# Define project version
SET(${PROJECT_NAME}_MAJOR_VERSION 0)
SET(${PROJECT_NAME}_MINOR_VERSION 0)
SET(${PROJECT_NAME}_PATCH_LEVEL 1)
SET(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
# set include path for FindXXX.cmake files
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/"
)
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/FindLibHDRDeps.cmake")
IF(UNIX)
ADD_DEFINITIONS(-Wall)
ENDIF()
ENABLE_TESTING()
IF(WIN32)
SET(LIB_NAME libhdr)
ELSE()
SET(LIB_NAME hdr)
ENDIF()
SET(LIBHDR_HDRS )
SET(LIBHDR_SRCS )
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(doc)
# Set the LIB_TYPE variable to STATIC
SET(LIB_TYPE STATIC)
IF(BUILD_SHARED_LIBS)
# User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED'
SET(LIB_TYPE SHARED)
ENDIF(BUILD_SHARED_LIBS)
ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIBHDR_HDRS} ${LIBHDR_SRCS})
TARGET_LINK_LIBRARIES(${LIB_NAME}
# ${Boost_LIBRARIES}
# ${TIFF_LIBRARIES}
${EXIV2_LIBRARIES}
# ${OPENEXR_LIBRARIES}
# ${JPEG_LIBRARIES}
# ${LCMS2_LIBRARIES}
)