Archived
1
Fork 0

Fix macOS builds

This commit is contained in:
Joshua Goins 2018-11-05 23:18:31 -05:00
parent a2941de5de
commit b53e2bb9ce

View file

@ -19,7 +19,25 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG)
endif()
message(STATUS ${SDL2_INCLUDE_DIR})
if(APPLE AND NOT TARGET SDL2::SDL2)
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_LIBDIR}/libSDL2.dylib"
INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIRS})
endif()
if(NOT TARGET assimp::assimp)
add_library(assimp::assimp UNKNOWN IMPORTED)
find_library(ASSIMP_IMPORTED_PATH ${ASSIMP_LIBRARIES}
PATHS
${ASSIMP_LIBRARY_DIRS})
set_target_properties(assimp::assimp PROPERTIES
IMPORTED_LOCATION ${ASSIMP_IMPORTED_PATH})
set_target_properties(assimp::assimp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${ASSIMP_INCLUDE_DIRS})
endif()
add_executable(Graph
src/main.cpp
@ -31,29 +49,27 @@ add_executable(Graph
target_link_libraries(Graph
PUBLIC
SDL2::SDL2
SDL2::SDL2main
Vulkan::Vulkan
${ASSIMP_LIBRARIES}
assimp::assimp
nlohmann::json
stb::stb
imgui::imgui)
target_include_directories(Graph
PUBLIC
include
PRIVATE
${ASSIMP_INCLUDE_DIR})
${GLM_INCLUDE_DIRS})
if(UNIX)
add_shaders(Graph
shaders/mesh.vert
shaders/mesh.frag
shaders/post.vert
shaders/post.frag
shaders/dof.vert
shaders/dof.frag
shaders/imgui.vert
shaders/imgui.frag)
endif()
add_shaders(Graph
shaders/mesh.vert
shaders/mesh.frag
shaders/post.vert
shaders/post.frag
shaders/dof.vert
shaders/dof.frag
shaders/imgui.vert
shaders/imgui.frag)
add_data(Graph
data/suzanne.obj