Skip to content

Commit

Permalink
+ Custom target to copy needed files from LibPack
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 7, 2013
1 parent 2afb58a commit bfcbf3b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -159,6 +159,9 @@ if(FREECAD_LIBPACK_USE)
include(cMake/UseLibPack9x.cmake)
set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-2.0.11/swig.exe CACHE STRING "Swig" FORCE)
set(FREECAD_USE_EXTERNAL_PIVY ON CACHE BOOL "Switch off local pivy" FORCE)
file(GLOB FREECAD_LIBPACK_PIVY_COIN "${FREECAD_LIBPACK_DIR}/pivy/*.*")
file(GLOB FREECAD_LIBPACK_PIVY_SOQT "${FREECAD_LIBPACK_DIR}/pivy/gui/*.*")
file(GLOB FREECAD_LIBPACK_PYSIDE "${FREECAD_LIBPACK_DIR}/pyside/lib/site-packages/PySide/*.*")
ELSEIF(FREECAD_LIBPACK_CHECKCUSTOM)
set(FREECAD_LIBPACK_VERSION "Custom" CACHE STRING "Displays if the libpack has been found" FORCE)
include(cMake/UseLibPackCustom.cmake)
Expand Down
51 changes: 51 additions & 0 deletions data/examples/CMakeLists.txt
Expand Up @@ -17,6 +17,57 @@ if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
fc_copy_sources(Example_data "${CMAKE_BINARY_DIR}/data/examples" ${Examples_Files})
endif()

if (WIN32 AND FREECAD_LIBPACK_USE)
set(FREECAD_LIBPACK_FILES ${FREECAD_LIBPACK_PIVY_COIN} ${FREECAD_LIBPACK_PIVY_SOQT} ${FREECAD_LIBPACK_PYSIDE})
add_custom_target(LibPack_Files ALL SOURCES ${FREECAD_LIBPACK_FILES})

# pivy
foreach (it ${FREECAD_LIBPACK_PIVY_COIN})
get_filename_component(libfile ${it} NAME)
set(out "${CMAKE_BINARY_DIR}/DLLs/pivy/${libfile}")
add_custom_command(
DEPENDS ${it}
OUTPUT ${out}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${it} ${out}
MAIN_DEPENDENCY ${it}
COMMENT "Copy file to ${out}"
)
endforeach (it)
SOURCE_GROUP("pivy" FILES ${FREECAD_LIBPACK_PIVY_COIN})

# pivy/gui
foreach (it ${FREECAD_LIBPACK_PIVY_SOQT})
get_filename_component(libfile ${it} NAME)
set(out "${CMAKE_BINARY_DIR}/DLLs/pivy/gui/${libfile}")
add_custom_command(
DEPENDS ${it}
OUTPUT ${out}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${it} ${out}
MAIN_DEPENDENCY ${it}
COMMENT "Copy file to ${out}"
)
endforeach (it)
SOURCE_GROUP("pivy\\gui" FILES ${FREECAD_LIBPACK_PIVY_SOQT})

# PySide
foreach (it ${FREECAD_LIBPACK_PYSIDE})
get_filename_component(libfile ${it} NAME)
set(out "${CMAKE_BINARY_DIR}/DLLs/PySide/${libfile}")
add_custom_command(
DEPENDS ${it}
OUTPUT ${out}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${it} ${out}
MAIN_DEPENDENCY ${it}
COMMENT "Copy file to ${out}"
)
endforeach (it)
SOURCE_GROUP("PySide" FILES ${FREECAD_LIBPACK_PYSIDE})

endif(WIN32 AND FREECAD_LIBPACK_USE)

INSTALL(
FILES
${Examples_Files}
Expand Down

0 comments on commit bfcbf3b

Please sign in to comment.