Skip to content

Commit

Permalink
Added install process
Browse files Browse the repository at this point in the history
This is to copy shared library binaries as well as required program resources to the build folder.
  • Loading branch information
Jan Simon committed Apr 30, 2021
1 parent d1650bc commit 6faf21f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ include(FindVulkan)

file(GLOB_RECURSE SOURCE LIST_DIRECTORIES false "src/*.cpp" "src/*.hpp")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCE})
add_executable(makma ${SOURCE})
add_executable(${PROJECT_NAME} ${SOURCE})

set_property(TARGET makma PROPERTY CXX_STANDARD 17)
target_include_directories(makma PRIVATE ${Vulkan_INCLUDE_DIRS})
target_link_libraries(makma assimp glm imgui imguizmo SDL2 SDL2main stb ${Vulkan_LIBRARIES})
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
target_include_directories(${PROJECT_NAME} PRIVATE ${Vulkan_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} assimp glm imgui imguizmo SDL2 SDL2main stb ${Vulkan_LIBRARIES})

set(COPY_DIRECTORIES
Models
Shaders
Textures
)

install(DIRECTORY ${COPY_DIRECTORIES} DESTINATION ${CMAKE_BINARY_DIR})
4 changes: 4 additions & 0 deletions external/SDL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ endif()

set_target_properties(${TARGET_NAME} PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_LIST_DIR}/${STATIC_LIB} IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/${SHARED_LIB})

if(WIN32)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/${SHARED_LIB} DESTINATION ${CMAKE_BINARY_DIR})
endif()

set(TARGET_NAME SDL2main)

add_library(${TARGET_NAME} STATIC IMPORTED GLOBAL)
Expand Down
6 changes: 5 additions & 1 deletion external/assimp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ if(WIN32)
set(SHARED_LIB lib/win/assimp.dll)
endif()

set_target_properties(${TARGET_NAME} PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_LIST_DIR}/${STATIC_LIB} IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/${SHARED_LIB})
set_target_properties(${TARGET_NAME} PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_LIST_DIR}/${STATIC_LIB} IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/${SHARED_LIB})

if(WIN32)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/${SHARED_LIB} DESTINATION ${CMAKE_BINARY_DIR})
endif()

0 comments on commit 6faf21f

Please sign in to comment.