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
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ if(MV_UNITY_BUILD)
set_target_properties(${PROJECT} PROPERTIES UNITY_BUILD ON)
endif()

if(APPLE)
set_target_properties(${PROJECT} PROPERTIES
INSTALL_RPATH "@executable_path/../Frameworks"
INSTALL_RPATH_USE_LINK_PATH TRUE
)
endif()

# -----------------------------------------------------------------------------
# Target library linking
# -----------------------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions cmake/FindFreeImage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ else()
NAMES
FreeImage.h
PATHS
${FREEIMAGE_CHECK_INCLUDE_DIRS})
${FREEIMAGE_CHECK_INCLUDE_DIRS}
)

find_library(FreeImage_LIBRARIES
NAMES
freeimage
PATHS
${FREEIMAGE_CHECK_LIBRARY_DIRS})
${FREEIMAGE_CHECK_LIBRARY_DIRS}
)

if(FREEIMAGE_INCLUDE_DIRS AND FREEIMAGE_LIBRARIES)
if(FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES)
set(FREEIMAGE_FOUND TRUE)

add_library(FreeImage INTERFACE IMPORTED)
target_include_directories(
FreeImage INTERFACE ${FREEIMAGE_INCLUDE_DIRS})
target_link_libraries(
FreeImage INTERFACE ${FREEIMAGE_LIBRARIES})
add_library(FreeImage SHARED IMPORTED)
set_target_properties(FreeImage PROPERTIES
IMPORTED_LOCATION "${FreeImage_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${FreeImage_INCLUDE_DIRS}"
)

message(STATUS "Found FreeImage")
message(STATUS " Includes : ${FREEIMAGE_INCLUDE_DIRS}")
message(STATUS " Libraries : ${FREEIMAGE_LIBRARIES}")
message(STATUS " Includes : ${FreeImage_INCLUDE_DIRS}")
message(STATUS " Libraries : ${FreeImage_LIBRARIES}")
else()
message(FATAL_ERROR "Could not find FreeImage")
endif()
Expand Down