Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'refs/heads/master' into jriegel/Rift
  • Loading branch information
jriegel committed Sep 12, 2014
2 parents 889e7bb + 7318a1d commit 6c170bc
Show file tree
Hide file tree
Showing 359 changed files with 62,807 additions and 8,978 deletions.
33 changes: 23 additions & 10 deletions CMakeLists.txt
Expand Up @@ -12,6 +12,7 @@ cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)

# include local modules
include(AddFileDependencies)
include(cMake/FreeCadMacros.cmake)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake")

Expand Down Expand Up @@ -117,7 +118,7 @@ OPTION(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line an
OPTION(FREECAD_MAINTAINERS_BUILD "Build FreeCAD for Maintainers, with Docu and 3rd party libs. On Windows the Installer is build." OFF)
OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." OFF)
OPTION(BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)

OPTION(BUILD_CAM "Build the FreeCAD CAM module and the needed libs, be aware, unfinished code!" OFF)
OPTION(BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON)
Expand Down Expand Up @@ -162,10 +163,10 @@ OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OF
endif(MSVC)

# if this is set override some options
if (BUILD_DEBIAN)
if (FREECAD_BUILD_DEBIAN)
set(FREECAD_USE_EXTERNAL_ZIPIOS ON)
set(FREECAD_USE_EXTERNAL_PIVY ON)
endif (BUILD_DEBIAN)
endif (FREECAD_BUILD_DEBIAN)

# ==============================================================================
#inter-module dependencies
Expand Down Expand Up @@ -368,7 +369,6 @@ if(FREECAD_LIBPACK_USE)

else(FREECAD_LIBPACK_USE)


# ================================================================================
# == for other OSes search the packages ==========================================

Expand Down Expand Up @@ -461,8 +461,14 @@ else(FREECAD_LIBPACK_USE)
TKXDESTEP
TKXDEIGES
TKMeshVS
TKAdvTools
)
CHECK_MINIMUM_OCC_VERSION_HEX(0x060703)
if (NOT OCC_MIN_VERSION)
set(OCC_OCAF_LIBRARIES
${OCC_OCAF_LIBRARIES}
TKAdvTools
)
endif()
set(OCC_INCLUDE_DIR ${OCE_INCLUDE_DIRS})
set(OCC_FOUND ${OCE_FOUND})
else() #look for OpenCASCADE
Expand Down Expand Up @@ -523,7 +529,10 @@ else(FREECAD_LIBPACK_USE)

# -------------------------------- pcl ----------------------------------

find_package(PCL COMPONENTS common kdtree features surface)
find_package(PCL QUIET COMPONENTS common kdtree features surface io)
if (NOT PCL_FOUND)
MESSAGE("-- pcl not found")
endif(NOT PCL_FOUND)

# -------------------------------- ODE ----------------------------------

Expand Down Expand Up @@ -627,7 +636,7 @@ else(FREECAD_LIBPACK_USE)
IF(MATPLOTLIB_FOUND)
message("-- matplotlib-${MATPLOTLIB_VERSION} has been found.")
ELSE(MATPLOTLIB_FOUND)
message("matplotlib not found, Plot module will not available until matplotlib is installed!")
message("-- matplotlib not found, Plot module won't be available!")
ENDIF(MATPLOTLIB_FOUND)

# ------------------------------------------------------------------------
Expand All @@ -649,7 +658,6 @@ if(WIN32)
endif(WIN32)


include(cMake/FreeCadMacros.cmake)


