2017-09-04 01:41:00 +08:00
|
|
|
cmake_minimum_required(VERSION 3.8.0)
|
2017-10-17 02:22:21 +08:00
|
|
|
project(butteraugli CXX)
|
2017-09-04 01:41:00 +08:00
|
|
|
|
2017-10-17 02:22:21 +08:00
|
|
|
add_compile_options(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX)
|
2017-09-04 01:41:00 +08:00
|
|
|
if(MSVC)
|
2017-10-17 02:22:21 +08:00
|
|
|
add_compile_options(/W3 /wd4005 /wd4996 /wd4018)
|
2018-03-12 14:41:51 +08:00
|
|
|
else()
|
|
|
|
add_compile_options(-std=c++11)
|
2017-09-04 01:41:00 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(JPEG REQUIRED)
|
|
|
|
find_package(PNG REQUIRED)
|
|
|
|
|
2018-03-12 14:41:51 +08:00
|
|
|
include_directories("." ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIRS})
|
2017-09-04 01:41:00 +08:00
|
|
|
|
|
|
|
add_library(butteraugli_lib butteraugli/butteraugli.cc)
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS butteraugli_lib
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT DISABLE_INSTALL_TOOLS)
|
2017-10-17 02:22:21 +08:00
|
|
|
add_executable(butteraugli butteraugli/butteraugli_main.cc)
|
2018-03-12 14:41:51 +08:00
|
|
|
find_library(TURBO turbojpeg)
|
|
|
|
target_link_libraries(butteraugli butteraugli_lib ${JPEG_LIBRARIES} ${TURBO} ${PNG_LIBRARIES})
|
2017-10-17 02:22:21 +08:00
|
|
|
|
2017-09-04 01:41:00 +08:00
|
|
|
install (
|
|
|
|
TARGETS butteraugli
|
|
|
|
RUNTIME DESTINATION tools/butteraugli
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT DISABLE_INSTALL_HEADERS)
|
2017-09-04 02:14:33 +08:00
|
|
|
install(FILES butteraugli/butteraugli.h DESTINATION include/butteraugli)
|
2017-09-04 01:41:00 +08:00
|
|
|
endif()
|