Dennis:
OpenMesh cmake support git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@111 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
37
src/OpenMesh/Apps/CMakeLists.txt
Normal file
37
src/OpenMesh/Apps/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
include (ACGCommon)
|
||||
|
||||
# find needed packages
|
||||
find_package (OpenGL)
|
||||
find_package (GLUT)
|
||||
find_package (GLEW)
|
||||
|
||||
acg_qt4 ()
|
||||
|
||||
add_subdirectory (Decimating/commandlineDecimater)
|
||||
add_subdirectory (Smoothing)
|
||||
add_subdirectory (Subdivider/commandlineSubdivider)
|
||||
add_subdirectory (Subdivider/commandlineAdaptiveSubdivider)
|
||||
add_subdirectory (mconvert)
|
||||
|
||||
# check for OpenGL, GLEW and GLUT as our required dependencies
|
||||
if (QT4_FOUND AND OPENGL_FOUND AND GLEW_FOUND AND GLUT_FOUND)
|
||||
add_subdirectory (Decimating/DecimaterGui)
|
||||
add_subdirectory (QtViewer)
|
||||
add_subdirectory (Subdivider/SubdividerGui)
|
||||
else ()
|
||||
if (NOT QT4_FOUND)
|
||||
message ("QT 4 not found! Skipping some apps.")
|
||||
endif ()
|
||||
|
||||
if (NOT OPENGL_FOUND)
|
||||
message ("OpengGL not found! Skipping some apps.")
|
||||
endif ()
|
||||
|
||||
if (NOT GLEW_FOUND)
|
||||
message ("GLEW not found! Skipping some apps.")
|
||||
endif ()
|
||||
|
||||
if (NOT GLUT_FOUND)
|
||||
message ("GLUT not found! Skipping some apps.")
|
||||
endif ()
|
||||
endif ()
|
||||
48
src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt
Normal file
48
src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName DecimaterGui)
|
||||
|
||||
# source code directories
|
||||
set (directories
|
||||
../../QtViewer
|
||||
../
|
||||
)
|
||||
|
||||
# collect all header and source files
|
||||
acg_append_files (headers "*.hh" ${directories})
|
||||
|
||||
set (sources
|
||||
../../QtViewer/QGLViewerWidget.cc
|
||||
../../QtViewer/MeshViewerWidgetT.cc
|
||||
../DecimaterViewerWidget.cc
|
||||
../decimaterviewer.cc
|
||||
)
|
||||
|
||||
# remove template cc files from source file list
|
||||
acg_drop_templates (sources)
|
||||
|
||||
# genereate uic and moc targets
|
||||
acg_qt4_automoc (moc_targets ${headers})
|
||||
|
||||
if (WIN32)
|
||||
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})
|
||||
# link to qtmain library to get WinMain function for a non terminal app
|
||||
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
|
||||
else ()
|
||||
acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets})
|
||||
endif ()
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLEW_LIBRARY}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName commandlineDecimater)
|
||||
|
||||
# collect all header and source files
|
||||
set (sources
|
||||
../decimater.cc
|
||||
)
|
||||
|
||||
acg_add_executable (${targetName} ${sources})
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
)
|
||||
|
||||
44
src/OpenMesh/Apps/QtViewer/CMakeLists.txt
Normal file
44
src/OpenMesh/Apps/QtViewer/CMakeLists.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName QtViewer)
|
||||
|
||||
# source code directories
|
||||
set (directories
|
||||
.
|
||||
)
|
||||
|
||||
# collect all header and source files
|
||||
acg_append_files (headers "*.hh" ${directories})
|
||||
acg_append_files (sources "*.cc" ${directories})
|
||||
acg_append_files (ui "*.ui" ${directories})
|
||||
|
||||
# remove template cc files from source file list
|
||||
acg_drop_templates (sources)
|
||||
|
||||
# genereate uic and moc targets
|
||||
acg_qt4_autouic (uic_targets ${ui})
|
||||
acg_qt4_automoc (moc_targets ${headers})
|
||||
|
||||
|
||||
if (WIN32)
|
||||
acg_add_executable (${targetName} WIN32 ${uic_targets} ${sources} ${headers} ${moc_targets})
|
||||
# link to qtmain library to get WinMain function for a non terminal app
|
||||
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
|
||||
else ()
|
||||
acg_add_executable (${targetName} ${uic_targets} ${sources} ${headers} ${moc_targets})
|
||||
endif ()
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLEW_LIBRARY}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
20
src/OpenMesh/Apps/Smoothing/CMakeLists.txt
Normal file
20
src/OpenMesh/Apps/Smoothing/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName Smoothing)
|
||||
|
||||
# collect all header and source files
|
||||
acg_append_files (headers "*.hh" .)
|
||||
acg_append_files (sources "*.cc" .)
|
||||
|
||||
acg_add_executable (${targetName} ${headers} ${sources})
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
)
|
||||
|
||||
48
src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt
Normal file
48
src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName SubdividerGui)
|
||||
|
||||
# source code directories
|
||||
set (directories
|
||||
../../QtViewer
|
||||
../
|
||||
)
|
||||
|
||||
# collect all header and source files
|
||||
acg_append_files (headers "*.hh" ${directories})
|
||||
|
||||
set (sources
|
||||
../../QtViewer/QGLViewerWidget.cc
|
||||
../../QtViewer/MeshViewerWidgetT.cc
|
||||
../SubdivideWidget.cc
|
||||
../qtsubdivider.cc
|
||||
)
|
||||
|
||||
# remove template cc files from source file list
|
||||
acg_drop_templates (sources)
|
||||
|
||||
# genereate uic and moc targets
|
||||
acg_qt4_automoc (moc_targets ${headers})
|
||||
|
||||
if (WIN32)
|
||||
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})
|
||||
# link to qtmain library to get WinMain function for a non terminal app
|
||||
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
|
||||
else ()
|
||||
acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets})
|
||||
endif ()
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLEW_LIBRARY}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName commandlineAdaptiveSubdivider)
|
||||
|
||||
# collect all header and source files
|
||||
set (sources
|
||||
../adaptive_subdivider.cc
|
||||
)
|
||||
|
||||
acg_add_executable (${targetName} ${sources})
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName commandlineSubdivider)
|
||||
|
||||
# collect all header and source files
|
||||
set (sources
|
||||
../subdivider.cc
|
||||
)
|
||||
|
||||
acg_add_executable (${targetName} ${sources})
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
)
|
||||
|
||||
20
src/OpenMesh/Apps/mconvert/CMakeLists.txt
Normal file
20
src/OpenMesh/Apps/mconvert/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set (targetName mconvert)
|
||||
|
||||
# collect all header and source files
|
||||
acg_append_files (headers "*.hh" .)
|
||||
acg_append_files (sources "*.cc" .)
|
||||
|
||||
acg_add_executable (${targetName} ${headers} ${sources})
|
||||
|
||||
target_link_libraries (${targetName}
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include (common)
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../..
|
||||
@@ -21,20 +21,14 @@ set (directories
|
||||
)
|
||||
|
||||
# collect all header and source files
|
||||
append_files (headers "*.hh" ${directories})
|
||||
append_files (sources "*.cc" ${directories})
|
||||
acg_append_files (headers "*.hh" ${directories})
|
||||
acg_append_files (sources "*.cc" ${directories})
|
||||
|
||||
if (WIN32)
|
||||
# OpenMesh has no dll exports so we have to build a static library on windows
|
||||
add_library (OpenMeshCore STATIC ${sources} ${headers})
|
||||
acg_add_library (OpenMeshCore STATIC ${sources} ${headers})
|
||||
else ()
|
||||
add_library (OpenMeshCore SHARED ${sources} ${headers})
|
||||
# no install on mac, because the whole bundle will be installed in the
|
||||
# toplevel CMakeLists.txt
|
||||
if (NOT APPLE)
|
||||
install (TARGETS OpenMeshCore DESTINATION ${OPENFLIPPER_LIBDIR})
|
||||
endif ()
|
||||
acg_add_library (OpenMeshCore SHARED ${sources} ${headers})
|
||||
endif ()
|
||||
|
||||
# set common target properties defined in common.cmake
|
||||
set_target_props (OpenMeshCore)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include (common)
|
||||
include (ACGCommon)
|
||||
|
||||
include_directories (
|
||||
../..
|
||||
@@ -17,22 +17,15 @@ set (directories
|
||||
)
|
||||
|
||||
# collect all header and source files
|
||||
append_files (headers "*.hh" ${directories})
|
||||
append_files (sources "*.cc" ${directories})
|
||||
acg_append_files (headers "*.hh" ${directories})
|
||||
acg_append_files (sources "*.cc" ${directories})
|
||||
|
||||
if (WIN32)
|
||||
# OpenMesh has no dll exports so we have to build a static library on windows
|
||||
add_library (OpenMeshTools STATIC ${sources} ${headers})
|
||||
acg_add_library (OpenMeshTools STATIC ${sources} ${headers})
|
||||
else ()
|
||||
add_library (OpenMeshTools SHARED ${sources} ${headers})
|
||||
# no install on mac, because the whole bundle will be installed in the
|
||||
# toplevel CMakeLists.txt
|
||||
if (NOT APPLE)
|
||||
install (TARGETS OpenMeshTools DESTINATION ${OPENFLIPPER_LIBDIR})
|
||||
endif ()
|
||||
acg_add_library (OpenMeshTools SHARED ${sources} ${headers})
|
||||
endif ()
|
||||
|
||||
target_link_libraries (OpenMeshTools OpenMeshCore)
|
||||
|
||||
# set common target properties defined in common.cmake
|
||||
set_target_props (OpenMeshTools)
|
||||
|
||||
Reference in New Issue
Block a user