Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
path = Karma/vendor/SDL
url = https://github.com/ravimohan1991/SDL.git
ignore = dirty
[submodule "Karma/vendor/BiosReader"]
path = Karma/vendor/BiosReader
url = https://github.com/ravimohan1991/BiosReader.git
[submodule "Karma/vendor/hwinfo"]
path = Karma/vendor/hwinfo
url = https://github.com/ravimohan1991/hwinfo.git
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set(KARMALIBRARYFOLDER "CompanionLibraries")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${REPOSITORYROOT}/KarmaBin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${REPOSITORYROOT}/KarmaBin")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${REPOSITORYROOT}/KarmaBin")

# Set the GameName
Expand Down Expand Up @@ -75,9 +76,6 @@ add_subdirectory(Pranjal)
target_link_libraries(SandBox PUBLIC KarmaEngine)
target_link_libraries(Pranjal PUBLIC KarmaEngine)

# Need to find a way to give access to the resources (assets and whatnot) to the built binaries


#[[
* /\
* / /
Expand Down
28 changes: 17 additions & 11 deletions Karma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ ENDMACRO(PRINT_LIST)

# Then the checks
find_package(Vulkan REQUIRED)
find_package(OpenGL REQUIRED)
if(NOT APPLE)
find_package(OpenGL REQUIRED)
endif()
find_package(Threads REQUIRED)
message(STATUS "Checks are satisfied, we are good to proceed!")

Expand Down Expand Up @@ -170,17 +172,19 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(KR_DEBUG)
endif()

# Telling hwinfo to output library dll to our KarmaBin folder
set(HWINFO_CMAKE_BINARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

# Involved libraries and essentials
add_subdirectory(vendor/Glad)
add_subdirectory(vendor/GLFW)
add_subdirectory(vendor/GLM)
add_subdirectory(vendor/SDL)
# add_subdirectory(vendor/ImGui)
add_subdirectory(vendor/spdlog)
add_subdirectory(vendor/assimp)
add_subdirectory(vendor/glslang)
add_subdirectory(vendor/stb)
add_subdirectory(vendor/BiosReader)
add_subdirectory(vendor/hwinfo)

list(APPEND ESSENTIAL_LIBS Glad)
list(APPEND ESSENTIAL_LIBS GLFW)
Expand All @@ -190,13 +194,13 @@ if(BUILD_SHARED_LIBS AND NOT MSVC)
else()
list(APPEND ESSENTIAL_LIBS SDL2-static)
endif()
# list(APPEND ESSENTIAL_LIBS ImGUI)
list(APPEND ESSENTIAL_LIBS spdlog)
list(APPEND ESSENTIAL_LIBS AssImp)
list(APPEND ESSENTIAL_LIBS ${Vulkan_LIBRARY})
list(APPEND ESSENTIAL_LIBS GlSlang)
list(APPEND ESSENTIAL_LIBS stbimage)
list(APPEND ESSENTIAL_LIBS BiosReader)
list(APPEND ESSENTIAL_LIBS hwinfo)


# Print Karma's libraries
message(STATUS "########################")
Expand Down Expand Up @@ -250,18 +254,21 @@ if(BUILD_SHARED_LIBS AND NOT MSVC)
else()
target_link_libraries(KarmaEngine PUBLIC SDL2-static)
endif()
# target_link_libraries(KarmaEngine PUBLIC ImGUI)
target_link_libraries(KarmaEngine PUBLIC spdlogging)
target_link_libraries(KarmaEngine PUBLIC AssImp)
target_link_libraries(KarmaEngine PUBLIC ${Vulkan_LIBRARY})
if(APPLE)
target_link_libraries(KarmaEngine PUBLIC "-framework OpenGL")
else()
target_link_libraries(KarmaEngine PUBLIC ${OPENGL_LIBRARIES})
endif()
target_link_libraries(KarmaEngine PUBLIC GlSlang)
target_link_libraries(KarmaEngine PUBLIC stbimage)
target_link_libraries(KarmaEngine PUBLIC BiosReader)
target_link_libraries(KarmaEngine PUBLIC hwinfo)

# Cluster Karma's libraries into a single folder for project/solution visualization
set_property(TARGET Glad PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
set_property(TARGET AssImp PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
# set_property(TARGET ImGUI PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
set_property(TARGET GlSlang PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
set_property(TARGET spdlogging PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
set_property(TARGET stbimage PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
Expand All @@ -278,8 +285,7 @@ else()
set_property(TARGET glm_static PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
]]
endif()

set_property(TARGET BiosReader PROPERTY FOLDER "${KARMALIBRARYFOLDER}")
set_property(TARGET hwinfo PROPERTY FOLDER "${KARMALIBRARYFOLDER}")

# INTERFACE (Something that Consumers require but Producers don't)
# Since I am a library coder here, I am the Producer
Expand All @@ -292,7 +298,7 @@ target_include_directories(KarmaEngine
${CMAKE_CURRENT_SOURCE_DIR}/vendor/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/vendor/assimp/contrib
${CMAKE_CURRENT_SOURCE_DIR}/vendor/assimp/include
${CMAKE_CURRENT_SOURCE_DIR}/vendor/BiosReader/src/public
${CMAKE_CURRENT_SOURCE_DIR}/vendor/hwinfo/include
${Vulkan_INCLUDE_DIR}
PUBLIC
# where top-level project will look for the library's public headers
Expand Down
Loading