|
Toshihiro Shimizu |
890ddd |
cmake_minimum_required(VERSION 2.8.11)
|
|
Campbell Barton |
a3a77b |
|
|
Campbell Barton |
a3a77b |
set(CMAKE_BUILD_TYPE_INIT Release)
|
|
Campbell Barton |
a3a77b |
|
|
Toshihiro Shimizu |
890ddd |
project(OpenToonz)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
8d5334 |
include(${CMAKE_SOURCE_DIR}/../cmake/util_compiler.cmake)
|
|
Campbell Barton |
8d5334 |
|
|
Toshihiro Shimizu |
890ddd |
get_filename_component(SDKROOT ../../thirdparty/ ABSOLUTE)
|
|
Campbell Barton |
326eaa |
message(STATUS "SDK Root:" ${SDKROOT})
|
|
jpumc |
a8cd98 |
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
|
|
roentgen |
19af1b |
if(APPLE)
|
|
roentgen |
19af1b |
set(THIRDPARTY_LIBS_HINTS "/usr/local/Cellar/" "/opt/include" ${SDKROOT})
|
|
Campbell Barton |
22fd3b |
elseif(WIN32 OR UNIX)
|
|
roentgen |
19af1b |
set(THIRDPARTY_LIBS_HINTS ${SDKROOT})
|
|
roentgen |
19af1b |
endif()
|
|
roentgen |
19af1b |
|
|
Campbell Barton |
326eaa |
message(STATUS "Thirdpary Library Search path:" ${THIRDPARTY_LIBS_HINTS})
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
f08982 |
if(WIN32)
|
|
Campbell Barton |
326eaa |
message(STATUS "Windows System")
|
|
Campbell Barton |
326eaa |
|
|
Shinya Kitaoka |
fd19c4 |
if(MSVC_VERSION GREATER 1800)
|
|
Shinya Kitaoka |
fd19c4 |
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
Shinya Kitaoka |
fd19c4 |
set(QT_PATH "C:/Qt/5.6/msvc2015" CACHE PATH "Qt instlattion directory")
|
|
Shinya Kitaoka |
fd19c4 |
else()
|
|
Shinya Kitaoka |
fd19c4 |
set(QT_PATH "C:/Qt/5.6/msvc2015_64" CACHE PATH "Qt instlattion directory")
|
|
Shinya Kitaoka |
fd19c4 |
endif()
|
|
Shinya Kitaoka |
aa5907 |
else()
|
|
Shinya Kitaoka |
fd19c4 |
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
Shinya Kitaoka |
fd19c4 |
set(QT_PATH "C:/Qt/Qt5.6.0_32/5.6/msvc2013" CACHE PATH "Qt instlattion directory")
|
|
Shinya Kitaoka |
fd19c4 |
else()
|
|
Shinya Kitaoka |
fd19c4 |
set(QT_PATH "C:/Qt/Qt5.6.0/5.6/msvc2013_64" CACHE PATH "Qt instlattion directory")
|
|
Shinya Kitaoka |
fd19c4 |
endif()
|
|
Shinya Kitaoka |
aa5907 |
endif()
|
|
Toshihiro Shimizu |
890ddd |
if(NOT EXISTS ${QT_PATH})
|
|
Toshihiro Shimizu |
890ddd |
message("Specify QT_PATH properly")
|
|
Toshihiro Shimizu |
890ddd |
return()
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
set(QT_LIB_PATH ${QT_PATH})
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_PREFIX_PATH "${QT_PATH}/lib/cmake/")
|
|
Shinya Kitaoka |
ee259f |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4251")
|
|
Shinya Kitaoka |
ee259f |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251")
|
|
Campbell Barton |
f2d492 |
add_definitions(
|
|
Campbell Barton |
f2d492 |
-DVC_EXTRALEAN
|
|
Campbell Barton |
f2d492 |
-DNOMINMAX
|
|
Campbell Barton |
f2d492 |
-D_USE_MATH_DEFINES
|
|
Campbell Barton |
f2d492 |
)
|
|
Campbell Barton |
f08982 |
elseif(APPLE)
|
|
Campbell Barton |
326eaa |
message(STATUS "Apple System")
|
|
Campbell Barton |
326eaa |
|
|
Campbell Barton |
f08982 |
if(NOT PLATFORM)
|
|
Toshihiro Shimizu |
890ddd |
set(PLATFORM 64)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
message("PLATFORM:" ${PLATFORM})
|
|
Campbell Barton |
f08982 |
if(PLATFORM EQUAL 64)
|
|
Shinya Kitaoka |
2a1f2b |
set(QT_PATH "~/Qt/5.6/clang_64/lib" CACHE PATH "Qt instlattion directory")
|
|
Shinya Kitaoka |
2a1f2b |
set(QT_LIB_PATH "${QT_PATH}/")
|
|
Shinya Kitaoka |
2a1f2b |
set(CMAKE_PREFIX_PATH "${QT_LIB_PATH}cmake/")
|
|
roentgen |
19af1b |
|
|
Toshihiro Shimizu |
890ddd |
message("CMAKE_PREFIX_PATH:" ${CMAKE_PREFIX_PATH})
|
|
Campbell Barton |
f2d492 |
add_definitions(
|
|
Campbell Barton |
f2d492 |
-DMACOSX
|
|
Campbell Barton |
f2d492 |
-Di386
|
|
Campbell Barton |
f2d492 |
)
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++11 -stdlib=libc++ -fno-implicit-templates")
|
|
Shinya Kitaoka |
12c444 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
|
|
Toshihiro Shimizu |
890ddd |
elseif(PLATFORM EQUAL 32)
|
|
Shinya Kitaoka |
2a1f2b |
set(QT_PATH "~/Qt/5.6/clang_32/lib" CACHE PATH "Qt instlattion directory")
|
|
Shinya Kitaoka |
2a1f2b |
set(QT_LIB_PATH "${QT_PATH}/")
|
|
Shinya Kitaoka |
2a1f2b |
set(CMAKE_PREFIX_PATH "${QT_LIB_PATH}cmake/")
|
|
Shinya Kitaoka |
2a1f2b |
|
|
Toshihiro Shimizu |
890ddd |
message("CMAKE_PREFIX_PATH:" ${CMAKE_PREFIX_PATH})
|
|
Campbell Barton |
f2d492 |
add_definitions(
|
|
Campbell Barton |
f2d492 |
-DMACOSX
|
|
Campbell Barton |
f2d492 |
-Di386
|
|
Campbell Barton |
f2d492 |
)
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -std=c++11 -stdlib=libc++ -fno-implicit-templates -D HAS_QUICKDRAW")
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m32")
|
|
Toshihiro Shimizu |
890ddd |
else()
|
|
Toshihiro Shimizu |
890ddd |
message(FATAL_ERROR "Invalid PLATFORM:" ${PLATFORM} ". 'PLATFORM' must be 32 or 64.")
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Campbell Barton |
22fd3b |
elseif(UNIX)
|
|
Campbell Barton |
326eaa |
message(STATUS "Unix System")
|
|
Campbell Barton |
326eaa |
|
|
Campbell Barton |
22fd3b |
# Needed for correct Qt detection
|
|
Campbell Barton |
22fd3b |
cmake_minimum_required(VERSION 2.8.12)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
|
Campbell Barton |
22fd3b |
set(PLATFORM 64)
|
|
Campbell Barton |
22fd3b |
else()
|
|
Campbell Barton |
22fd3b |
set(PLATFORM 32)
|
|
Campbell Barton |
22fd3b |
endif()
|
|
Campbell Barton |
6f1225 |
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
Campbell Barton |
22fd3b |
add_definitions(-DLINUX)
|
|
Campbell Barton |
22fd3b |
else()
|
|
Campbell Barton |
22fd3b |
message(WARNING "Support for generic Unix (Not Apple or Linux) isn't yet working!")
|
|
Campbell Barton |
22fd3b |
endif()
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
set(CMAKE_CXX_STANDARD 11)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
find_package(Qt5Widgets)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -lstdc++ -std=c++11")
|
|
Campbell Barton |
f08982 |
else()
|
|
Campbell Barton |
22fd3b |
message(ERROR "Unknown System")
|
|
Campbell Barton |
f08982 |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
f2d492 |
add_definitions(
|
|
Campbell Barton |
f2d492 |
-DQT_GUI_LIB
|
|
Campbell Barton |
f2d492 |
-DQT_NETWORK_LIB
|
|
Campbell Barton |
f2d492 |
-DQT_CORE_LIB
|
|
Campbell Barton |
f2d492 |
-DQT_SHARED
|
|
Campbell Barton |
f2d492 |
)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
# Find includes in corresponding build directories
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
7db469 |
if(APPLE)
|
|
Shinya Kitaoka |
7db469 |
set(CMAKE_MACOSX_RPATH ON)
|
|
Shinya Kitaoka |
7db469 |
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
tomosu |
9cb984 |
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
Shinya Kitaoka |
7db469 |
set(CMAKE_INSTALL_RPATH ${QT_LIB_PATH})
|
|
Shinya Kitaoka |
7db469 |
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
Shinya Kitaoka |
7db469 |
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${QT_LIB_PATH}" isSystemDir)
|
|
Shinya Kitaoka |
7db469 |
if("${isSystemDir}" STREQUAL "-1")
|
|
Shinya Kitaoka |
7db469 |
set(CMAKE_INSTALL_RPATH "${QT_LIB_PATH}")
|
|
Shinya Kitaoka |
7db469 |
endif()
|
|
Shinya Kitaoka |
7db469 |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
2e1cb6 |
include_directories(
|
|
Campbell Barton |
2e1cb6 |
include
|
|
Campbell Barton |
2e1cb6 |
)
|
|
roentgen |
19af1b |
|
|
Toshihiro Shimizu |
890ddd |
# Find the QtWidgets library
|
|
Toshihiro Shimizu |
890ddd |
find_package(Qt5 REQUIRED
|
|
Toshihiro Shimizu |
890ddd |
Core
|
|
Toshihiro Shimizu |
890ddd |
Gui
|
|
Toshihiro Shimizu |
890ddd |
Network
|
|
Toshihiro Shimizu |
890ddd |
OpenGL
|
|
Toshihiro Shimizu |
890ddd |
Svg
|
|
Toshihiro Shimizu |
890ddd |
Xml
|
|
Toshihiro Shimizu |
890ddd |
Script
|
|
Toshihiro Shimizu |
890ddd |
Widgets
|
|
Toshihiro Shimizu |
890ddd |
PrintSupport
|
|
shun_iwasawa |
21a6b6 |
LinguistTools
|
|
Campbell Barton |
9ece9c |
Multimedia
|
|
Campbell Barton |
9ece9c |
)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
5bb68e |
set(QT_MINIMUM_VERSION 5.5.0)
|
|
Campbell Barton |
5bb68e |
if(Qt5Core_VERSION VERSION_LESS QT_MINIMUM_VERSION)
|
|
Campbell Barton |
5bb68e |
MESSAGE(FATAL_ERROR "Minimum supported Qt version: ${QT_MINIMUM_VERSION}.
|
|
Campbell Barton |
5bb68e |
Installed version: ${Qt5Core_VERSION}")
|
|
Campbell Barton |
5bb68e |
endif()
|
|
Campbell Barton |
5bb68e |
unset(QT_MINIMUM_VERSION)
|
|
Campbell Barton |
5bb68e |
|
|
Toshihiro Shimizu |
890ddd |
if(WIN32)
|
|
Toshihiro Shimizu |
890ddd |
include_directories(
|
|
Campbell Barton |
a9c3da |
SYSTEM
|
|
Toshihiro Shimizu |
890ddd |
${SDKROOT}/glut/3.7.6/include
|
|
kusano |
897736 |
${SDKROOT}/zlib-1.2.8
|
|
Campbell Barton |
2e1cb6 |
${SDKROOT}/LibJPEG/jpeg-9
|
|
Campbell Barton |
2e1cb6 |
)
|
|
Campbell Barton |
f2d492 |
add_definitions(
|
|
Campbell Barton |
f2d492 |
-DGLUT_NO_LIB_PRAGMA
|
|
Campbell Barton |
f2d492 |
)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
get_target_property(QtCore_location Qt5::Core LOCATION)
|
|
Toshihiro Shimizu |
890ddd |
get_target_property(QtWidget_location Qt5::Widgets LOCATION)
|
|
Campbell Barton |
326eaa |
message(STATUS "Qt Core Location:" ${QtCore_location})
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
macro(_find_toonz_library OUT_LIB_LIST IN_LIB_LIST)
|
|
Toshihiro Shimizu |
890ddd |
set(OUTLIST "")
|
|
Toshihiro Shimizu |
890ddd |
foreach(arg ${IN_LIB_LIST})
|
|
Toshihiro Shimizu |
890ddd |
unset(COREPATH CACHE)
|
|
Toshihiro Shimizu |
890ddd |
# find しても cmake が走るときにはできていないので完全なパス名を生成して返すだけ
|
|
Campbell Barton |
22fd3b |
if(APPLE)
|
|
Toshihiro Shimizu |
890ddd |
set(LIBPATH ${CMAKE_CURRENT_BINARY_DIR}/../${arg}/lib${arg}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
Campbell Barton |
22fd3b |
else()
|
|
Campbell Barton |
22fd3b |
set(LIBPATH ${arg})
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
set(OUTLIST ${OUTLIST} ${LIBPATH})
|
|
Toshihiro Shimizu |
890ddd |
endforeach()
|
|
Toshihiro Shimizu |
890ddd |
set(${OUT_LIB_LIST} ${OUTLIST})
|
|
Toshihiro Shimizu |
890ddd |
endmacro()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
set(TNZSTDFX_Location)
|
|
Toshihiro Shimizu |
890ddd |
set(TFARM_Location)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
if(WIN32)
|
|
Campbell Barton |
f08982 |
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
Toshihiro Shimizu |
890ddd |
set(PLATFORM 32)
|
|
Toshihiro Shimizu |
890ddd |
set(PLATFORM2)
|
|
Toshihiro Shimizu |
890ddd |
else()
|
|
Toshihiro Shimizu |
890ddd |
set(PLATFORM 64)
|
|
Toshihiro Shimizu |
890ddd |
set(PLATFORM2 _64)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
fd19c4 |
if(MSVC_VERSION GREATER 1800)
|
|
Shinya Kitaoka |
fd19c4 |
set(MSVC_LIB_VERSION 2015)
|
|
Shinya Kitaoka |
fd19c4 |
else()
|
|
Shinya Kitaoka |
fd19c4 |
set(MSVC_LIB_VERSION 2013)
|
|
Shinya Kitaoka |
fd19c4 |
endif()
|
|
Shinya Kitaoka |
fd19c4 |
|
|
Toshihiro Shimizu |
890ddd |
set(GLUT_LIB ${SDKROOT}/glut/3.7.6/lib/glut${PLATFORM}.lib)
|
|
Toshihiro Shimizu |
890ddd |
set(GL_LIB opengl32.lib)
|
|
Toshihiro Shimizu |
890ddd |
set(Z_LIB
|
|
Shinya Kitaoka |
fd19c4 |
optimized ${SDKROOT}/zlib-1.2.8/lib/zlib-1.2.8_${MSVC_LIB_VERSION}${PLATFORM2}.lib
|
|
Campbell Barton |
9ece9c |
debug ${SDKROOT}/zlib-1.2.8/lib/zlib-1.2.8_${MSVC_LIB_VERSION}${PLATFORM2}d.lib
|
|
Campbell Barton |
9ece9c |
)
|
|
Shinya Kitaoka |
fd19c4 |
set(JPEG_LIB ${SDKROOT}/LibJPEG/jpeg-9/lib/LibJPEG-9_${MSVC_LIB_VERSION}${PLATFORM2}.lib)
|
|
kusano |
3f5122 |
set(TIFF_INCLUDE_DIR ${SDKROOT}/tiff-4.0.3/libtiff)
|
|
Toshihiro Shimizu |
890ddd |
set(TIFF_LIB
|
|
Shinya Kitaoka |
fd19c4 |
optimized ${SDKROOT}/tiff-4.0.3/lib/LibTIFF-4.0.3_${MSVC_LIB_VERSION}${PLATFORM2}.lib
|
|
Campbell Barton |
9ece9c |
debug ${SDKROOT}/tiff-4.0.3/lib/LibTIFF-4.0.3_${MSVC_LIB_VERSION}${PLATFORM2}d.lib
|
|
Campbell Barton |
9ece9c |
)
|
|
kusano |
3f5122 |
set(PNG_LIB
|
|
Shinya Kitaoka |
fd19c4 |
optimized ${SDKROOT}/libpng-1.6.21/lib/libpng16_${MSVC_LIB_VERSION}${PLATFORM2}.lib
|
|
Campbell Barton |
9ece9c |
debug ${SDKROOT}/libpng-1.6.21/lib/libpng16_${MSVC_LIB_VERSION}${PLATFORM2}d.lib
|
|
Campbell Barton |
9ece9c |
)
|
|
Toshihiro Shimizu |
890ddd |
set(GLEW_LIB ${SDKROOT}/glew/glew-1.9.0/lib/glew${PLATFORM}.lib)
|
|
Toshihiro Shimizu |
890ddd |
set(LZ4_LIB ${SDKROOT}/Lz4/Lz4_131/lz4_${PLATFORM}.lib)
|
|
Shinya Kitaoka |
fd19c4 |
set(SUPERLU_LIB ${SDKROOT}/superlu/SuperLU_${MSVC_LIB_VERSION}_${PLATFORM}.lib)
|
|
Toshihiro Shimizu |
890ddd |
set(OPENBLAS_LIB ${SDKROOT}/openblas/libopenblas_${PLATFORM}.lib)
|
|
Toshihiro Shimizu |
890ddd |
set(USB_LIB) # unused
|
|
Campbell Barton |
f08982 |
if(PLATFORM EQUAL 32)
|
|
Toshihiro Shimizu |
890ddd |
set(QT_LIB ${SDKROOT}/quicktime/QT73SDK/Libraries/QTMLClient.lib)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Campbell Barton |
22fd3b |
elseif(APPLE)
|
|
Toshihiro Shimizu |
890ddd |
find_library(GLUT_LIB GLUT)
|
|
Toshihiro Shimizu |
890ddd |
find_library(GL_LIB OpenGL)
|
|
Toshihiro Shimizu |
890ddd |
find_library(Z_LIB z)
|
|
roentgen |
19af1b |
|
|
fukasawa |
e60969 |
find_package(TIFF REQUIRED)
|
|
fukasawa |
e60969 |
set(TIFF_LIB ${TIFF_LIBRARY})
|
|
roentgen |
19af1b |
# the libraries have not .pc nor preferred Find*.cmake. use custom modules.
|
|
fukasawa |
e60969 |
find_package(PNG REQUIRED)
|
|
fukasawa |
e60969 |
message("******* libpng:" ${PNG_LIBRARY})
|
|
fukasawa |
e60969 |
set(PNG_LIB ${PNG_LIBRARY})
|
|
roentgen |
19af1b |
find_package(GLEW)
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
find_package(SuperLU REQUIRED)
|
|
roentgen |
19af1b |
set(SUPERLU_INCLUDE_DIR ${SUPERLU_INCLUDE_DIR}/superlu)
|
|
roentgen |
19af1b |
set(SUPERLU_LIB ${SUPERLU_LIBRARY})
|
|
roentgen |
19af1b |
message("SuperLU:" ${SUPERLU_INCLUDE_DIR})
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
find_package(JPEG REQUIRED)
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
# the libraries have .pc
|
|
roentgen |
19af1b |
find_package(PkgConfig)
|
|
roentgen |
19af1b |
if(GLEW-NOTFOUND)
|
|
roentgen |
19af1b |
pkg_check_modules(GLEW REQUIRED glew)
|
|
roentgen |
19af1b |
endif()
|
|
roentgen |
19af1b |
set(GLEW_LIB ${GLEW_LIBRARIES})
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
pkg_check_modules(LZ4_LIB REQUIRED liblz4)
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
message("**************** lz4 lib:" ${LZ4_LIB_INCLUDE_DIRS})
|
|
roentgen |
19af1b |
find_path(LZ4_STATIC lz4frame_static.h PATH ${LZ4_LIB_INCLUDE_DIRS})
|
|
roentgen |
19af1b |
if(LZ4_STATIC-FOUND)
|
|
roentgen |
19af1b |
add_definitions(-DLZ4_STATIC)
|
|
roentgen |
19af1b |
endif()
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
pkg_check_modules(USB_LIB REQUIRED libusb-1.0)
|
|
Toshihiro Shimizu |
890ddd |
set(OPENBLAS_LIB) # unused?
|
|
Campbell Barton |
f08982 |
if(PLATFORM EQUAL 32)
|
|
Toshihiro Shimizu |
890ddd |
find_library(QT_LIB QuickTime)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
roentgen |
19af1b |
|
|
roentgen |
19af1b |
set(JPEG_LIB ${JPEG_LIBRARY})
|
|
roentgen |
19af1b |
set(LZ4_LIB ${LZ4_LIB_LDFLAGS})
|
|
roentgen |
3047bb |
|
|
roentgen |
3047bb |
find_package(LZO REQUIRED)
|
|
roentgen |
3047bb |
message("LZO:" ${LZO_INCLUDE_DIR})
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
elseif(UNIX)
|
|
Campbell Barton |
22fd3b |
find_library(GL_LIB GL)
|
|
Campbell Barton |
22fd3b |
find_library(GLU_LIB GLU)
|
|
Campbell Barton |
22fd3b |
find_library(GLUT_LIB glut)
|
|
Campbell Barton |
22fd3b |
find_library(Z_LIB z)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
find_package(TIFF REQUIRED)
|
|
Campbell Barton |
22fd3b |
find_package(PNG REQUIRED)
|
|
Campbell Barton |
22fd3b |
set(PNG_LIB ${PNG_LIBRARY})
|
|
Campbell Barton |
22fd3b |
message("******* libpng:" ${PNG_LIB})
|
|
Campbell Barton |
22fd3b |
find_package(GLEW)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
find_package(SuperLU REQUIRED)
|
|
Campbell Barton |
22fd3b |
set(SUPERLU_INCLUDE_DIR ${SUPERLU_INCLUDE_DIR}/superlu)
|
|
Campbell Barton |
22fd3b |
set(SUPERLU_LIB ${SUPERLU_LIBRARY})
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
find_package(JPEG REQUIRED)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
# the libraries have .pc
|
|
Campbell Barton |
22fd3b |
find_package(PkgConfig)
|
|
Michał Janiszewski |
6dc4b9 |
|
|
Michał Janiszewski |
6dc4b9 |
# This is not required for OpenToonz itself, but libtiff will pick it up if
|
|
Michał Janiszewski |
6dc4b9 |
# present and libimage won't be aware causing linker to fail
|
|
Michał Janiszewski |
6dc4b9 |
pkg_check_modules(LZMA liblzma)
|
|
Michał Janiszewski |
6dc4b9 |
set(TIFF_LIB ${TIFF_LIBRARY} ${LZMA_LIBRARIES})
|
|
Michał Janiszewski |
6dc4b9 |
|
|
Campbell Barton |
22fd3b |
if(GLEW-NOTFOUND)
|
|
Campbell Barton |
22fd3b |
pkg_check_modules(GLEW REQUIRED glew)
|
|
Campbell Barton |
22fd3b |
endif()
|
|
Campbell Barton |
22fd3b |
set(GLEW_LIB ${GLEW_LIBRARIES})
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
pkg_check_modules(LZ4_LIB REQUIRED liblz4)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
message("**************** lz4 lib:" ${LZ4_LIB_INCLUDE_DIRS})
|
|
Campbell Barton |
22fd3b |
find_path(LZ4_STATIC lz4frame_static.h PATH ${LZ4_LIB_INCLUDE_DIRS})
|
|
Campbell Barton |
22fd3b |
if(LZ4_STATIC-FOUND)
|
|
Campbell Barton |
22fd3b |
add_definitions(-DLZ4_STATIC)
|
|
Campbell Barton |
22fd3b |
endif()
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
pkg_check_modules(USB_LIB REQUIRED libusb-1.0)
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
# TODO: check for them properly in some sane order with pkg-config
|
|
Campbell Barton |
22fd3b |
find_library(OPENBLAS_LIB NAMES cblas gslcblas openblas blas)
|
|
Campbell Barton |
22fd3b |
message("OpenBLAS:" ${OPENBLAS_LIB})
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
set(JPEG_LIB ${JPEG_LIBRARY})
|
|
Campbell Barton |
22fd3b |
set(LZ4_LIB ${LZ4_LIB_LDFLAGS})
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
find_package(LZO REQUIRED)
|
|
Campbell Barton |
22fd3b |
message("LZO:" ${LZO_INCLUDE_DIR})
|
|
Campbell Barton |
22fd3b |
|
|
Campbell Barton |
22fd3b |
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
|
Campbell Barton |
89a491 |
pkg_check_modules(SDL_LIB REQUIRED sdl2)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
8d5334 |
|
|
Campbell Barton |
a0c6e1 |
include(TestBigEndian)
|
|
Campbell Barton |
a0c6e1 |
test_big_endian(_SYSTEM_BIG_ENDIAN)
|
|
Campbell Barton |
a0c6e1 |
if(_SYSTEM_BIG_ENDIAN)
|
|
Campbell Barton |
a0c6e1 |
add_definitions(-DTNZ_LITTLE_ENDIAN=0)
|
|
Campbell Barton |
a0c6e1 |
else()
|
|
Campbell Barton |
a0c6e1 |
add_definitions(-DTNZ_LITTLE_ENDIAN=1)
|
|
Campbell Barton |
a0c6e1 |
endif()
|
|
Campbell Barton |
a0c6e1 |
unset(_SYSTEM_BIG_ENDIAN)
|
|
Campbell Barton |
a0c6e1 |
|
|
Campbell Barton |
a0c6e1 |
|
|
Campbell Barton |
8d5334 |
set(C_WARNINGS)
|
|
Campbell Barton |
8d5334 |
set(CXX_WARNINGS)
|
|
Campbell Barton |
8d5334 |
|
|
Campbell Barton |
8d5334 |
if(CMAKE_COMPILER_IS_GNUCC)
|
|
Campbell Barton |
8d5334 |
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
|
|
Campbell Barton |
8d5334 |
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEF -Wundef)
|
|
Campbell Barton |
8c6c57 |
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
|
|
Campbell Barton |
8d5334 |
|
|
Campbell Barton |
8d5334 |
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)
|
|
Campbell Barton |
8d5334 |
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
|
|
Campbell Barton |
8c6c57 |
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
|
|
Campbell Barton |
8d5334 |
endif()
|
|
Campbell Barton |
8d5334 |
|
|
Campbell Barton |
8d5334 |
|
|
Campbell Barton |
2e1cb6 |
include_directories(
|
|
Campbell Barton |
a9c3da |
SYSTEM
|
|
Campbell Barton |
2e1cb6 |
BEFORE
|
|
Campbell Barton |
2e1cb6 |
${TIFF_INCLUDE_DIR}
|
|
Campbell Barton |
2e1cb6 |
${PNG_INCLUDE_DIRS}
|
|
Campbell Barton |
2e1cb6 |
)
|
|
Michael Cullen |
b49802 |
|
|
Campbell Barton |
22fd3b |
if(WIN32 OR APPLE)
|
|
Campbell Barton |
2e1cb6 |
find_path(
|
|
Campbell Barton |
2e1cb6 |
BOOST_ROOT
|
|
Campbell Barton |
2e1cb6 |
include/boost
|
|
Campbell Barton |
2e1cb6 |
boost
|
|
Campbell Barton |
2e1cb6 |
HINTS
|
|
Campbell Barton |
2e1cb6 |
${THIRDPARTY_LIBS_HINTS}
|
|
Campbell Barton |
2e1cb6 |
PATH_SUFFIXES
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_61_0/
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_60_0/
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_59_0/
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_58_0/
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_57_0/
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_56_0/
|
|
Campbell Barton |
2e1cb6 |
boost155/1.55.0_1/
|
|
Campbell Barton |
2e1cb6 |
boost/boost_1_55_0/
|
|
Campbell Barton |
2e1cb6 |
)
|
|
Campbell Barton |
89a491 |
find_package(Boost 1.55 REQUIRED)
|
|
Campbell Barton |
89a491 |
else()
|
|
Campbell Barton |
89a491 |
find_package(Boost)
|
|
Campbell Barton |
22fd3b |
endif()
|
|
roentgen |
19af1b |
|
|
Campbell Barton |
2e1cb6 |
include_directories(
|
|
Campbell Barton |
a9c3da |
SYSTEM
|
|
Campbell Barton |
2e1cb6 |
${Boost_INCLUDE_DIR}
|
|
Campbell Barton |
2e1cb6 |
${LZ4_LIB_INCLUDE_DIRS}
|
|
Campbell Barton |
2e1cb6 |
${USB_LIB_INCLUDE_DIRS}
|
|
Campbell Barton |
2e1cb6 |
${SUPERLU_INCLUDE_DIR}
|
|
Campbell Barton |
2e1cb6 |
${JPEG_INCLUDE_DIR}
|
|
Campbell Barton |
2e1cb6 |
)
|
|
roentgen |
19af1b |
|
|
Toshihiro Shimizu |
890ddd |
if(WIN32 AND PLATFORM EQUAL 64)
|
|
Toshihiro Shimizu |
890ddd |
add_definitions(-Dx64)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
if(WIN32)
|
|
Toshihiro Shimizu |
890ddd |
# place Toonz.exe and dlls in the same directory
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
Toshihiro Shimizu |
890ddd |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
|
Campbell Barton |
22fd3b |
elseif(APPLE)
|
|
Campbell Barton |
22fd3b |
# pass
|
|
Campbell Barton |
22fd3b |
elseif(UNIX)
|
|
Campbell Barton |
b45a54 |
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
|
Campbell Barton |
b45a54 |
|
|
Campbell Barton |
3158be |
# Mirror relative bin/lib location for installation
|
|
Campbell Barton |
3158be |
# so the generated shell script works in both cases.
|
|
Campbell Barton |
3158be |
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/opentoonz)
|
|
Campbell Barton |
3158be |
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/opentoonz)
|
|
Campbell Barton |
b45a54 |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
Campbell Barton |
3158be |
|
|
Campbell Barton |
3158be |
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
Campbell Barton |
3158be |
set(CMAKE_INSTALL_PREFIX "/opt/opentoonz" CACHE PATH "OpenToonz install prefix" FORCE)
|
|
Campbell Barton |
3158be |
endif()
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
f08982 |
if(MSVC AND MSVC_VERSION EQUAL 1800)
|
|
kusano |
543ae7 |
# Visual C++ 2013 cannot handle UTF-8 without BOM
|
|
kusano |
543ae7 |
# Non-ascii characters in comments would not be a problem
|
|
kusano |
543ae7 |
add_compile_options("/wd4819")
|
|
kusano |
543ae7 |
endif()
|
|
kusano |
543ae7 |
|
|
Toshihiro Shimizu |
890ddd |
# generate Qt translations and messages
|
|
Shinya Kitaoka |
822411 |
set(LANGUAGES japanese italian french spanish chinese german)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
function(add_translation module)
|
|
Toshihiro Shimizu |
890ddd |
set(translation)
|
|
Toshihiro Shimizu |
890ddd |
foreach(lang ${LANGUAGES})
|
|
Toshihiro Shimizu |
890ddd |
set(name "${CMAKE_SOURCE_DIR}/translations/${lang}/${module}.ts")
|
|
Toshihiro Shimizu |
890ddd |
list(APPEND translation ${name})
|
|
Toshihiro Shimizu |
890ddd |
set_source_files_properties(${name} PROPERTIES
|
|
Campbell Barton |
9ece9c |
OUTPUT_LOCATION "${CMAKE_BINARY_DIR}/loc/${lang}"
|
|
Campbell Barton |
9ece9c |
)
|
|
Toshihiro Shimizu |
890ddd |
endforeach()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
qt5_create_translation(message ${translation} ${ARGN})
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
add_custom_target("translation_${module}" DEPENDS ${message})
|
|
Toshihiro Shimizu |
890ddd |
set_target_properties("translation_${module}" PROPERTIES
|
|
Campbell Barton |
9ece9c |
EXCLUDE_FROM_DEFAULT_BUILD TRUE
|
|
Campbell Barton |
9ece9c |
)
|
|
Toshihiro Shimizu |
890ddd |
endfunction()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
8d5334 |
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS}")
|
|
Campbell Barton |
8d5334 |
set(CMAKE_CXX_FLAGS "${CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
|
|
Campbell Barton |
8d5334 |
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tnzcore)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tnzbase)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tnzext)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(toonzlib)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(toonzfarm/tfarm)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(stdfx)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(sound)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(colorfx)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(image)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(toonzqt)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tnztools)
|
|
Toshihiro Shimizu |
890ddd |
|
|
roentgen |
3047bb |
add_subdirectory(${SDKROOT}/lzo/driver lzodriver)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Keisuke Ogaki |
1a50d4 |
add_subdirectory(toonz)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tcleanupper)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tcomposer)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(tconverter)
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(toonzfarm)
|
|
tomosu |
9cb984 |
|
|
tomosu |
9cb984 |
if(APPLE)
|
|
tomosu |
9cb984 |
add_subdirectory(mousedragfilter)
|
|
tomosu |
9cb984 |
endif()
|
|
tomosu |
9cb984 |
|
|
Campbell Barton |
22fd3b |
if((PLATFORM EQUAL 32) AND (WIN32 OR APPLE))
|
|
Toshihiro Shimizu |
890ddd |
add_subdirectory(t32bitsrv)
|
|
Toshihiro Shimizu |
890ddd |
endif()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
f08982 |
if(APPLE)
|
|
Toshihiro Shimizu |
890ddd |
add_custom_command(TARGET executable
|
|
Toshihiro Shimizu |
890ddd |
POST_BUILD COMMAND
|
|
Toshihiro Shimizu |
890ddd |
${CMAKE_INSTALL_NAME_TOOL} -add_rpath ${CMAKE_INSTALL_RPATH}
|
|
Campbell Barton |
9ece9c |
$<target_file:executable></target_file:executable>
|
|
Campbell Barton |
9ece9c |
)
|
|
Campbell Barton |
f08982 |
endif()
|