0000631: Support of more sophisticated switch to configure with cmake

This commit is contained in:
wmayer 2012-06-02 18:52:47 +02:00
parent fbd3556aaf
commit 1b8998f77d
3 changed files with 19 additions and 13 deletions

View File

@ -52,6 +52,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wno-write-strings)
add_definitions(-Wno-deprecated)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
# get linker errors as soon as possible and not at runtime e.g. for modules
if(UNIX)
SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif(UNIX)
endif(CMAKE_COMPILER_IS_GNUCXX)
@ -98,7 +102,14 @@ OPTION(FREECAD_BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished cod
OPTION(FREECAD_BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF)
OPTION(FREECAD_BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF)
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
OPTION(USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." 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)
# if this is set override some options
if (FREECAD_BUILD_DEBIAN)
set(FREECAD_USE_EXTERNAL_ZIPIOS ON)
set(FREECAD_USE_EXTERNAL_PIVY ON)
endif (FREECAD_BUILD_DEBIAN)
# ==============================================================================

View File

@ -20,7 +20,7 @@ elseif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE7X)
#endif(MINGW)
# applies for Unix, MinGW and Windows with custom LibPack
elseif(FREECAD_BUILD_GUI)
if (NOT FREECAD_BUILD_DEBIAN)
if (NOT FREECAD_USE_EXTERNAL_PIVY)
find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
if (COIN_VERSION3)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
@ -31,7 +31,7 @@ elseif(FREECAD_BUILD_GUI)
add_subdirectory(Pivy)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
endif(COIN_VERSION3)
endif (NOT FREECAD_BUILD_DEBIAN)
endif (NOT FREECAD_USE_EXTERNAL_PIVY)
endif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
# For Windows we have all stuff in the LibPack

View File

@ -68,7 +68,7 @@ if(SWIG_FOUND)
add_definitions(-DHAVE_SWIG=1)
endif(SWIG_FOUND)
if (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_BUILD_DEBIAN)
if (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_USE_EXTERNAL_ZIPIOS)
SET(zipios_SRCS
../zipios++/backbuffer.h
../zipios++/basicentry.cpp
@ -122,12 +122,7 @@ SET(zipios_SRCS
../zipios++/zipoutputstream.h
)
SOURCE_GROUP("zipios" FILES ${zipios_SRCS})
else (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_BUILD_DEBIAN)
set(FreeCADBase_LIBS
${FreeCADBase_LIBS}
-lzipios
)
endif (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_BUILD_DEBIAN)
endif ()
SET(pycxx_SRCS
../CXX/Config.hxx
@ -293,7 +288,7 @@ SET(FreeCADBase_SRCS
)
# Use external zipios++ if specified.
if(USE_EXTERNAL_ZIPIOS)
if(FREECAD_USE_EXTERNAL_ZIPIOS)
find_library(ZIPIOS_LIBRARY zipios)
find_path(ZIPIOS_INCLUDES zipios++/zipios-config.h)
if(ZIPIOS_LIBRARY)
@ -308,9 +303,9 @@ if(USE_EXTERNAL_ZIPIOS)
else()
message(FATAL_ERROR "Using external zipios++ was specified but was not found.")
endif()
else(USE_EXTERNAL_ZIPIOS)
else(FREECAD_USE_EXTERNAL_ZIPIOS)
list(APPEND FreeCADBase_SRCS ${zipios_SRCS})
endif(USE_EXTERNAL_ZIPIOS)
endif(FREECAD_USE_EXTERNAL_ZIPIOS)
if(MSVC)