# ================================================================================
Expand Down Expand Up @@ -696,8 +704,13 @@ ELSE(MSVC)
MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
ENDIF(MSVC)
IF(MINGW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads")
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12477
# Actually '-Wno-inline-dllimport' should work to suppress warnings of the form:
# inline function 'foo' is declared as dllimport: attribute ignored
# But it doesn't work with MinGW gcc 4.5.0 while using '-Wno-attributes' seems to
# do the trick.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads -Wno-attributes")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads -Wno-attributes")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols")
# http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie
Expand Down
9 changes: 8 additions & 1 deletion cMake/FindOpenCasCade.cmake
Expand Up @@ -89,7 +89,14 @@ IF(OCC_LIBRARY)
TKXDESTEP
TKXDEIGES
TKMeshVS
TKAdvTools
)
CHECK_MINIMUM_OCC_VERSION_HEX(0x060703)
if (NOT OCC_MIN_VERSION)
set(OCC_OCAF_LIBRARIES
${OCC_OCAF_LIBRARIES}
TKAdvTools
)
endif()

ENDIF(OCC_LIBRARY)

60 changes: 60 additions & 0 deletions cMake/FreeCadMacros.cmake
@@ -1,3 +1,5 @@
include (CheckCXXSourceRuns)

# ================================================================================
# == Macros, mostly for special targets ==========================================

Expand Down Expand Up @@ -251,3 +253,61 @@ MACRO(SET_PYTHON_PREFIX_SUFFIX ProjectName)
set_target_properties(${ProjectName} PROPERTIES SUFFIX ".pyd")
endif(WIN32)
ENDMACRO(SET_PYTHON_PREFIX_SUFFIX)

MACRO(CHECK_MINIMUM_OCC_VERSION_HEX MinVersionHex)
message(STATUS "Check for OCC version >= ${MinVersionHex}")
set(CMAKE_REQUIRED_INCLUDES ${OCC_INCLUDE_DIR})
unset(OCC_MIN_VERSION CACHE)
CHECK_CXX_SOURCE_RUNS("
#include <Standard_Version.hxx>
int main ()
{
return OCC_VERSION_HEX >= ${MinVersionHex} ? 0 : -1;
}
"
OCC_MIN_VERSION)
ENDMACRO(CHECK_MINIMUM_OCC_VERSION_HEX)

MACRO(GET_OCC_VERSION_HEX)
# clear them to run the tests for each configure step
unset(OCC_MAJOR CACHE)
unset(OCC_MAJOR_COMPILED CACHE)
unset(OCC_MAJOR_EXITCODE CACHE)
unset(OCC_MINOR CACHE)
unset(OCC_MINOR_COMPILED CACHE)
unset(OCC_MINOR_EXITCODE CACHE)
unset(OCC_MICRO CACHE)
unset(OCC_MICRO_COMPILED CACHE)
unset(OCC_MICRO_EXITCODE CACHE)

set(CMAKE_REQUIRED_INCLUDES ${OCC_INCLUDE_DIR})
CHECK_CXX_SOURCE_RUNS("
#include <Standard_Version.hxx>
int main ()
{
return OCC_VERSION_MAJOR;
}
"
OCC_MAJOR)
CHECK_CXX_SOURCE_RUNS("
#include <Standard_Version.hxx>
int main ()
{
return OCC_VERSION_MINOR;
}
"
OCC_MINOR)
CHECK_CXX_SOURCE_RUNS("
#include <Standard_Version.hxx>
int main ()
{
return OCC_VERSION_MAINTENANCE;
}
"
OCC_MICRO)

