TechDemo/CMakeLists.txt

87 lines
3.2 KiB
CMake
Raw Normal View History

2023-11-14 00:32:05 -08:00
cmake_minimum_required(VERSION 3.18.4)
project(TechDemo C CXX)
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(IS_OS_WINDOWS TRUE)
set(USER_HOME_DIRECTORY $ENV{USERPROFILE})
2024-07-27 10:14:28 -07:00
string(REPLACE "\\" "/" USER_HOME_DIRECTORY "${USER_HOME_DIRECTORY}")
2023-11-14 00:32:05 -08:00
message("Building for the Windows operating system.")
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
set(IS_OS_LINUX TRUE)
set(USER_HOME_DIRECTORY $ENV{HOME})
add_compile_options(-Wno-stringop-overflow)
message("Building for the Linux operating system.")
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
set(IS_OS_MAC TRUE)
set(USER_HOME_DIRECTORY $ENV{HOME})
message("Building for the Mac operating system.")
endif ()
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
message("Building for AMD64 architecture.")
set(IS_ARCH_AMD64 TRUE)
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
message("Building for ARM64 architecture.")
set(IS_ARCH_ARM64 TRUE)
endif ()
2024-07-05 13:17:24 -07:00
message("Home Dir: ${USER_HOME_DIRECTORY}")
2023-11-14 00:32:05 -08:00
set(CMAKE_CXX_STANDARD 20)
2024-07-27 10:14:28 -07:00
add_executable(TechDemo
main.cpp
Levels/TestLevel.cpp Levels/TestLevel.h
Levels/MainMenu.cpp Levels/MainMenu.h
Gui/HealthBarGui.cpp Gui/HealthBarGui.h)
2023-11-14 00:32:05 -08:00
find_package(Vulkan REQUIRED)
2024-02-20 23:07:28 -08:00
if (Vulkan_FOUND)
message(STATUS "Vulkan was found.")
else ()
message(STATUS "Vulkan was not found.")
endif ()
find_package(ZLIB REQUIRED)
if (ZLIB_FOUND)
message(STATUS "ZLIB was found.")
else ()
message(STATUS "ZLIB was not found.")
endif ()
find_package(OpenSSL REQUIRED)
if (OpenSSL_FOUND)
message(STATUS "OpenSSL was found.")
else ()
message(STATUS "OpenSSL was not found.")
endif ()
2023-11-14 00:32:05 -08:00
2024-07-27 10:14:28 -07:00
if (IS_OS_WINDOWS)
add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHS/include")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHE/include")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHC/include")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/LWE/include")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHS/lib")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHE/lib")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHC/lib")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/LWE/lib")
target_link_libraries(TechDemo PRIVATE ws2_32 avrt)
elseif (IS_OS_LINUX)
2024-07-27 18:55:27 -07:00
add_compile_definitions(VK_USE_PLATFORM_XCB_KHR EHS_WS_XCB)
2024-07-27 10:14:28 -07:00
2024-09-16 16:18:05 -07:00
find_package(PkgConfig REQUIRED)
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
2024-07-27 10:14:28 -07:00
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/include")
2024-09-16 16:18:05 -07:00
target_include_directories(TechDemo PRIVATE ${PIPEWIRE_INCLUDE_DIRS})
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/lib")
2024-07-27 10:14:28 -07:00
2024-09-16 16:18:05 -07:00
target_link_libraries(TechDemo PRIVATE pipewire-0.3 wayland-client xcb xcb-cursor xcb-xfixes xcb-xinput asound)
2024-07-27 10:14:28 -07:00
endif()
2024-09-16 16:18:05 -07:00
target_link_libraries(TechDemo PRIVATE Vulkan::Headers Vulkan::Vulkan OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB LWE_Stc EHC EHE EHS_Stc)