-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
43 lines (36 loc) · 1.36 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
cmake_minimum_required(VERSION 3.0)
project(wavtool-yawu)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /GL")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
add_definitions(-D_FILE_OFFSET_BITS=64)
if("${YAWU_OUTPUT_SAMPLE_FORMAT}" STREQUAL "")
set(YAWU_OUTPUT_SAMPLE_FORMAT SF_FORMAT_PCM_32) # See pcm_merger.cpp for more information
endif()
add_definitions("-DYAWU_OUTPUT_SAMPLE_FORMAT=${YAWU_OUTPUT_SAMPLE_FORMAT}")
file(GLOB_RECURSE YAWU_SRC_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "src/*.cpp")
add_executable(wavtool-yawu ${YAWU_SRC_SOURCES})
set_target_properties(wavtool-yawu PROPERTIES
CXX_STANDARD 11
POSITION_INDEPENDENT_CODE ON
)
include(CheckLibraryExists)
check_library_exists("m" "sin" "" YAWU_HAVE_LIBM)
if(YAWU_HAVE_LIBM)
target_link_libraries(wavtool-yawu PUBLIC "m")
endif()
add_subdirectory(lib/libWinTF8)
target_link_libraries(wavtool-yawu PUBLIC wintf8)
add_subdirectory(lib/libsndfile-1.0.25)
target_link_libraries(wavtool-yawu PUBLIC sndfile)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") # Test subproject
install(TARGETS wavtool-yawu
RUNTIME DESTINATION "bin"
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
)
endif()