File: CMakeLists.txt

package info (click to toggle)
perceptualdiff 1.2-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,008 kB
  • ctags: 76
  • sloc: cpp: 948; sh: 100; makefile: 50
file content (80 lines) | stat: -rw-r--r-- 2,745 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
project(PerceptualDiff)

cmake_minimum_required(VERSION 2.4)

add_executable(
  perceptualdiff
  PerceptualDiff.cpp LPyramid.cpp RGBAImage.cpp CompareArgs.cpp Metric.cpp)

install(TARGETS perceptualdiff DESTINATION bin)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

set(FREEIMAGE_FIND_REQUIRED, TRUE)
find_package(FreeImage)
include_directories(${FREEIMAGE_INCLUDE_DIRS})
target_link_libraries(perceptualdiff ${FREEIMAGE_LIBRARIES})

set(CMAKE_BUILD_TYPE Debug)

find_package(OpenMP)
if(OPENMP_FOUND)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

option(OPTIMIZATION "Enable optimization" TRUE)
if(OPTIMIZATION)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
else()
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -pedantic -Wcast-qual -Wpointer-arith -Winit-self -Wswitch-default -Wmissing-include-dirs -Wold-style-cast -Wnon-virtual-dtor -Wshadow -Wno-unknown-pragmas")

# Packing stuff.
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_PACKAGE_VERSION_PATCH "2")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An image comparison utility.")
set(CPACK_PACKAGE_VENDOR "pdiff dev team")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.rst)
set(CPACK_GENERATOR TGZ)
set(
  CPACK_SOURCE_PACKAGE_FILE_NAME
  "PerceptualDiff-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}"
  CACHE INTERNAL "tarball basename"
)
set(CPACK_SOURCE_GENERATOR TGZ)
# The following components are regex's to match anywhere (unless anchored)
# in absolute path + filename to find files or directories to be excluded
# from source tarball.
set(CPACK_SOURCE_IGNORE_FILES
"~$"
"/\\\\.gitignore$"
"/\\\\..*\\\\.swp$"
"^${PROJECT_SOURCE_DIR}/\\\\.git/"
"^${PROJECT_SOURCE_DIR}/CMakeFiles/"
"^${PROJECT_SOURCE_DIR}/CMakeCache.txt"
"^${PROJECT_SOURCE_DIR}/CPackSourceConfig.cmake"
"^${PROJECT_SOURCE_DIR}/CPackConfig.cmake"
"^${PROJECT_SOURCE_DIR}/CTestTestfile.cmake"
"^${PROJECT_SOURCE_DIR}/Makefile"
"^${PROJECT_SOURCE_DIR}/_CPack_Packages"
"^${PROJECT_SOURCE_DIR}/cppcheck.bash"
"^${PROJECT_SOURCE_DIR}/cmake_install.cmake"
"^${PROJECT_SOURCE_DIR}/install_manifest.txt"
"^${PROJECT_SOURCE_DIR}/perceptualdiff"
"^${PROJECT_SOURCE_DIR}/PerceptualDiff-.*"
"^${PROJECT_SOURCE_DIR}/Testing"
"^${PROJECT_SOURCE_DIR}/lcov.info"
"^${PROJECT_SOURCE_DIR}/lcov_tmp.info"
"^${PROJECT_SOURCE_DIR}/coverage_output"
)
include(CPack)

# Tests.
enable_testing()
add_test(run_tests.bash, "${PROJECT_SOURCE_DIR}/test/run_tests.bash")
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
                  DEPENDS "perceptualdiff")