unset(OCC_VERSION_HEX CACHE)
if (OCC_MAJOR_COMPILED AND OCC_MINOR_COMPILED AND OCC_MICRO_COMPILED)
set (OCC_VERSION_HEX "0x0${OCC_MAJOR_EXITCODE}0${OCC_MINOR_EXITCODE}0${OCC_MICRO_EXITCODE}")
endif()
ENDMACRO(GET_OCC_VERSION_HEX)
92 changes: 56 additions & 36 deletions cMake/UseLibPack10x.cmake
Expand Up @@ -353,43 +353,63 @@ set(NGLIB_DEBUG_LIBRARIES

# Pointscloud library
set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.7)
set(PCL_LIBRARIES
debug pcl_common_debug.lib
optimized pcl_common_release.lib
debug pcl_features_debug.lib
optimized pcl_features_release.lib
debug pcl_filters_debug.lib
optimized pcl_filters_release.lib
debug pcl_io_debug.lib
debug pcl_io_ply_debug.lib
optimized pcl_io_ply_release.lib
optimized pcl_io_release.lib
debug pcl_kdtree_debug.lib
optimized pcl_kdtree_release.lib
debug pcl_keypoints_debug.lib
optimized pcl_keypoints_release.lib
debug pcl_ml_debug.lib
optimized pcl_ml_release.lib
debug pcl_octree_debug.lib
optimized pcl_octree_release.lib
debug pcl_recognition_debug.lib
optimized pcl_recognition_release.lib
debug pcl_registration_debug.lib
optimized pcl_registration_release.lib
debug pcl_sample_consensus_debug.lib
optimized pcl_sample_consensus_release.lib
debug pcl_search_debug.lib
optimized pcl_search_release.lib
debug pcl_segmentation_debug.lib
optimized pcl_segmentation_release.lib
debug pcl_stereo_debug.lib
optimized pcl_stereo_release.lib
debug pcl_surface_debug.lib
optimized pcl_surface_release.lib
debug pcl_tracking_debug.lib
optimized pcl_tracking_release.lib
set(PCL_LIBRARY_DIRS ${FREECAD_LIBPACK_DIR}/lib)

set(PCL_COMMON_LIBRARIES optimized pcl_common_release debug pcl_common_debug)
set(PCL_FEATURES_LIBRARIES optimized pcl_features_release debug pcl_features_debug)
set(PCL_FILTERS_LIBRARIES optimized pcl_filters_release debug pcl_filters_debug)
set(PCL_IO_LIBRARIES optimized pcl_io_release debug pcl_io_debug)
set(PCL_IO_PLY_LIBRARIES optimized pcl_io_ply_release debug pcl_io_ply_debug)
set(PCL_KDTREE_LIBRARIES optimized pcl_kdtree_release debug pcl_kdtree_debug)
set(PCL_KEYPOINTS_LIBRARIES optimized pcl_keypoints_release debug pcl_keypoints_debug)
set(PCL_ML_LIBRARIES optimized pcl_ml_release debug pcl_ml_debug)
set(PCL_OCTREE_LIBRARIES optimized pcl_octree_release debug pcl_octree_debug)
set(PCL_RECOGNITION_LIBRARIES optimized pcl_recognition_release debug pcl_recognition_debug)
set(PCL_REGISTRATION_LIBRARIES optimized pcl_registration_release debug pcl_registration_debug)
set(PCL_SAMPLE_CONSENSUS_LIBRARIES optimized pcl_sample_consensus_release debug pcl_sample_consensus_debug)
set(PCL_SEARCH_LIBRARIES optimized pcl_search_release debug pcl_search_debug)
set(PCL_SEGMENTATION_LIBRARIES optimized pcl_segmentation_release debug pcl_segmentation_debug)
set(PCL_STEREO_LIBRARIES optimized pcl_stereo_release debug pcl_stereo_debug)
set(PCL_SURFACE_LIBRARIES optimized pcl_surface_release debug pcl_surface_debug)
set(PCL_TRACKING_LIBRARIES optimized pcl_tracking_release debug pcl_tracking_debug)

set(PCL_LIBRARIES
${PCL_COMMON_LIBRARIES}
${PCL_FEATURES_LIBRARIES}
${PCL_FILTERS_LIBRARIES}
${PCL_IO_LIBRARIES}
${PCL_IO_PLY_LIBRARIES}
${PCL_KDTREE_LIBRARIES}
${PCL_KEYPOINTS_LIBRARIES}
${PCL_ML_LIBRARIES}
${PCL_OCTREE_LIBRARIES}
${PCL_RECOGNITION_LIBRARIES}
${PCL_REGISTRATION_LIBRARIES}
${PCL_SAMPLE_CONSENSUS_LIBRARIES}
${PCL_SEARCH_LIBRARIES}
${PCL_SEGMENTATION_LIBRARIES}
${PCL_STEREO_LIBRARIES}
${PCL_SURFACE_LIBRARIES}
${PCL_TRACKING_LIBRARIES}
)
set(PCL_FOUND TRUE)
set(PCL_FOUND TRUE)
set(PCL_COMMON_FOUND TRUE)
set(PCL_FEATURES_FOUND TRUE)
set(PCL_FILTERS_FOUND TRUE)
set(PCL_IO_FOUND TRUE)
set(PCL_IO_PLY_FOUND TRUE)
set(PCL_KDTREE_FOUND TRUE)
set(PCL_KEYPOINTS_FOUND TRUE)
set(PCL_ML_FOUND TRUE)
set(PCL_OCTREE_FOUND TRUE)
set(PCL_RECOGNITION_FOUND TRUE)
set(PCL_REGISTRATION_FOUND TRUE)
set(PCL_SAMPLE_CONSENSUS_FOUND TRUE)
set(PCL_SEARCH_FOUND TRUE)
set(PCL_SEGMENTATION_FOUND TRUE)
set(PCL_STEREO_FOUND TRUE)
set(PCL_SURFACE_FOUND TRUE)
set(PCL_TRACKING_FOUND TRUE)

set(FLANN_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/flann-1.8)

Expand Down
54 changes: 54 additions & 0 deletions cMake/UseLibPack9x.cmake
Expand Up @@ -471,3 +471,57 @@ SET(PYSIDE_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/PySide-1.2.1)
SET(PYSIDE_LIBRARY optimized ${FREECAD_LIBPACK_DIR}/lib/pyside-python2.7.lib debug ${FREECAD_LIBPACK_DIR}/lib/pyside-python2.7_d.lib)
SET(PYSIDE_PYTHONPATH ${FREECAD_LIBPACK_DIR}/pyside/Lib/site-packages)
SET(PYSIDE_TYPESYSTEMS ${FREECAD_LIBPACK_DIR}/pyside/share/PySide/typesystems)

# Pointscloud library
set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.6)
set(PCL_LIBRARY_DIRS ${FREECAD_LIBPACK_DIR}/lib)

