Skip to content
Permalink
Browse files

Compiled plugins now built using Cmake.

Added new hcmake wrapper command which invokes cmake with the setup Houdini env.
  • Loading branch information...
captainhammy committed Feb 18, 2019
1 parent 5f54abe commit 1289f8d865a12e7b1ff1df07c5a65673bb18c9fb
@@ -1,33 +1,5 @@

SUBDIRS = plugins

INSTALLDIRS = $(SUBDIRS:%=install-%)
CLEANDIRS = $(SUBDIRS:%=clean-%)
CLOBBERDIRS = $(SUBDIRS:%=clobber-%)

all: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@

install: $(INSTALLDIRS)
$(INSTALLDIRS):
$(MAKE) -C $(@:install-%=%) install

clean: $(CLEANDIRS)
$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) clean

clobber: $(CLOBBERDIRS)
$(CLOBBERDIRS):
$(MAKE) -C $(@:clobber-%=%) clobber

.PHONY: subdirs $(SUBDIRS)
.PHONY: subdirs $(INSTALLDIRS)
.PHONY: subdirs $(CLEANDIRS)
.PHONY: subdirs $(CLOBBERDIRS)
.PHONY: install clean clobber

# Quickly compile Qt icons using PySide2.
# Quickly compile Qt icons using PySide2.
build-icons:
pyside2-rcc -o python/ht/ui/icons.py icons/icons.qrc

