xespeak CmakeLists.txt

if (UNIX)
message("The system is ${CMAKE_SYSTEM}")
message("The system name is ${CMAKE_SYSTEM_NAME}")
message("The system version is ${CMAKE_SYSTEM_VERSION}")
message("The system processor is ${CMAKE_SYSTEM_PROCESSOR}")
endif()


message("The cmake version is ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}-${CMAKE_PATCH_VERSION}")
message("The compiler is ${CMAKE_C_COMPILER}.")


message("PROJECT_SOURCE_DIR is ${PROJECT_SOURCE_DIR}")
message("CMAKE_CURRENT_SOURCE_DIR is ${CMAKE_CURRENT_SOURCE_DIR}")
message("CMAKE_SOURCE_DIR is ${CMAKE_SOURCE_DIR}")


project(xespeak)
cmake_minimum_required(VERSION 2.8)


set(COM_SRC_LIST    compiledict.cpp
                    dictionary.cpp
                    intonation.cpp
                    klatt.h
                    klatt.cpp
                    numbers.cpp
                    phoneme.h
                    phonemelist.cpp
                    readclause.cpp
                    setlengths.cpp
                    sonic.h
                    sonic.cpp
                    synth_mbrola.cpp
                    synthdata.cpp
                    synthesize.h
                    synthesize.cpp
                    tr_languages.cpp
                    translate.h
                    translate.cpp
                    voice.h
                    voices.cpp
                    wavegen.cpp
                    portaudio.h
                    sintab.h
                    speak_lib.h)


if(WIN32)
    message("The operation platform is windows")
    if(MSVC)
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
        set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
    endif()
    if(PLATFORM_WINDOWS_DLL)
        message("Now to make windows dll...")
        #add_subdirectory(./os/win32/cmd)
        #add_definitions(-DPLATFORM_WINDOWS)
        include_directories(./os/win32/dll/)
        #aux_source_directory(. SRC_LIST)
        set(SRC_LIST    ./os/win32/dll/speech.h
                        ./os/win32/dll/stdint.h
                        ./os/win32/dll/StdAfx.h
                        speak_lib.cpp
                        ${COM_SRC_LIST})
        #add_library(${PROJECT_NAME} STATIC ${SRC_LIST})


        add_library(PAStaticWMME STATIC IMPORTED)
        set_target_properties(PAStaticWMME PROPERTIES
            IMPORTED_LOCATION_RELEASE ./os/win32/deps/PAStaticWMME.lib
            IMPORTED_LOCATION_DEBUG   ./os/win32/deps/PAStaticWMME.lib
            IMPORTED_LINK_INTERFACE_LIBRARIES PAStaticWMME)
        add_library(${PROJECT_NAME} SHARED ${SRC_LIST})
        target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/os/win32/deps/PAStaticWMME.lib)
    elseif(PLATFORM_WINDOWS_CMD)
        message("Now to make windows cmd...")
        #add_subdirectory(./os/win32/cmd)
        #aux_source_directory(. SRC_LIST)
        add_definitions(/DWIN32 /DNDEBUG /D_CONSOLE)
        include_directories(./os/win32/cmd/)
        set(SRC_LIST    ./os/win32/cmd/speech.h
                        ./os/win32/cmd/stdint.h
                        ./os/win32/cmd/StdAfx.h
                        speak.cpp
                        ${COM_SRC_LIST})
        add_library(PAStaticWMME STATIC IMPORTED)
        set_target_properties(PAStaticWMME PROPERTIES
            IMPORTED_LOCATION_RELEASE ./os/win32/deps/PAStaticWMME.lib
            IMPORTED_LOCATION_DEBUG   ./os/win32/deps/PAStaticWMME.lib
            IMPORTED_LINK_INTERFACE_LIBRARIES PAStaticWMME)


        add_executable(${PROJECT_NAME} ${SRC_LIST})
        target_link_libraries(${PROJECT_NAME}
            ${CMAKE_CURRENT_SOURCE_DIR}/os/win32/deps/PAStaticWMME.lib
            Winmm.lib)
    endif()
elseif(UNIX)
    message("The operation platform is Linux")
endif()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值