forked from Saluev/python-liborigin2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
66 lines (53 loc) · 1.81 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
# CMakeLists.txt for liborigin
cmake_minimum_required(VERSION 2.8)
# c++11 standard
add_compile_options(-std=c++11)
# boost library headers
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
# library version
set(LIBORIGIN_VERSION_MAJOR 3)
set(LIBORIGIN_VERSION_MINOR 0)
set(LIBORIGIN_VERSION_BUGFIX 0)
# compile-time configuration variables to be linked in
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# source files
set (sources
OriginFile.cpp
OriginParser.cpp
OriginAnyParser.cpp
)
# header files for development
set (devel-headers
${CMAKE_CURRENT_BINARY_DIR}/config.h
OriginObj.h
OriginFile.h
OriginParser.h
tree.hh
)
# dynamic library
add_library (origin SHARED ${sources})
set_target_properties(origin PROPERTIES
VERSION ${LIBORIGIN_VERSION_MAJOR}.${LIBORIGIN_VERSION_MINOR}.${LIBORIGIN_VERSION_BUGFIX}
SOVERSION ${LIBORIGIN_VERSION_MAJOR} )
# static library
add_library (origin-static STATIC ${sources})
set_target_properties(origin-static PROPERTIES OUTPUT_NAME "origin" POSITION_INDEPENDENT_CODE ON)
# install libraries
install(TARGETS origin origin-static DESTINATION lib)
# install headers
install(FILES ${devel-headers} DESTINATION include/liborigin)
# command line util
add_executable(opj2dat opj2dat.cpp)
target_link_libraries (opj2dat origin-static)
install(TARGETS opj2dat DESTINATION bin)
# documentation
install(FILES COPYING FORMAT README DESTINATION share/doc/liborigin)
configure_file(doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(doc ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/liborigin)
endif(DOXYGEN_FOUND)