0000520: CMake configuration tweaks

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5269 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2011-12-11 11:45:34 +00:00
parent 94334df562
commit de66587251
2 changed files with 28 additions and 29 deletions

View File

@ -1,35 +1,29 @@
# Find the spnav library and header.
#
# Sets the usual variables expected for find_package scripts:
#
# SPNAV_INCLUDE_DIR - header location
# SPNAV_LIBRARIES - library to link against
# SPNAV_FOUND - true if pugixml was found.
IF(UNIX)
set(TEST_SPNAV_CMAKE TRUE)
FIND_PATH(SPNAV_INCLUDE_PATH spnav.h
)
FIND_PATH(SPNAV_INCLUDE_DIR spnav.h)
FIND_LIBRARY(SPNAV_LIBRARY
NAMES
spnav libspnav
)
if(SPNAV_INCLUDE_PATH AND SPNAV_LIBRARY)
set(SPNAV_FOUND TRUE)
set(SPNAV_LIBRARIES ${SPNAV_LIBRARY})
set(SPNAV_INCLUDE_DIR ${SPNAV_INCLUDE_PATH})
endif(SPNAV_INCLUDE_PATH AND SPNAV_LIBRARY)
# Support the REQUIRED and QUIET arguments, and set SPNAV_FOUND if found.
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spnav DEFAULT_MSG SPNAV_LIBRARY
SPNAV_INCLUDE_DIR)
if(SPNAV_FOUND)
set(SPNAV_LIBRARIES ${SPNAV_LIBRARY})
endif()
if(TEST_SPNAV_CMAKE)
if(SPNAV_INCLUDE_PATH)
MESSAGE("found spnav include path ${SPNAV_INCLUDE_PATH}")
else(SPNAV_INCLUDE_PATH)
MESSAGE("didn't find spnav include path")
endif(SPNAV_INCLUDE_PATH)
if(SPNAV_LIBRARY)
MESSAGE("found spnav library ${SPNAV_LIBRARY}")
else(SPNAV_LIBRARY)
MESSAGE("didn't find spnav library")
endif(SPNAV_LIBRARY)
endif(TEST_SPNAV_CMAKE)
mark_as_advanced(SPANV_LIBRARY SPNAV_INCLUDE_DIR)
ENDIF(UNIX)

View File

@ -4,10 +4,6 @@ if(WIN32)
add_definitions(-DFCGui -DQIIS_MAKEDLL)
endif(WIN32)
IF(SPNAV_FOUND)
add_definitions(-DSPNAV_FOUND)
ENDIF(SPNAV_FOUND)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
@ -23,7 +19,6 @@ include_directories(
${XERCESC_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
${SPNAV_INCLUDE_DIR}
)
if(MSVC)
@ -47,10 +42,20 @@ else(MSVC)
${QT_LIBRARIES}
${Boost_LIBRARIES}
${OPENGL_gl_LIBRARY}
${SPNAV_LIBRARIES}
)
endif(MSVC)
IF(SPNAV_FOUND)
add_definitions(-DSPNAV_FOUND)
include_directories(
${SPNAV_INCLUDE_DIR}
)
set(FreeCADGui_LIBS
${FreeCADGui_LIBS}
${SPNAV_LIBRARIES}
)
ENDIF(SPNAV_FOUND)
generate_from_xml(DocumentPy)
generate_from_xml(PythonWorkbenchPy)
generate_from_xml(ViewProviderPy)