aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 81d7999b8684ea0204fd7ae19b0baeb9d1b0d3cf (plain) (blame)
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
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)

project(atracdenc)
include_directories(src)
if (UNIX)
    find_package(GTest)
    if (GTest_FOUND)
        add_subdirectory(test)
        enable_testing()
    else()
        message("gtest library has not been found, skipping ut...")
    endif()

    if (NOT DEFINED CMAKE_INSTALL_MANDIR)
        set(CMAKE_INSTALL_MANDIR ${CMAKE_INSTALL_PREFIX}/share/man)
    endif()
    add_custom_target(man-atracdenc
        ALL
        DEPENDS atracdenc.1.gz
    )
    add_custom_command(
        OUTPUT atracdenc.1.gz
        COMMAND mkdir -p man && gzip --no-name --to-stdout ${CMAKE_CURRENT_SOURCE_DIR}/man/atracdenc.1 >"${CMAKE_CURRENT_BINARY_DIR}/man/atracdenc.1.gz"
        MAIN_DEPENDENCY man/atracdenc.1
    )
    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/atracdenc.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
add_subdirectory(src)