forked from charlesangus/DeepC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Builds successfully on macOS 10.13, untested but should work on Linux and possibly even even Windows (issues charlesangus#1 and charlesangus#2)
- Loading branch information
Showing
4 changed files
with
223 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
cmake_minimum_required(VERSION 3.4) | ||
|
||
# Pick up share/cmake/ modules | ||
# TODO: Append instead of overriding | ||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/share/cmake) | ||
|
||
# If CMAKE_INSTALL_EXEC_PREFIX is not specified, install binaries | ||
# directly into the regular install prefix | ||
if(NOT CMAKE_INSTALL_EXEC_PREFIX) | ||
message("Exec prefix not specified, defaulting to ${CMAKE_INSTALL_PREFIX}") | ||
set(CMAKE_INSTALL_EXEC_PREFIX ${CMAKE_INSTALL_PREFIX}) | ||
endif() | ||
|
||
# Locate Nuke or error | ||
find_package(Nuke REQUIRED) | ||
message("Build Nuke plugins against ${Nuke_LIBRARY_DIR}") | ||
|
||
if(Nuke_DDImageVersion VERSION_LESS 11) | ||
# No C++11 stuff until compiler update in Nuke 11 | ||
else() | ||
set (CMAKE_CXX_STANDARD 11) | ||
endif() | ||
|
||
if(APPLE) | ||
# Flag required on OS X to allow Nuke API symbols to be found at runtime | ||
set(DEEPC_LINK_FLAGS "-undefined dynamic_lookup") | ||
else() | ||
set(DEEPC_LINK_FLAGS "") | ||
endif() | ||
|
||
|
||
# Include Nuke headers | ||
include_directories( | ||
${Nuke_INCLUDE_DIR} | ||
) | ||
|
||
# Add plugins | ||
add_library(DeepCAddChannels SHARED | ||
src/DeepCAddChannels.cpp | ||
) | ||
add_library(DeepCBlink SHARED | ||
src/DeepCBlink.cpp | ||
) | ||
add_library(DeepCGrade SHARED | ||
src/DeepCGrade.cpp | ||
) | ||
add_library(DeepCID SHARED | ||
src/DeepCID.cpp | ||
) | ||
add_library(DeepCPMatte SHARED | ||
src/DeepCPMatte.cpp | ||
) | ||
#add_library(DeepCPNoise SHARED | ||
# src/DeepCPNoise.cpp | ||
#) | ||
add_library(DeepCRemoveChannels SHARED | ||
src/DeepCRemoveChannels.cpp | ||
) | ||
add_library(DeepCSaturation SHARED | ||
src/DeepCSaturation.cpp | ||
) | ||
add_library(DeepCShuffle SHARED | ||
src/DeepCShuffle.cpp | ||
) | ||
add_library(DeepCWorld SHARED | ||
src/DeepCWorld.cpp | ||
) | ||
|
||
|
||
set_target_properties( | ||
DeepCAddChannels | ||
DeepCBlink | ||
DeepCGrade | ||
DeepCID | ||
DeepCPMatte | ||
#DeepCPNoise | ||
DeepCRemoveChannels | ||
DeepCSaturation | ||
DeepCShuffle | ||
DeepCWorld | ||
|
||
PROPERTIES | ||
PREFIX "" # No lib prefix | ||
LINK_FLAGS "${DEEPC_LINK_FLAGS}" | ||
) | ||
|
||
# Once built, copy the library into install location (e.g "executable-prefix/lib/nuke/6.2") | ||
install(TARGETS | ||
DeepCAddChannels | ||
DeepCBlink | ||
DeepCGrade | ||
DeepCID | ||
DeepCPMatte | ||
#DeepCPNoise | ||
DeepCRemoveChannels | ||
DeepCSaturation | ||
DeepCShuffle | ||
DeepCWorld | ||
DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/plugins) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#========== | ||
# | ||
# Copyright (c) 2010, Dan Bethell. | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are | ||
# met: | ||
# | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# * Neither the name of Dan Bethell nor the names of any | ||
# other contributors to this software may be used to endorse or | ||
# promote products derived from this software without specific prior | ||
# written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
#========== | ||
# | ||
# Variables defined by this module: | ||
# Nuke_FOUND | ||
# Nuke_INCLUDE_DIR | ||
# Nuke_COMPILE_FLAGS | ||
# Nuke_LINK_FLAGS | ||
# Nuke_LIBRARIES | ||
# Nuke_LIBRARY_DIR | ||
# | ||
# Usage: | ||
# FIND_PACKAGE( Nuke ) | ||
# FIND_PACKAGE( Nuke REQUIRED ) | ||
# | ||
# Note: | ||
# You can tell the module where Nuke is installed by setting | ||
# the NUKE_INSTALL_PATH (or setting the NDK_PATH environment | ||
# variable before calling FIND_PACKAGE. | ||
# | ||
# E.g. | ||
# SET( NUKE_INSTALL_PATH "/usr/local/Nuke5.2v3" ) | ||
# FIND_PACKAGE( Nuke REQUIRED ) | ||
# | ||
#========== | ||
|
||
# our includes | ||
FIND_PATH( Nuke_INCLUDE_DIR DDImage/Op.h | ||
$ENV{NDK_PATH}/include | ||
${NUKE_INSTALL_PATH}/include | ||
) | ||
|
||
# our library | ||
FIND_LIBRARY( Nuke_LIBRARIES DDImage | ||
$ENV{NDK_PATH} | ||
${NUKE_INSTALL_PATH} | ||
) | ||
|
||
SET( Nuke_COMPILE_FLAGS "" ) | ||
SET( Nuke_LINK_FLAGS "" ) | ||
IF( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) | ||
SET( Nuke_COMPILE_FLAGS "-arch i386" ) | ||
SET( Nuke_LINK_FLAGS "-arch i386" ) | ||
ENDIF( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) | ||
|
||
# our library path | ||
GET_FILENAME_COMPONENT( Nuke_LIBRARY_DIR ${Nuke_LIBRARIES} PATH ) | ||
|
||
# did we find everything? | ||
INCLUDE( FindPackageHandleStandardArgs ) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Nuke" DEFAULT_MSG | ||
Nuke_INCLUDE_DIR | ||
Nuke_LIBRARIES | ||
Nuke_LIBRARY_DIR | ||
) | ||
|
||
SET( Nuke_DDImageVersion "" ) | ||
IF( NUKE_FOUND ) | ||
TRY_RUN(NUKE_VERSION_EXITCODE NUKE_VERSION_COMPILED | ||
${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}/TestForDDImageVersion.cxx | ||
COMPILE_DEFINITIONS "-I${Nuke_INCLUDE_DIR}" | ||
RUN_OUTPUT_VARIABLE Nuke_DDImageVersion) | ||
message(STATUS "Nuke_DDImageVersion: --${Nuke_DDImageVersion}--") | ||
ENDIF() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <iostream> | ||
#include "DDImage/ddImageVersionNumbers.h" | ||
int main(int, char*[]) | ||
{ | ||
// Print a Nuke API identifier number, used to make the | ||
// lib/nuke${API_NUMBER} directory | ||
|
||
// Nuke aims to maintain API compatibilty between "v" releases, so | ||
// compiling for 6.1v1 will work with 6.1v2 etc (but not | ||
// 6.2v1). Only exception has been 5.1v5 and 5.1v6 (because it was | ||
// supposed to be 5.2v1) | ||
std::cout << kDDImageVersionMajorNum << "." << kDDImageVersionMinorNum; | ||
return 0; | ||
} | ||
|