Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #7

Merged
merged 1 commit into from
Mar 24, 2017
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
4 changes: 2 additions & 2 deletions scripts/install-deps-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ if [[ $? != 0 ]] ; then
else
echo "Homebrew Detected."
echo "Performing update ..."
sudo brew update
brew update
fi

for pkg in cmake libusb; do
for pkg in cmake libusb glew libpng jpeg; do
if brew list -1 | grep -q "^${pkg}\$"; then
echo "Package '$pkg' has already been installed."
else
Expand Down
3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if (Open3D_USE_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else()
message(WARNING "OpenMP NOT found")
message(STATUS "OpenMP NOT found")
endif()
endif()

Expand All @@ -96,7 +96,6 @@ message(STATUS "Open3D_BUILD_PYTHON_BINDING_TESTS=${Open3D_BUILD_PYTHON_BINDING_

# Handling dependencies
add_subdirectory(External)
include_directories(${GLEW_INCLUDE_DIRS})

# Open3D libraries
add_subdirectory(Core)
Expand Down
30 changes: 25 additions & 5 deletions src/External/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ if (Open3D_USE_NATIVE_DEPENDENCY_BUILD)
add_subdirectory(glew)
endif (GLEW_FOUND)

find_package(jpeg)
if (JPEG_FOUND)
message(STATUS "Use native build of libjpeg")
else (JPEG_FOUND)
message(STATUS "Build libjpeg from source")
add_subdirectory(libjpeg)
endif (JPEG_FOUND)

find_package(png)
if (PNG_FOUND)
message(STATUS "Use native build of libpng")
else (PNG_FOUND)
message(STATUS "Build libpng from source")
add_subdirectory(zlib)
add_subdirectory(libpng)
endif (PNG_FOUND)

add_subdirectory(GLFW)
add_subdirectory(zlib)
add_subdirectory(libpng)
add_subdirectory(libjpeg)
add_subdirectory(jsoncpp)
add_subdirectory(tinyfiledialogs)

Expand All @@ -26,10 +40,12 @@ if (Open3D_USE_NATIVE_DEPENDENCY_BUILD)
else (Open3D_USE_NATIVE_DEPENDENCY_BUILD)
message(STATUS "Build GLEW from source")
add_subdirectory(glew)
add_subdirectory(GLFW)
message(STATUS "Build libjpeg from source")
add_subdirectory(libjpeg)
message(STATUS "Build libpng from source")
add_subdirectory(zlib)
add_subdirectory(libpng)
add_subdirectory(libjpeg)
add_subdirectory(GLFW)
add_subdirectory(jsoncpp)
add_subdirectory(tinyfiledialogs)

Expand All @@ -45,3 +61,7 @@ endif(Open3D_USE_NATIVE_DEPENDENCY_BUILD)
# pop everything to root
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIRS} PARENT_SCOPE)
set(GLEW_LIBRARIES ${GLEW_LIBRARIES} PARENT_SCOPE)
set(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIR} PARENT_SCOPE)
set(JPEG_LIBRARIES ${JPEG_LIBRARIES} PARENT_SCOPE)
set(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIRS} PARENT_SCOPE)
set(PNG_LIBRARIES ${PNG_LIBRARIES} PARENT_SCOPE)
5 changes: 5 additions & 0 deletions src/External/libjpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ set_target_properties(${JPEG_LIBRARY} PROPERTIES
OUTPUT_NAME ${JPEG_LIBRARY}
FOLDER "External"
)

set(JPEG_INCLUDE_DIR "${Open3D_SOURCE_DIR}/External/libjpeg")
set(JPEG_LIBRARIES "jpeg")
set(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIR} PARENT_SCOPE)
set(JPEG_LIBRARIES ${JPEG_LIBRARIES} PARENT_SCOPE)
5 changes: 5 additions & 0 deletions src/External/libpng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,8 @@ set_target_properties(${PNG_LIBRARY} PROPERTIES
OUTPUT_NAME ${PNG_LIBRARY}
FOLDER "External"
)

set(PNG_INCLUDE_DIRS "${Open3D_SOURCE_DIR}/External/libpng")
set(PNG_LIBRARIES "png")
set(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIRS} PARENT_SCOPE)
set(PNG_LIBRARIES ${PNG_LIBRARIES} PARENT_SCOPE)
2 changes: 2 additions & 0 deletions src/External/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ set_target_properties(${ZLIB_LIBRARY} PROPERTIES
OUTPUT_NAME ${ZLIB_LIBRARY}
FOLDER "External"
)

set(ZLIB_LIBRARY ${ZLIB_LIBRARY} PARENT_SCOPE)
4 changes: 3 additions & 1 deletion src/IO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include_directories(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIRS})

file(GLOB IO_ALL_HEADER_FILES "*.h")
file(GLOB IO_ALL_SOURCE_FILES "*.cpp")
file(GLOB IO_RPLY_FILES "../External/rply/*.h" "../External/rply/*.c")
Expand All @@ -21,7 +23,7 @@ add_library(IO ${Open3D_LIB_TYPE}
${IO_CLASSIO_HEADER_FILES} ${IO_CLASSIO_SOURCE_FILES}
${IO_FILEFORMAT_HEADER_FILES} ${IO_FILEFORMAT_SOURCE_FILES}
)
target_link_libraries(IO Core png zlib jpeg jsoncpp tinyfiledialogs)
target_link_libraries(IO Core jsoncpp tinyfiledialogs ${JPEG_LIBRARIES} ${PNG_LIBRARIES})

install(TARGETS IO
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
Expand Down
2 changes: 1 addition & 1 deletion src/IO/FileFormat/FileJPG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <IO/ClassIO/ImageIO.h>

#include <libjpeg/jpeglib.h>
#include <jpeglib.h>
#include <Core/Utility/Console.h>

namespace three{
Expand Down
3 changes: 1 addition & 2 deletions src/IO/FileFormat/FilePNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

#include <IO/ClassIO/ImageIO.h>

#include <libpng/png.h>
#include <zlib/zlib.h>
#include <png.h>
#include <Core/Utility/Console.h>

namespace three{
Expand Down
2 changes: 2 additions & 0 deletions src/Visualization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include_directories(${GLEW_INCLUDE_DIRS})

# some black magic to automatically create a header file from shader files
file(GLOB SHADER_FILES "Shader/GLSL/*.glsl")
add_custom_command(
Expand Down