set(PCL_COMMON_LIBRARIES optimized pcl_common_release debug pcl_common_debug)
set(PCL_FEATURES_LIBRARIES optimized pcl_features_release debug pcl_features_debug)
set(PCL_FILTERS_LIBRARIES optimized pcl_filters_release debug pcl_filters_debug)
set(PCL_IO_LIBRARIES optimized pcl_io_release debug pcl_io_debug)
set(PCL_IO_PLY_LIBRARIES optimized pcl_io_ply_release debug pcl_io_ply_debug)
set(PCL_KDTREE_LIBRARIES optimized pcl_kdtree_release debug pcl_kdtree_debug)
set(PCL_KEYPOINTS_LIBRARIES optimized pcl_keypoints_release debug pcl_keypoints_debug)
set(PCL_OCTREE_LIBRARIES optimized pcl_octree_release debug pcl_octree_debug)
set(PCL_REGISTRATION_LIBRARIES optimized pcl_registration_release debug pcl_registration_debug)
set(PCL_SAMPLE_CONSENSUS_LIBRARIES optimized pcl_sample_consensus_release debug pcl_sample_consensus_debug)
set(PCL_SEARCH_LIBRARIES optimized pcl_search_release debug pcl_search_debug)
set(PCL_SEGMENTATION_LIBRARIES optimized pcl_segmentation_release debug pcl_segmentation_debug)
set(PCL_SURFACE_LIBRARIES optimized pcl_surface_release debug pcl_surface_debug)
set(PCL_TRACKING_LIBRARIES optimized pcl_tracking_release debug pcl_tracking_debug)