@@ -19,13 +19,13 @@ _DEFAULT_WRAPPERS = [
"ginfo",
"gplay",
"hbatch",
"hcmake",
"hcollapse",
"hconfig",
"hcustom",
"hexpand",
"hescape",
"hkey",
"hmake",
"hmaster",
"hotl",
"houdini",
@@ -0,0 +1,72 @@


cmake_minimum_required( VERSION 3.6 )

project( HoudiniToolbox )

# CMAKE_PREFIX_PATH must contain the path to the toolkit/cmake subdirectory of
# the Houdini installation. See the "Compiling with CMake" section of the HDK
# documentation for more details, which describes several options for
# specifying this path.
list( APPEND CMAKE_PREFIX_PATH "$ENV{HFS}/toolkit/cmake" )

# Locate Houdini's libraries and header files.
# Registers an imported library target named 'Houdini'.
find_package( Houdini REQUIRED )

function ( add_secondary_files )
cmake_parse_arguments( MY_INSTALL
""
"SHELF;HELP;ICON"
""
${ARGN}
)

set( files_to_clean "")

if ( MY_INSTALL_SHELF )
add_custom_command(
TARGET ${library_name} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"${PROJECT_SOURCE_DIR}/${MY_INSTALL_SHELF}"
"$ENV{PLUGIN_BUILD_DIR}/toolbar/${MY_INSTALL_SHELF}"
COMMENT "Copying shelf file to target")

list(APPEND files_to_clean "$ENV{PLUGIN_BUILD_DIR}/toolbar/${MY_INSTALL_SHELF}")

endif()

if ( MY_INSTALL_ICON )
add_custom_command(
TARGET ${library_name} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"${PROJECT_SOURCE_DIR}/${MY_INSTALL_ICON}"
"$ENV{PLUGIN_BUILD_DIR}/config/Icons/${MY_INSTALL_ICON}"
COMMENT "Copying icon file to target")

list(APPEND files_to_clean "$ENV{PLUGIN_BUILD_DIR}/config/Icons/${MY_INSTALL_ICON}")

endif()

if ( MY_INSTALL_HELP )
add_custom_command(
TARGET ${library_name} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"${PROJECT_SOURCE_DIR}/${MY_INSTALL_HELP}"
"$ENV{PLUGIN_BUILD_DIR}/help/nodes/${op_context}/${MY_INSTALL_HELP}"
COMMENT "Copying help file to target")

list(APPEND files_to_clean "$ENV{PLUGIN_BUILD_DIR}/help/nodes/${op_context}/${MY_INSTALL_HELP}")

endif()

set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${files_to_clean}")

endfunction ()

add_subdirectory( ROP/ROP_Script )
add_subdirectory( SOP/SOP_DopImpactPoints )
add_subdirectory( SOP/SOP_PointsFromVoxels )
add_subdirectory( SOP/SOP_PrimCentroid )
add_subdirectory( SOP/SOP_PrimGroupCentroid )

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,42 @@
#cmake_minimum_required( VERSION 3.6 )

project( ROP_Script )

# CMAKE_PREFIX_PATH must contain the path to the toolkit/cmake subdirectory of
# the Houdini installation. See the "Compiling with CMake" section of the HDK
# documentation for more details, which describes several options for
# specifying this path.
#list( APPEND CMAKE_PREFIX_PATH "$ENV{HFS}/toolkit/cmake" )

# Locate Houdini's libraries and header files.
# Registers an imported library target named 'Houdini'.
#find_package( Houdini REQUIRED )

set (op_context ROP )

set( library_name ROP_script )

# Code generation for the embedded DS file in SOP_Star.C.
#houdini_generate_proto_headers( FILES SOP_Star.C )

# Add a library and its source files.
add_library( ${library_name} SHARED
ROP_Script.C
ROP_Script.h
)

# Link against the Houdini libraries, and add required include directories and
# compile definitions.
target_link_libraries( ${library_name} Houdini )

# Include ${CMAKE_CURRENT_BINARY_DIR} for the generated header.
target_include_directories( ${library_name} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)

# Sets several common target properties, such as the library's output directory.
houdini_configure_target( ${library_name} INSTDIR "$ENV{PLUGIN_BUILD_DIR}/dso" )

add_secondary_files( SHELF rop_script.shelf ICON ROP_script.svg HELP script.txt )


@@ -0,0 +1,27 @@

project( SOP_DopImpactPoints )

set( op_context SOP )

set( library_name SOP_DopImpactPoints )

# Add a library and its source files.
add_library( ${library_name} SHARED
SOP_DopImpactPoints.C
SOP_DopImpactPoints.h
)

# Link against the Houdini libraries, and add required include directories and
# compile definitions.
target_link_libraries( ${library_name} Houdini )

# Include ${CMAKE_CURRENT_BINARY_DIR} for the generated header.
target_include_directories( ${library_name} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)

# Sets several common target properties, such as the library's output directory.
houdini_configure_target( ${library_name} INSTDIR "$ENV{PLUGIN_BUILD_DIR}/dso" )

add_secondary_files( SHELF sop_dopimpactpoints.shelf HELP dopimpactpoints.txt )

@@ -0,0 +1,27 @@

project( SOP_PointsFromVoxels )

set( op_context SOP )

set( library_name SOP_PointsFromVoxels )

# Add a library and its source files.
add_library( ${library_name} SHARED
SOP_PointsFromVoxels.C
SOP_PointsFromVoxels.h
)

# Link against the Houdini libraries, and add required include directories and
# compile definitions.
target_link_libraries( ${library_name} Houdini )

# Include ${CMAKE_CURRENT_BINARY_DIR} for the generated header.
target_include_directories( ${library_name} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)

# Sets several common target properties, such as the library's output directory.
houdini_configure_target( ${library_name} INSTDIR "$ENV{PLUGIN_BUILD_DIR}/dso" )

add_secondary_files( SHELF sop_pointsfromvoxels.shelf ICON SOP_pointsfromvoxels.svg HELP pointsfromvoxels.txt )

@@ -0,0 +1,27 @@

project( SOP_PrimCentroid )

set( op_context SOP )

set( library_name SOP_PrimCentroid )

# Add a library and its source files.
add_library( ${library_name} SHARED
SOP_PrimCentroid.C
SOP_PrimCentroid.h
)

# Link against the Houdini libraries, and add required include directories and
# compile definitions.
target_link_libraries( ${library_name} Houdini )

# Include ${CMAKE_CURRENT_BINARY_DIR} for the generated header.
target_include_directories( ${library_name} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)

# Sets several common target properties, such as the library's output directory.
houdini_configure_target( ${library_name} INSTDIR "$ENV{PLUGIN_BUILD_DIR}/dso" )

add_secondary_files( SHELF sop_primcentroid.shelf ICON SOP_primcentroid.svg HELP primcentroid.txt )

@@ -0,0 +1,27 @@

project( SOP_PrimGroupCentroid )

set( op_context SOP )

set( library_name SOP_PrimGroupCentroid )

# Add a library and its source files.
add_library( ${library_name} SHARED
SOP_PrimGroupCentroid.C
SOP_PrimGroupCentroid.h
)

# Link against the Houdini libraries, and add required include directories and
# compile definitions.
target_link_libraries( ${library_name} Houdini )

# Include ${CMAKE_CURRENT_BINARY_DIR} for the generated header.
target_include_directories( ${library_name} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)

# Sets several common target properties, such as the library's output directory.
houdini_configure_target( ${library_name} INSTDIR "$ENV{PLUGIN_BUILD_DIR}/dso" )

add_secondary_files( SHELF sop_primgroupcentroid.shelf ICON SOP_primgroupcentroid.svg HELP primgroupcentroid.txt )

Oops, something went wrong.

0 comments on commit 1289f8d

Please sign in to comment.
You can’t perform that action at this time.