Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # all dependencies will be cloned in submodules directory and will be included from that directory only
- # .___.___
- # ____________ __| _/| | ____ ____
- # / ___/\____ \ / __ | | | / _ \ / ___\
- # \___ \ | |_> > /_/ | | |_( <_> ) /_/ >
- # /____ >| __/\____ | |____/\____/\___ /
- # \/ |__| \/ /_____/
- #
- # spdlog dependency setup -----------------------------------------------------
- message("${Yellow}FINDING spdlog...${ColorReset}")
- # find whether include files are present or not
- find_path(SPDLOG_INCLUDE_FILE_PATH NAMES spdlog.h
- PATHS ${CMAKE_CURRENT_SOURCE_DIR}/spdlog/include/spdlog)
- if(NOT SPDLOG_INCLUDE_FILE_PATH)
- # spdlog/spdlog.h wasn't found so init submodule and build it
- message("${Yellow}NOT FOUND spdlog.${ColorReset}")
- message("${Yellow}Cloning spdlog...${ColorReset}")
- # init submodule
- execute_process(COMMAND git submodule update --init -- ${CMAKE_CURRENT_SOURCE_DIR}/spdlog
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- message("${Yellow}COMPLETED Cloning spdlog.${ColorReset}")
- else()
- message("${Green}FOUND spdlog.${ColorReset}")
- endif()
- # set include dir properly
- set(SPDLOG_MODULE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spdlog/include
- CACHE PATH "SPDLOG Include Directory")
- # add it as a subdirectory
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spdlog)
- # -----------------------------------------------------------------------------
- # .__ _____
- # ____ | |_/ ____\_ _ __
- # / ___\| |\ __\\ \/ \/ /
- # / /_/ > |_| | \ /
- # \___ /|____/__| \/\_/
- # /_____/
- #
- # glfw3 dependency setup ------------------------------------------------------
- message("${Yellow}FINDING glfw3...${ColorReset}")
- # find whether include files are present or not
- find_path(GLFW_INCLUDE_FILE_PATH NAMES glfw3.h
- PATHS ${CMAKE_CURRENT_SOURCE_DIR}/glfw/include/GLFW)
- if(NOT GLFW_INCLUDE_FILE_PATH)
- # glfw include file wasn't found
- message("${Yellow}NOT FOUND glfw3${ColorReset}")
- message("${Yellow}Cloning glfw3...${ColorReset}")
- # init submodule
- execute_process(COMMAND git submodule update --init -- ${CMAKE_CURRENT_SOURCE_DIR}/glfw
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- message("${Yellow}COMPLETED Cloning glfw3.${ColorReset}")
- else()
- message("${Green}FOUND glfw3.${ColorReset}")
- endif()
- # set the include dir
- set(GLFW_MODULE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/glfw/include
- CACHE PATH "GLFW Include Directory")
- # add it as a subdirectory to build the library
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/glfw)
- # -----------------------------------------------------------------------------
- # ____ ____ .__ __ ___ ___ .___
- # \ \ / /_ __| | | | _______ ____ / | \ ____ _____ __| _/___________ ______
- # \ Y / | \ | | |/ /\__ \ / \ ______ / ~ \_/ __ \\__ \ / __ |/ __ \_ __ \/ ___/
- # \ /| | / |_| < / __ \| | \ /_____/ \ Y /\ ___/ / __ \_/ /_/ \ ___/| | \/\___ \
- # \___/ |____/|____/__|_ \(____ /___| / \___|_ / \___ >____ /\____ |\___ >__| /____ >
- # \/ \/ \/ \/ \/ \/ \/ \/ \/
- #
- #vulkan headers setup --------------------------------------------------------
- message("${Yellow}FINDING Vulkan-Headers...${ColorReset}")
- # find whether include files are present or not
- find_path(VULKAN_HEADERS_INCLUDE_FILE_PATH NAMES "vulkan.h" "vulkan.hpp"
- PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/include/vulkan)
- if(NOT VULKAN_HEADERS_INCLUDE_FILE_PATH)
- # Vulkan-Headers include file wasn't found
- message("${Yellow}NOT FOUND Vulkan-Headers.${ColorReset}")
- message("${Yellow}Cloning Vulkan-Headers...${ColorReset}")
- # init submodule
- execute_process(COMMAND git submodule update --init -- ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- message("${Yellow}COMPLETED Cloning Vulkan-Headers.${ColorReset}")
- else()
- message("${Green}FOUND Vulkan-Headers${ColorReset}")
- endif()
- # set the include dir
- set(VULKAN_HEADERS_MODULE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/include
- CACHE PATH "Vulkan-Headers Include Directory")
- # add it as a subdirectory to build the library
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers)
- # -----------------------------------------------------------------------------
- # ____ ____ .__ __ .____ .___
- # \ \ / /_ __| | | | _______ ____ | | _________ __| _/___________
- # \ Y / | \ | | |/ /\__ \ / \ ______ | | / _ \__ \ / __ |/ __ \_ __ \
- # \ /| | / |_| < / __ \| | \ /_____/ | |__( <_> ) __ \_/ /_/ \ ___/| | \/
- # \___/ |____/|____/__|_ \(____ /___| / |_______ \____(____ /\____ |\___ >__|
- # \/ \/ \/ \/ \/ \/ \/
- #
- # vulkan loader setup ---------------------------------------------------------
- message("${Yellow}FINDING Vulkan-Loader...${ColorReset}")
- # find whether include files are present or not
- find_path(VULKAN_LOADER_INCLUDE_FILE_PATH NAMES "CMakeLists.txt"
- PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Loader)
- if(NOT VULKAN_LOADER_INCLUDE_FILE_PATH)
- # Vulkan-Loaders include file wasn't found
- message("${Yellow}NOT FOUND Vulkan-Loader.${ColorReset}")
- message("${Yellow}Cloning Vulkan-Loader...${ColorReset}")
- # init submodule
- execute_process(COMMAND git submodule update --init -- ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Loader
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- message("${Yellow}COMPLETED Cloning Vulkan-Loader.${ColorReset}")
- else()
- message("${Green}FOUND Vulkan-Loader${ColorReset}")
- endif()
- # add it as a subdirectory to build the library
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Loader)
- # -----------------------------------------------------------------------------
- # .___ ___ ___
- # ____ ____ ____ ____ | | _____/ |_ ____ _______/ |_
- # / ___\ / _ \ / _ \ / ___\| | _/ __ \ __\/ __ \ / ___/\ __\
- # / /_/ > <_> | <_> ) /_/ > |_\ ___/| | \ ___/ \___ \ | |
- # \___ / \____/ \____/\___ /|____/\___ >__| \___ >____ > |__|
- # /_____/ /_____/ \/ \/ \/
- #
- # googletest setup ------------------------------------------------------------
- message("${Yellow}FINDING googletest...${ColorReset}")
- # find whether include files are present or not
- find_path(VULKAN_LOADER_INCLUDE_FILE_PATH NAMES "CMakeLists.txt"
- PATHS ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
- if(NOT VULKAN_LOADER_INCLUDE_FILE_PATH)
- # googletest include file wasn't found
- message("${Yellow}NOT FOUND googletest.${ColorReset}")
- message("${Yellow}Cloning googletest...${ColorReset}")
- # init submodule
- execute_process(COMMAND git submodule update --init -- ${CMAKE_CURRENT_SOURCE_DIR}/googletest
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- message("${Yellow}COMPLETED Cloning googletest.${ColorReset}")
- else()
- message("${Green}FOUND googletest.${ColorReset}")
- endif()
- # set include directory properly
- set(GOOGLETEST_MODULE_TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/include
- CACHE PATH "Google Tests Include Directory.")
- set(GOOGLETEST_MODULE_MOCK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googlemock/include
- CACHE PATH "Google Mock Include Directory.")
- # add it as a subdirectory to build the library
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement