Commit 0abe196f authored by Matthias Möller's avatar Matthias Möller

add cmake switch for external openmesh installation

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17898 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ab38d94a
...@@ -49,7 +49,7 @@ if (NOT OPENMESH_FOUND) ...@@ -49,7 +49,7 @@ if (NOT OPENMESH_FOUND)
message (FATAL_ERROR "OpenMesh not found!") message (FATAL_ERROR "OpenMesh not found!")
endif () endif ()
set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR} set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ShaderUtils ${CMAKE_CURRENT_SOURCE_DIR}/ShaderUtils
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -124,7 +124,7 @@ if (GTEST_FOUND) ...@@ -124,7 +124,7 @@ if (GTEST_FOUND)
set_target_properties(ACG_tests PROPERTIES set_target_properties(ACG_tests PROPERTIES
COMPILE_FLAGS "-UNDEBUG") COMPILE_FLAGS "-UNDEBUG")
target_link_libraries(ACG_tests target_link_libraries(ACG_tests
${GTEST_LIBRARIES} ${OPENMESH_LIBRARY} ${GTEST_LIBRARIES} ${OPENMESH_LIBRARIES}
) )
add_test(AllTestsIn_ACG_tests ACG_tests) add_test(AllTestsIn_ACG_tests ACG_tests)
...@@ -191,8 +191,7 @@ endif () ...@@ -191,8 +191,7 @@ endif ()
# display results # display results
acg_print_configure_header (ACG "ACG") acg_print_configure_header (ACG "ACG")
target_link_libraries ( ACG OpenMeshCore target_link_libraries ( ACG ${OPENMESH_LIBRARIES}
OpenMeshTools
${QT_LIBRARIES} ${QT_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLEW_LIBRARY} ${GLEW_LIBRARY}
......
...@@ -79,8 +79,15 @@ find_package (GLUT) ...@@ -79,8 +79,15 @@ find_package (GLUT)
if (NOT GLUT_FOUND) if (NOT GLUT_FOUND)
message (FATAL_ERROR "GLUT not found!") message (FATAL_ERROR "GLUT not found!")
endif () endif ()
# using the internal openmesh delivered by the svn repo (default) or use some external installation
set (USE_INTERNAL_OPENMESH ON CACHE BOOL "Use and build internal version of OpenMesh found in libs_required")
# OpenMesh is a dependent project (in libs_required) so no finder is needed. # OpenMesh is a dependent project (in libs_required) so no finder is needed.
#find_package (OpenMesh REQUIRED) if (NOT USE_INTERNAL_OPENMESH)
find_package (OpenMesh REQUIRED)
endif()
find_package (OpenVolumeMesh) find_package (OpenVolumeMesh)
if (NOT OPENVOLUMEMESH_FOUND) if (NOT OPENVOLUMEMESH_FOUND)
message (FATAL_ERROR "OpenVolumeMesh not found!") message (FATAL_ERROR "OpenVolumeMesh not found!")
...@@ -131,7 +138,9 @@ foreach (_localLib ${_local_libs_in}) ...@@ -131,7 +138,9 @@ foreach (_localLib ${_local_libs_in})
add_subdirectory (${CMAKE_SOURCE_DIR}/${_local_lib_dir}) add_subdirectory (${CMAKE_SOURCE_DIR}/${_local_lib_dir})
endif() endif()
else() else()
LIST(APPEND REMAINING_LOCAL_LIBS ${_localLib}) if ( NOT "${_localLib}" MATCHES OpenMesh OR USE_INTERNAL_OPENMESH)
LIST(APPEND REMAINING_LOCAL_LIBS ${_localLib})
endif()
endif() endif()
endforeach () endforeach ()
...@@ -182,7 +191,7 @@ add_subdirectory (tests) ...@@ -182,7 +191,7 @@ add_subdirectory (tests)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc ) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc )
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help ) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help )
# Add the deocumentation targets # Add the documentation targets
add_subdirectory (OpenFlipper/Documentation/DeveloperTarget) add_subdirectory (OpenFlipper/Documentation/DeveloperTarget)
add_subdirectory (OpenFlipper/Documentation/DeveloperQtHelpTarget) add_subdirectory (OpenFlipper/Documentation/DeveloperQtHelpTarget)
add_subdirectory (OpenFlipper/Documentation/UserTarget) add_subdirectory (OpenFlipper/Documentation/UserTarget)
......
...@@ -2,7 +2,7 @@ include (ACGCommon) ...@@ -2,7 +2,7 @@ include (ACGCommon)
include_directories ( include_directories (
.. ..
${OPENMESH_INCLUDE_DIR} ${OPENMESH_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -176,8 +176,7 @@ endif() ...@@ -176,8 +176,7 @@ endif()
target_link_libraries (${OPENFLIPPER_PRODUCT_STRING} target_link_libraries (${OPENFLIPPER_PRODUCT_STRING}
OpenMeshCore ${OPENMESH_CORE_LIBRARIES}
OpenMeshTools
ACG ACG
OpenFlipperPluginLib OpenFlipperPluginLib
${QT_LIBRARIES} ${QT_LIBRARIES}
......
...@@ -19,7 +19,7 @@ endforeach () ...@@ -19,7 +19,7 @@ endforeach ()
include_directories ( include_directories (
.. ..
${OPENMESH_INCLUDE_DIR} ${OPENMESH_INCLUDE_DIRS}
${OPENVOLUMEMESH_INCLUDE_DIR} ${OPENVOLUMEMESH_INCLUDE_DIR}
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
...@@ -126,8 +126,7 @@ if( ADDITIONAL_PLUGINLIB_COMPILER_FLAGS ) ...@@ -126,8 +126,7 @@ if( ADDITIONAL_PLUGINLIB_COMPILER_FLAGS )
endif() endif()
target_link_libraries (OpenFlipperPluginLib target_link_libraries (OpenFlipperPluginLib
OpenMeshCore ${OPENMESH_LIBRARIES}
OpenMeshTools
${OPENVOLUMEMESH_LIBRARY} ${OPENVOLUMEMESH_LIBRARY}
ACG ACG
${QT_LIBRARIES} ${QT_LIBRARIES}
......
...@@ -384,7 +384,7 @@ function (_build_openflipper_plugin plugin) ...@@ -384,7 +384,7 @@ function (_build_openflipper_plugin plugin)
include_directories ( include_directories (
. .
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}
${OPENMESH_INCLUDE_DIR} ${OPENMESH_INCLUDE_DIRS}
${OPENVOLUMEMESH_INCLUDE_DIR} ${OPENVOLUMEMESH_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -532,8 +532,7 @@ function (_build_openflipper_plugin plugin) ...@@ -532,8 +532,7 @@ function (_build_openflipper_plugin plugin)
# generate dllinport defines # generate dllinport defines
add_definitions (-DACGDLL -DUSEACG -DPLUGINLIBDLL -DUSEPLUGINLIBDLL) add_definitions (-DACGDLL -DUSEACG -DPLUGINLIBDLL -DUSEPLUGINLIBDLL)
target_link_libraries (Plugin-${plugin} target_link_libraries (Plugin-${plugin}
OpenMeshCore ${OPENMESH_LIBRARIES}
OpenMeshTools
${OPENVOLUMEMESH_LIBRARY} ${OPENVOLUMEMESH_LIBRARY}
ACG ACG
OpenFlipperPluginLib OpenFlipperPluginLib
......
...@@ -45,35 +45,54 @@ ...@@ -45,35 +45,54 @@
# #
#=========================================================================== #===========================================================================
IF (OPENMESH_INCLUDE_DIR) cmake_minimum_required(VERSION 2.8.9)
# Already in cache, be silent
SET(OPENMESH_FIND_QUIETLY TRUE)
ENDIF (OPENMESH_INCLUDE_DIR)
FIND_PATH(OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh #if already found via finder or simulated finder in openmesh CMakeLists.txt, skip the search
PATHS /usr/local/include IF (NOT OPENMESH_FOUND)
/usr/include SET (SEARCH_PATHS
/usr/local/OpenMesh-2.0rc4/include /usr/local/
"${CMAKE_SOURCE_DIR}/OpenMesh/src" /usr/
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src" "${CMAKE_SOURCE_DIR}/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src" "${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src/OpenMesh"
/ACG/acgdev/gcc-4.0-x86_64/OM2/OpenMesh-2.0/installed/include "${CMAKE_SOURCE_DIR}/../OpenMesh/src/OpenMesh"
"C:\\Program Files\\OpenMesh 2.0\\include" "C:/Program Files/OpenMesh 3.0"
) "C:/Program Files/OpenMesh 2.4.1"
SET(OPENMESH_LIBRARY_DIR NOTFOUND CACHE PATH "The directory where the OpenMesh libraries can be found.") "C:/Program Files/OpenMesh 2.4"
SET(SEARCH_PATHS "C:/libs/OpenMesh 3.0"
"${OPENMESH_INCLUDE_DIR}/../lib" "C:/libs/OpenMesh 2.4.1"
"${OPENMESH_INCLUDE_DIR}/../lib/OpenMesh" "C:/libs/OpenMesh 2.4"
"${OPENMESH_LIBRARY_DIR}") )
FIND_LIBRARY(OPENMESH_CORE_LIBRARY NAMES OpenMeshCored OpenMeshCore PATHS ${SEARCH_PATHS})
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY NAMES OpenMeshToolsd OpenMeshTools PATHS ${SEARCH_PATHS})
INCLUDE (FindPackageHandleStandardArgs) FIND_PATH (OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh
PATHS ${SEARCH_PATHS}
PATH_SUFFIXES include)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenMesh DEFAULT_MSG OPENMESH_CORE_LIBRARY OPENMESH_TOOLS_LIBRARY OPENMESH_INCLUDE_DIR) FIND_LIBRARY(OPENMESH_CORE_LIBRARY_RELEASE NAMES OpenMeshCore
PATH ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
IF (OPENMESH_FOUND) FIND_LIBRARY(OPENMESH_CORE_LIBRARY_DEBUG NAMES OpenMeshCored
SET(OPENMESH_LIBRARIES "${OPENMESH_CORE_LIBRARY}" "${OPENMESH_TOOLS_LIBRARY}") PATH ${SEARCH_PATHS}
SET(OPENMESH_INCLUDE_DIRS "${OPENMESH_INCLUDE_DIR}") PATH_SUFFIXES lib lib64)
ENDIF (OPENMESH_FOUND)
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY_RELEASE NAMES OpenMeshTools
PATH ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY_DEBUG NAMES OpenMeshToolsd
PATH ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
include(SelectLibraryConfigurations)
select_library_configurations( OPENMESH_TOOLS )
select_library_configurations( OPENMESH_CORE )
set(OPENMESH_LIBRARIES ${OPENMESH_CORE_LIBRARY} ${OPENMESH_TOOLS_LIBRARY} )
set(OPENMESH_INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenMesh DEFAULT_MSG
OPENMESH_CORE_LIBRARY OPENMESH_TOOLS_LIBRARY OPENMESH_INCLUDE_DIR)
mark_as_advanced(OPENMESH_INCLUDE_DIR OPENMESH_CORE_LIBRARY_RELEASE OPENMESH_CORE_LIBRARY_DEBUG OPENMESH_TOOLS_LIBRARY_RELEASE OPENMESH_TOOLS_LIBRARY_DEBUG)
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment