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

Allow TIFF, LZO, and SuperLU libraries to be found when compiling for… #37

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions toonz/cmake/FindLZO.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
find_path(LZO_INCLUDE_DIR NAMES lzoconf.h HINTS ${THIRDPARTY_LIBS_HINTS} PATH_SUFFIXES lzo/2.09/include/lzo lzo/2.03/include/lzo)
find_library(LZO_LIBRARY NAMES liblzo2.a lzo2_64.lib HINTS ${THIRDPARTY_LIBS_HINTS} PATH_SUFFIXES lzo/2.09/lib lzo/2.03/lib/LZO_lib)
find_path(LZO_INCLUDE_DIR NAMES lzoconf.h HINTS ${THIRDPARTY_LIBS_HINTS} /usr/include/lzo/ PATH_SUFFIXES lzo/2.09/include/lzo lzo/2.03/include/lzo)
find_library(LZO_LIBRARY NAMES liblzo2.a lzo2_64.lib HINTS ${THIRDPARTY_LIBS_HINTS} /usr/lib/i386-linux-gnu/ /usr/lib/x86_64-linux-gnu/ PATH_SUFFIXES lzo/2.09/lib lzo/2.03/lib/LZO_lib)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_library() shouldn't use either "i386-linux-gnu" nor "x86_64-linux-gnu" directly because it won't work for the other CPU architectures such as ARM. Instead, CMAKE_LIBRARY_ARCHITECTURE variable can be used here.


message("***** LZO Header path:" ${LZO_INCLUDE_DIR})
message("***** LZO Libarary path:" ${LZO_LIBRARY})
Expand Down
4 changes: 2 additions & 2 deletions toonz/cmake/FindSuperLU.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# preferred homebrew's directories.
find_path(SUPERLU_INCLUDE_DIR NAMES slu_Cnames.h HINTS ${THIRDPARTY_LIBS_HINTS} PATH_SUFFIXES superlu43/4.3_1/include/superlu superlu/SuperLU_4.1/include)
find_library(SUPERLU_LIBRARY NAMES libsuperlu.a libsuperlu_4.1.a HINTS ${THIRDPARTY_LIBS_HINTS} PATH_SUFFIXES superlu43/4.3_1/lib superlu)
find_path(SUPERLU_INCLUDE_DIR NAMES slu_Cnames.h HINTS ${THIRDPARTY_LIBS_HINTS} /usr/include/superlu/ PATH_SUFFIXES superlu43/4.3_1/include/superlu superlu/SuperLU_4.1/include)
find_library(SUPERLU_LIBRARY NAMES libsuperlu.a libsuperlu_4.1.a HINTS ${THIRDPARTY_LIBS_HINTS} /usr/lib/i386-linux-gnu/ /usr/lib/x86_64-linux-gnu/ PATH_SUFFIXES superlu43/4.3_1/lib superlu)

message("***** SuperLU Header path:" ${SUPERLU_INCLUDE_DIR})
message("***** SuperLU Libarary path:" ${SUPERLU_LIBRARY})
Expand Down
4 changes: 2 additions & 2 deletions toonz/cmake/FindTIFF.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# looks for libtiff(4.0.3 modified)
find_path(TIFF_INCLUDE_DIR NAMES tiffio.h HINTS ${SDKROOT} PATH_SUFFIXES tiff-4.0.3/libtiff/)
find_library(TIFF_LIBRARY NAMES libtiff.a HINTS ${SDKROOT} PATH_SUFFIXES tiff-4.0.3/libtiff/.libs NO_DEFAULT_PATH)
find_path(TIFF_INCLUDE_DIR NAMES tiffio.h HINTS ${SDKROOT} /usr/include/i386-linux-gnu/ /usr/include/x86_64-linux-gnu/ PATH_SUFFIXES tiff-4.0.3/libtiff/)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a concept, using the shared libraries already on the system is probably a decent idea. It might be better to use pkgconfig to retrieve the locations/flags though, as that's already a dependency + should be more cross platform compatible.

As an example on OSX:

$ pkg-config --libs libtiff-4
-L/usr/local/Cellar/libtiff/4.0.6/lib -ltiff
$ pkg-config --cflags libtiff-4
-I/usr/local/Cellar/libtiff/4.0.6/include

Those values should be usable to pass into appropriate variables.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_library(TIFF_LIBRARY NAMES libtiff.a HINTS ${SDKROOT} /usr/include/i386-linux-gnu/ /usr/lib/x86_64-linux-gnu/ PATH_SUFFIXES tiff-4.0.3/libtiff/.libs NO_DEFAULT_PATH)

message("***** libtiff Header path:" ${TIFF_INCLUDE_DIR})
message("***** libtiff Libarary path:" ${TIFF_LIBRARY})
Expand Down