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)
message (FATAL_ERROR "OpenMesh not found!")
endif ()
set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR}
set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ShaderUtils
${CMAKE_CURRENT_BINARY_DIR}
......@@ -124,7 +124,7 @@ if (GTEST_FOUND)
set_target_properties(ACG_tests PROPERTIES
COMPILE_FLAGS "-UNDEBUG")
target_link_libraries(ACG_tests
${GTEST_LIBRARIES} ${OPENMESH_LIBRARY}
${GTEST_LIBRARIES} ${OPENMESH_LIBRARIES}
)
add_test(AllTestsIn_ACG_tests ACG_tests)
......@@ -191,8 +191,7 @@ endif ()
# display results
acg_print_configure_header (ACG "ACG")
target_link_libraries ( ACG OpenMeshCore
OpenMeshTools
target_link_libraries ( ACG ${OPENMESH_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARY}
......
......@@ -79,8 +79,15 @@ find_package (GLUT)
if (NOT GLUT_FOUND)
message (FATAL_ERROR "GLUT not found!")
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.
#find_package (OpenMesh REQUIRED)
if (NOT USE_INTERNAL_OPENMESH)
find_package (OpenMesh REQUIRED)
endif()
find_package (OpenVolumeMesh)
if (NOT OPENVOLUMEMESH_FOUND)
message (FATAL_ERROR "OpenVolumeMesh not found!")
......@@ -131,7 +138,9 @@ foreach (_localLib ${_local_libs_in})
add_subdirectory (${CMAKE_SOURCE_DIR}/${_local_lib_dir})
endif()
else()
LIST(APPEND REMAINING_LOCAL_LIBS ${_localLib})
if ( NOT "${_localLib}" MATCHES OpenMesh OR USE_INTERNAL_OPENMESH)
LIST(APPEND REMAINING_LOCAL_LIBS ${_localLib})
endif()
endif()
endforeach ()
......@@ -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}/Help )
# Add the deocumentation targets
# Add the documentation targets
add_subdirectory (OpenFlipper/Documentation/DeveloperTarget)
add_subdirectory (OpenFlipper/Documentation/DeveloperQtHelpTarget)
add_subdirectory (OpenFlipper/Documentation/UserTarget)
......
......@@ -2,7 +2,7 @@ include (ACGCommon)
include_directories (
..
${OPENMESH_INCLUDE_DIR}
${OPENMESH_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
......@@ -176,8 +176,7 @@ endif()
target_link_libraries (${OPENFLIPPER_PRODUCT_STRING}
OpenMeshCore
OpenMeshTools
${OPENMESH_CORE_LIBRARIES}
ACG
OpenFlipperPluginLib
${QT_LIBRARIES}
......
......@@ -19,7 +19,7 @@ endforeach ()
include_directories (
..
${OPENMESH_INCLUDE_DIR}
${OPENMESH_INCLUDE_DIRS}
${OPENVOLUMEMESH_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
......@@ -126,8 +126,7 @@ if( ADDITIONAL_PLUGINLIB_COMPILER_FLAGS )
endif()
target_link_libraries (OpenFlipperPluginLib
OpenMeshCore
OpenMeshTools
${OPENMESH_LIBRARIES}
${OPENVOLUMEMESH_LIBRARY}
ACG
${QT_LIBRARIES}
......
......@@ -384,7 +384,7 @@ function (_build_openflipper_plugin plugin)
include_directories (
.
${CMAKE_SOURCE_DIR}
${OPENMESH_INCLUDE_DIR}
${OPENMESH_INCLUDE_DIRS}
${OPENVOLUMEMESH_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
......@@ -532,8 +532,7 @@ function (_build_openflipper_plugin plugin)
# generate dllinport defines
add_definitions (-DACGDLL -DUSEACG -DPLUGINLIBDLL -DUSEPLUGINLIBDLL)
target_link_libraries (Plugin-${plugin}
OpenMeshCore
OpenMeshTools
${OPENMESH_LIBRARIES}
${OPENVOLUMEMESH_LIBRARY}
ACG
OpenFlipperPluginLib
......
......@@ -45,35 +45,54 @@
#
#===========================================================================
IF (OPENMESH_INCLUDE_DIR)
# Already in cache, be silent
SET(OPENMESH_FIND_QUIETLY TRUE)
ENDIF (OPENMESH_INCLUDE_DIR)
cmake_minimum_required(VERSION 2.8.9)
FIND_PATH(OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh
PATHS /usr/local/include
/usr/include
/usr/local/OpenMesh-2.0rc4/include
"${CMAKE_SOURCE_DIR}/OpenMesh/src"
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src"
/ACG/acgdev/gcc-4.0-x86_64/OM2/OpenMesh-2.0/installed/include
"C:\\Program Files\\OpenMesh 2.0\\include"
)
SET(OPENMESH_LIBRARY_DIR NOTFOUND CACHE PATH "The directory where the OpenMesh libraries can be found.")
SET(SEARCH_PATHS
"${OPENMESH_INCLUDE_DIR}/../lib"
"${OPENMESH_INCLUDE_DIR}/../lib/OpenMesh"
"${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})
#if already found via finder or simulated finder in openmesh CMakeLists.txt, skip the search
IF (NOT OPENMESH_FOUND)
SET (SEARCH_PATHS
/usr/local/
/usr/
"${CMAKE_SOURCE_DIR}/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src/OpenMesh"
"C:/Program Files/OpenMesh 3.0"
"C:/Program Files/OpenMesh 2.4.1"
"C:/Program Files/OpenMesh 2.4"
"C:/libs/OpenMesh 3.0"
"C:/libs/OpenMesh 2.4.1"
"C:/libs/OpenMesh 2.4"
)
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)
SET(OPENMESH_LIBRARIES "${OPENMESH_CORE_LIBRARY}" "${OPENMESH_TOOLS_LIBRARY}")
SET(OPENMESH_INCLUDE_DIRS "${OPENMESH_INCLUDE_DIR}")
ENDIF (OPENMESH_FOUND)
FIND_LIBRARY(OPENMESH_CORE_LIBRARY_DEBUG NAMES OpenMeshCored
PATH ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
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