-
Notifications
You must be signed in to change notification settings - Fork 19
/
CMakeLists.txt
58 lines (44 loc) · 1.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 2.4)
cmake_policy(SET CMP0015 NEW)
project(opentoonz_plugin_utility)
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(PLATFORM1 32)
set(PLATFORM2)
else()
set(PLATFORM1 64)
set(PLATFORM2 _64)
endif()
if(PLATFORM1 EQUAL 64)
add_definitions(-Dx64)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /openmp")
endif(WIN32)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
endif(APPLE)
find_package(OpenCV REQUIRED)
set(LIBS ${OpenCV_LIBS})
include_directories(plugin_sdk/core include "${OpenCV_INCLUDE_DIRS}")
link_directories("${OpenCV_LIBS}")
set(HEADERS
include/toonz_utility.hpp)
set(SOURCES
src/lib.cpp)
set(LIBNAME opentoonz_plugin_utility)
add_library(${LIBNAME} STATIC ${HEADERS} ${SOURCES})
set_target_properties(${LIBNAME} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
if(WIN32)
set_target_properties(${LIBNAME} PROPERTIES
PREFIX "lib"
SUFFIX ".lib")
endif(WIN32)
if(MAC)
set_target_properties(${LIBNAME} PROPERTIES
PREFIX "lib"
SUFFIX ".a")
endif(MAC)
target_link_libraries(${LIBNAME} ${LIBS})