set(PCL_LIBRARIES
${PCL_COMMON_LIBRARIES}
${PCL_FEATURES_LIBRARIES}
${PCL_FILTERS_LIBRARIES}
${PCL_IO_LIBRARIES}
${PCL_IO_PLY_LIBRARIES}
${PCL_KDTREE_LIBRARIES}
${PCL_KEYPOINTS_LIBRARIES}
${PCL_OCTREE_LIBRARIES}
${PCL_REGISTRATION_LIBRARIES}
${PCL_SAMPLE_CONSENSUS_LIBRARIES}
${PCL_SEARCH_LIBRARIES}
${PCL_SEGMENTATION_LIBRARIES}
${PCL_SURFACE_LIBRARIES}
${PCL_TRACKING_LIBRARIES}
)
set(PCL_FOUND TRUE)
set(PCL_COMMON_FOUND TRUE)
set(PCL_FEATURES_FOUND TRUE)
set(PCL_FILTERS_FOUND TRUE)
set(PCL_IO_FOUND TRUE)
set(PCL_IO_PLY_FOUND TRUE)
set(PCL_KDTREE_FOUND TRUE)
set(PCL_KEYPOINTS_FOUND TRUE)
set(PCL_OCTREE_FOUND TRUE)
set(PCL_REGISTRATION_FOUND TRUE)
set(PCL_SAMPLE_CONSENSUS_FOUND TRUE)
set(PCL_SEARCH_FOUND TRUE)
set(PCL_SEGMENTATION_FOUND TRUE)
set(PCL_SURFACE_FOUND TRUE)
set(PCL_TRACKING_FOUND TRUE)

set(FLANN_LIBRARIES optimized flann debug flann)
set(FLANN_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/flann-1.7.1)
13 changes: 13 additions & 0 deletions src/3rdParty/CxImage/README
@@ -0,0 +1,13 @@
Yanked from FreeCAD forum posts by wmayer 17 July and 22 August 2014
http://forum.freecadweb.org/viewtopic.php?f=10&t=7054
http://forum.freecadweb.org/viewtopic.php?f=17&t=7432

The CxImage is only used for a Windows thumbnailer. The utility
"ThumbnailProvider" is a DLL which can be registered to Windows as a so called
shell extension. This utility is able to create a preview image of an FCStd
project file and CxImage is needed to convert the data into a format that
Windows expects.

The format Windows accepts is a BITMAP handle for which Qt could also be used.
But this requires a dependency of two rather heavy DLLs (QtCore, QtGui) and
with a statically linked CxImage we don't have this problem.
2 changes: 1 addition & 1 deletion src/3rdParty/salomesmesh/CMakeLists.txt
Expand Up @@ -127,7 +127,7 @@ ELSE(UNIX)
######### Windows ###########
#MESSAGE("-- Windows system detected")
IF(MSVC)
ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -DNO_My_ctype -DNO_ISATTY -DNO_FPINIT /wd4290 /wd4251 /wd4018 /wd4800 /wd4996 /wd4244 /wd4806 /wd4275)
ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -DNO_My_ctype -DNO_ISATTY -DNO_FPINIT /wd4290 /wd4251 /wd4018 /wd4800 /wd4996 /wd4244 /wd4806 /wd4275 /wd4005 /wd4099 /wd4101 /wd4267 /wd4390)
ELSE(MSVC)
ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB)
ENDIF(MSVC)
Expand Down
2 changes: 1 addition & 1 deletion src/3rdParty/salomesmesh/Makefile.am
Expand Up @@ -21,7 +21,7 @@ endif
#AM_LDFLAGS = -version-info 1:0:0 -Wl,--no-undefined -L$(OCC_LIB)
AM_LDFLAGS = -version-info 1:0:0 -L$(OCC_LIB) \
-lTKernel -lTKService -lTKMath -lTKBRep -lTKTopAlgo -lTKGeomAlgo \
-lTKGeomBase -lTKG3d -lTKG2d -lTKMeshVS -lTKShHealing -lTKPrim -lTKAdvTools
-lTKGeomBase -lTKG3d -lTKG2d -lTKMeshVS -lTKShHealing -lTKPrim

#uninstall-local:
# -rm -rf $(DESTDIR)$(libdir)
Expand Down

0 comments on commit 6c170bc

Please sign in to comment.