mirror of https://github.com/CGAL/cgal
Added explicit link directives from libCGAL* to libCGAL
Added OpenGL to CGALQt4
This commit is contained in:
parent
6aba449434
commit
cd00979002
|
|
@ -71,7 +71,7 @@ if(ZLIB_FOUND AND OPENGL_FOUND)
|
|||
|
||||
set_target_properties(CGAL_ImageIO PROPERTIES VERSION "${CGAL_SONAME_VERSION}" SOVERSION "${CGAL_SOVERSION}")
|
||||
|
||||
target_link_libraries( CGAL_ImageIO ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} )
|
||||
target_link_libraries( CGAL_ImageIO ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
if (NOT AUTO_LINK_ENABLED )
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ if( GMP_FOUND AND MPFR_FOUND )
|
|||
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} )
|
||||
|
||||
add_dependencies( CGAL_CORE CGAL )
|
||||
|
||||
target_link_libraries( CGAL_CORE ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
set_target_properties(CGAL_CORE PROPERTIES VERSION "${CGAL_SONAME_VERSION}" SOVERSION "${CGAL_SOVERSION}")
|
||||
|
||||
# ${CGAL_CORE_BASENAME} comes defined from FindCGAL_CORE.cmake
|
||||
|
|
|
|||
|
|
@ -27,60 +27,96 @@ set( QT_USE_QTMAIN TRUE )
|
|||
set( QT_USE_QTOPENGL TRUE )
|
||||
find_package(Qt4 QUIET)
|
||||
|
||||
include_directories (BEFORE ../../include)
|
||||
find_package(OpenGL QUIET )
|
||||
|
||||
if(QT4_FOUND)
|
||||
include(${QT_USE_FILE})
|
||||
if( QT4_FOUND )
|
||||
|
||||
get_dependency_version(QT4 Qt4)
|
||||
if( OPENGL_FOUND )
|
||||
|
||||
# moc files that are compiled directly as cpp files
|
||||
qt4_wrap_cpp(mocfiles ../../include/CGAL/Qt/GraphicsViewNavigation.h
|
||||
../../include/CGAL/Qt/DemosMainWindow.h
|
||||
../../include/CGAL/Qt/GraphicsItem.h
|
||||
../../include/CGAL/Qt/GraphicsViewInput.h)
|
||||
include_directories (BEFORE ../../include)
|
||||
|
||||
# qrc files (resources files, that contain icons, at least)
|
||||
qt4_add_resources ( RESOURCE_FILES ../../demo/resources/CGAL.qrc ../../demo/icons/Input.qrc ../../demo/icons/File.qrc ../../demo/icons/Triangulation_2.qrc)
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
set( CGAL_QT4_BASENAME CGAL-Qt4 )
|
||||
get_dependency_version(OPENGL OpenGL)
|
||||
get_dependency_version(QT4 Qt4)
|
||||
|
||||
add_library( CGAL_Qt4 debug.cpp ${moc_files} GraphicsViewNavigation.cpp GraphicsViewPolylineInput.cpp DemosMainWindow.cpp ${RESOURCE_FILES} )
|
||||
target_link_libraries( CGAL_Qt4 ${QT_LIBRARIES} )
|
||||
if ( NOT AUTO_LINK_ENABLED )
|
||||
# If auto-link is not enabled (on Linux for example), link with libCGAL explicitly.
|
||||
target_link_libraries( CGAL_Qt4 CGAL )
|
||||
endif()
|
||||
set( CGAL_HAS_QT4 TRUE )
|
||||
add_config_flag( CGAL_HAS_QT4 )
|
||||
|
||||
set_target_properties(CGAL_Qt4 PROPERTIES VERSION "${CGAL_VERSION}" SOVERSION "${CGAL_SOVERSION}")
|
||||
message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" )
|
||||
message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" )
|
||||
message( STATUS "OpenGL definitions: ${OPENGL_DEFINITIONS}" )
|
||||
message( STATUS "Qt4 include: ${QT_INCLUDE_DIR}" )
|
||||
message( STATUS "Qt4 libraries: ${QT_LIBRARIES}" )
|
||||
message( STATUS "Qt4 definitions: ${QT_DEFINITIONS}" )
|
||||
message( STATUS "moc executable: ${QT_MOC_EXECUTABLE}" )
|
||||
message( STATUS "uic executable: ${QT_UIC_EXECUTABLE}" )
|
||||
|
||||
if (NOT AUTO_LINK_ENABLED )
|
||||
set_target_properties( CGAL_Qt4 PROPERTIES OUTPUT_NAME "${CGAL_Qt4_BASENAME}" )
|
||||
get_target_property( CGAL_Qt4_LIBRARY_FULL_PATH CGAL_Qt4 LOCATION )
|
||||
cache_set(CGAL_Qt4_3RD_PARTY_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
|
||||
cache_set(CGAL_Qt4_3RD_PARTY_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} )
|
||||
cache_set(CGAL_Qt4_3RD_PARTY_DEFINITIONS ${QT_DEFINITIONS} ${OPENGL_DEFINITIONS} )
|
||||
|
||||
set(CGAL_Qt4_LIBRARY "${CGAL_Qt4_LIBRARY_FULL_PATH}" CACHE STRING "The CGAL-ImageIO library")
|
||||
mark_as_advanced(CGAL_Qt4_LIBRARY)
|
||||
# moc files that are compiled directly as cpp files
|
||||
qt4_wrap_cpp(mocfiles ../../include/CGAL/Qt/GraphicsViewNavigation.h
|
||||
../../include/CGAL/Qt/DemosMainWindow.h
|
||||
../../include/CGAL/Qt/GraphicsItem.h
|
||||
../../include/CGAL/Qt/GraphicsViewInput.h)
|
||||
|
||||
else(NOT AUTO_LINK_ENABLED)
|
||||
# qrc files (resources files, that contain icons, at least)
|
||||
qt4_add_resources ( RESOURCE_FILES ../../demo/resources/CGAL.qrc ../../demo/icons/Input.qrc ../../demo/icons/File.qrc ../../demo/icons/Triangulation_2.qrc)
|
||||
|
||||
set(CGAL_Qt4_LIBRARY)
|
||||
set( CGAL_QT4_BASENAME CGAL-Qt4 )
|
||||
|
||||
set(CGAL_Qt4_RELEASE_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt" )
|
||||
set(CGAL_Qt4_DEBUG_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt-gd" )
|
||||
set(CGAL_Qt4_MINSIZEREL_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt-o" )
|
||||
set(CGAL_Qt4_RELWITHDEBINFO_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt-g" )
|
||||
add_library( CGAL_Qt4 debug.cpp ${moc_files} GraphicsViewNavigation.cpp GraphicsViewPolylineInput.cpp DemosMainWindow.cpp ${RESOURCE_FILES} )
|
||||
|
||||
set_target_properties( CGAL_Qt4 PROPERTIES DEBUG_OUTPUT_NAME "${CGAL_Qt4_DEBUG_MANGLED_NAME}"
|
||||
RELEASE_OUTPUT_NAME "${CGAL_Qt4_RELEASE_MANGLED_NAME}"
|
||||
MINSIZEREL_OUTPUT_NAME "${CGAL_Qt4_MINSIZEREL_MANGLED_NAME}"
|
||||
RELWITHDEBINFO_OUTPUT_NAME "${CGAL_Qt4_RELWITHDEBINFO_MANGLED_NAME}"
|
||||
)
|
||||
|
||||
if ( HAS_CFG_INTDIR )
|
||||
add_custom_command(TARGET CGAL_Qt4 POST_BUILD COMMAND copy /Y "$(TargetPath)" "$(SolutionDir)lib" )
|
||||
add_custom_command(TARGET CGAL_Qt4 POST_BUILD COMMAND if exist "$(TargetDir)$(TargetName).pdb" copy /Y "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)lib" )
|
||||
if ( NOT IS_TOP_LEVEL )
|
||||
add_dependencies( CGAL_Qt4 CGAL )
|
||||
endif()
|
||||
|
||||
endif(NOT AUTO_LINK_ENABLED)
|
||||
target_link_libraries( CGAL_Qt4 ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt4_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
endif(QT4_FOUND)
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} )
|
||||
|
||||
set_target_properties(CGAL_Qt4 PROPERTIES VERSION "${CGAL_SONAME_VERSION}" SOVERSION "${CGAL_SOVERSION}")
|
||||
|
||||
if (NOT AUTO_LINK_ENABLED )
|
||||
|
||||
set_target_properties( CGAL_Qt4 PROPERTIES OUTPUT_NAME "${CGAL_Qt4_BASENAME}" )
|
||||
get_target_property( CGAL_Qt4_LIBRARY_FULL_PATH CGAL_Qt4 LOCATION )
|
||||
|
||||
set(CGAL_Qt4_LIBRARY "${CGAL_Qt4_LIBRARY_FULL_PATH}" CACHE STRING "The CGAL-Qt4 library")
|
||||
mark_as_advanced(CGAL_Qt4_LIBRARY)
|
||||
|
||||
else()
|
||||
|
||||
set(CGAL_Qt4_LIBRARY)
|
||||
|
||||
set(CGAL_Qt4_RELEASE_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt" )
|
||||
set(CGAL_Qt4_DEBUG_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt-gd" )
|
||||
set(CGAL_Qt4_MINSIZEREL_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt-o" )
|
||||
set(CGAL_Qt4_RELWITHDEBINFO_MANGLED_NAME "${CGAL_Qt4_BASENAME}-${TOOLSET}-mt-g" )
|
||||
|
||||
set_target_properties( CGAL_Qt4 PROPERTIES DEBUG_OUTPUT_NAME "${CGAL_Qt4_DEBUG_MANGLED_NAME}"
|
||||
RELEASE_OUTPUT_NAME "${CGAL_Qt4_RELEASE_MANGLED_NAME}"
|
||||
MINSIZEREL_OUTPUT_NAME "${CGAL_Qt4_MINSIZEREL_MANGLED_NAME}"
|
||||
RELWITHDEBINFO_OUTPUT_NAME "${CGAL_Qt4_RELWITHDEBINFO_MANGLED_NAME}"
|
||||
)
|
||||
|
||||
if ( HAS_CFG_INTDIR )
|
||||
add_custom_command(TARGET CGAL_Qt4 POST_BUILD COMMAND copy /Y "$(TargetPath)" "$(SolutionDir)lib" )
|
||||
add_custom_command(TARGET CGAL_Qt4 POST_BUILD COMMAND if exist "$(TargetDir)$(TargetName).pdb" copy /Y "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)lib" )
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if ( CGAL_INSTALL_LIB_DIR )
|
||||
install(TARGETS CGAL_Qt4 DESTINATION ${CGAL_INSTALL_LIB_DIR} )
|
||||
endif()
|
||||
|
||||
else()
|
||||
message( STATUS "CGAL-Qt4 needs OpenGL, cannot be configured.")
|
||||
endif()
|
||||
|
||||
else()
|
||||
message( STATUS "CGAL-Qt4 needs Qt4, cannot be configured.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ add_library(CGAL_PDB "all_files.cpp")
|
|||
|
||||
set_target_properties(CGAL_PDB PROPERTIES VERSION "${CGAL_SONAME_VERSION}" SOVERSION "${CGAL_SOVERSION}")
|
||||
|
||||
target_link_libraries( CGAL_PDB ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
target_link_libraries( CGAL_PDB ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} )
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,15 @@
|
|||
|
||||
assert(CGAL_BINARY_DIR)
|
||||
|
||||
find_package(OpenGL)
|
||||
find_package(Qt3)
|
||||
find_package(OpenGL QUIET )
|
||||
find_package(Qt3 QUIET )
|
||||
|
||||
if( QT3_FOUND AND OPENGL_FOUND )
|
||||
if( QT_FOUND )
|
||||
|
||||
if( OPENGL_FOUND )
|
||||
|
||||
get_dependency_version(OPENGL OpenGL)
|
||||
get_dependency_version(QT3)
|
||||
get_dependency_version(QT)
|
||||
|
||||
set( CGAL_USE_QT3 TRUE )
|
||||
add_config_flag( CGAL_USE_QT3 )
|
||||
|
|
@ -32,15 +34,15 @@ if( QT3_FOUND AND OPENGL_FOUND )
|
|||
message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" )
|
||||
message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" )
|
||||
message( STATUS "OpenGL definitions: ${OPENGL_DEFINITIONS}" )
|
||||
message( STATUS "Qt3 include: ${QT3_INCLUDE_DIR}" )
|
||||
message( STATUS "Qt3 libraries: ${QT3_LIBRARIES}" )
|
||||
message( STATUS "Qt3 definitions: ${QT3_DEFINITIONS}" )
|
||||
message( STATUS "moc executable: ${QT3_MOC_EXECUTABLE}" )
|
||||
message( STATUS "uic executable: ${QT3_UIC_EXECUTABLE}" )
|
||||
message( STATUS "Qt3 include: ${QT_INCLUDE_DIR}" )
|
||||
message( STATUS "Qt3 libraries: ${QT_LIBRARIES}" )
|
||||
message( STATUS "Qt3 definitions: ${QT_DEFINITIONS}" )
|
||||
message( STATUS "moc executable: ${QT_MOC_EXECUTABLE}" )
|
||||
message( STATUS "uic executable: ${QT_UIC_EXECUTABLE}" )
|
||||
|
||||
cache_set(CGAL_Qt3_3RD_PARTY_INCLUDE_DIRS ${QT3_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
|
||||
cache_set(CGAL_Qt3_3RD_PARTY_LIBRARIES ${QT3_LIBRARIES} ${OPENGL_LIBRARIES} )
|
||||
cache_set(CGAL_Qt3_3RD_PARTY_DEFINITIONS ${QT3_DEFINITIONS} ${OPENGL_DEFINITIONS} )
|
||||
cache_set(CGAL_Qt3_3RD_PARTY_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
|
||||
cache_set(CGAL_Qt3_3RD_PARTY_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} )
|
||||
cache_set(CGAL_Qt3_3RD_PARTY_DEFINITIONS ${QT_DEFINITIONS} ${OPENGL_DEFINITIONS} )
|
||||
|
||||
include(Qt3Macros)
|
||||
|
||||
|
|
@ -94,7 +96,7 @@ if( QT3_FOUND AND OPENGL_FOUND )
|
|||
|
||||
set_target_properties(CGAL_Qt3 PROPERTIES VERSION "${CGAL_SONAME_VERSION}" SOVERSION "${CGAL_SOVERSION}")
|
||||
|
||||
target_link_libraries( CGAL_Qt3 ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt3_3RD_PARTY_LIBRARIES} )
|
||||
target_link_libraries( CGAL_Qt3 ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt3_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt3_3RD_PARTY_DEFINITIONS} )
|
||||
|
||||
|
|
@ -135,6 +137,10 @@ if( QT3_FOUND AND OPENGL_FOUND )
|
|||
if ( CGAL_INSTALL_LIB_DIR )
|
||||
install(TARGETS CGAL_Qt3 DESTINATION ${CGAL_INSTALL_LIB_DIR} )
|
||||
endif()
|
||||
|
||||
else()
|
||||
message( STATUS "CGAL-Qt3 needs OpenGL, cannot be configured.")
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "CGAL-Qt3 needs Qt3, cannot be configured.")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue