Fix macOS builds
This commit is contained in:
parent
a2941de5de
commit
b53e2bb9ce
1 changed files with 31 additions and 15 deletions
|
@ -19,7 +19,25 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-DDEBUG)
|
add_definitions(-DDEBUG)
|
||||||
endif()
|
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
|
add_executable(Graph
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
|
@ -31,20 +49,19 @@ add_executable(Graph
|
||||||
target_link_libraries(Graph
|
target_link_libraries(Graph
|
||||||
PUBLIC
|
PUBLIC
|
||||||
SDL2::SDL2
|
SDL2::SDL2
|
||||||
SDL2::SDL2main
|
|
||||||
Vulkan::Vulkan
|
Vulkan::Vulkan
|
||||||
${ASSIMP_LIBRARIES}
|
assimp::assimp
|
||||||
nlohmann::json
|
nlohmann::json
|
||||||
stb::stb
|
stb::stb
|
||||||
imgui::imgui)
|
imgui::imgui)
|
||||||
|
|
||||||
target_include_directories(Graph
|
target_include_directories(Graph
|
||||||
PUBLIC
|
PUBLIC
|
||||||
include
|
include
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${ASSIMP_INCLUDE_DIR})
|
${GLM_INCLUDE_DIRS})
|
||||||
|
|
||||||
if(UNIX)
|
add_shaders(Graph
|
||||||
add_shaders(Graph
|
|
||||||
shaders/mesh.vert
|
shaders/mesh.vert
|
||||||
shaders/mesh.frag
|
shaders/mesh.frag
|
||||||
shaders/post.vert
|
shaders/post.vert
|
||||||
|
@ -53,7 +70,6 @@ if(UNIX)
|
||||||
shaders/dof.frag
|
shaders/dof.frag
|
||||||
shaders/imgui.vert
|
shaders/imgui.vert
|
||||||
shaders/imgui.frag)
|
shaders/imgui.frag)
|
||||||
endif()
|
|
||||||
|
|
||||||
add_data(Graph
|
add_data(Graph
|
||||||
data/suzanne.obj
|
data/suzanne.obj
|
||||||
|
|
Reference in a new issue