CMakeLists.txt (2215B)
1 include(Helpers) 2 3 project(WwiseTransfer_Shared) 4 5 file(GLOB_RECURSE SHARED_SOURCES 6 "${PROJECT_SOURCE_DIR}/*.h" 7 "${PROJECT_SOURCE_DIR}/*.cpp") 8 9 add_library(${PROJECT_NAME}) 10 11 find_package(Git REQUIRED) 12 if(Git_FOUND) 13 execute_process( 14 COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD 15 RESULT_VARIABLE result 16 OUTPUT_VARIABLE COMMIT_HASH) 17 18 execute_process( 19 COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD 20 RESULT_VARIABLE result 21 OUTPUT_VARIABLE BRANCH_NAME) 22 23 string(REPLACE "\n" "" COMMIT_HASH ${COMMIT_HASH}) 24 string(REPLACE "\n" "" BRANCH_NAME ${BRANCH_NAME}) 25 endif() 26 27 if(DEFINED ENV{VERSION}) 28 set(VERSION $ENV{VERSION}) 29 else() 30 set(VERSION "Unofficial") 31 endif() 32 33 if(DEFINED ENV{BUILD_NUMBER}) 34 set(BUILD_NUMBER $ENV{BUILD_NUMBER}) 35 else() 36 set(BUILD_NUMBER "Local") 37 endif() 38 39 if(DEFINED ENV{BUILD_COMMIT_HASH}) 40 # Build machine builds in detached state 41 # Get branch name from build param (will be main for release builds) 42 set(BRANCH_NAME $ENV{BUILD_COMMIT_HASH}) 43 endif() 44 45 set(VERSION_STRING "${VERSION} ${COMMIT_HASH}") 46 47 string(TIMESTAMP year "%Y") 48 add_compile_definitions(YEAR="${year}") 49 50 target_sources(${PROJECT_NAME} PRIVATE ${SHARED_SOURCES}) 51 52 target_include_directories(${PROJECT_NAME} 53 PUBLIC 54 ${PROJECT_SOURCE_DIR}/ 55 ) 56 57 find_package(Wwise REQUIRED) 58 find_package(AkAutobahn REQUIRED) 59 60 file(GLOB RESOURCES "${PROJECT_SOURCE_DIR}/Theme/*/*.*") 61 62 juce_add_binary_data(WwiseTransfer_BinaryData 63 SOURCES ${RESOURCES}) 64 65 target_link_libraries(${PROJECT_NAME} 66 PUBLIC 67 WwiseTransfer_BinaryData 68 RapidJSON 69 AkAutobahn 70 juce::juce_gui_basics 71 Wwise 72 ) 73 74 target_compile_definitions(${PROJECT_NAME} 75 PRIVATE 76 JUCE_STANDALONE_APPLICATION=0 77 PUBLIC 78 JUCE_MANUFACTURER_NAME_STRING="Audiokinetic" 79 JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 80 JUCE_DISPLAY_SPLASH_SCREEN=0 81 JUCE_APPLICATION_VERSION_STRING="${VERSION}" 82 BRANCH_NAME="${BRANCH_NAME}" 83 BUILD_NUMBER="${BUILD_NUMBER}" 84 COMMIT_HASH="${COMMIT_HASH}" 85 ) 86 87 source_group(TREE ${PROJECT_SOURCE_DIR} PREFIX "Source Files" FILES ${SHARED_SOURCES}) 88 89 build_juce_source_groups()