aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 02a31dc1932ec5d5ef48a0ca65bbe56ea5e915d9 (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
29
30
31
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)

project(atracdenc)
include_directories(src)

set(ATDE_USE_FLOAT ON)

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)