Commit 61eef1a1 authored by Jan Möbius's avatar Jan Möbius

DLL is no longer experimental, as it builds and executes fine on Windows

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@701 fdac6126-5c0c-442c-9429-916003d36597
parent e85363b3
...@@ -35,7 +35,7 @@ endif () ...@@ -35,7 +35,7 @@ endif ()
if ( WIN32 ) if ( WIN32 )
if ( NOT DEFINED OPENMESH_BUILD_SHARED ) if ( NOT DEFINED OPENMESH_BUILD_SHARED )
set( OPENMESH_BUILD_SHARED false CACHE BOOL "Build as shared library? (!!!Experimental Feature!!!) " ) set( OPENMESH_BUILD_SHARED false CACHE BOOL "Build as shared library(DLL)?" )
endif() endif()
endif() endif()
......
...@@ -10,8 +10,7 @@ if ( BUILD_APPS ) ...@@ -10,8 +10,7 @@ if ( BUILD_APPS )
if(${PROJECT_NAME} MATCHES "OpenMesh") if(${PROJECT_NAME} MATCHES "OpenMesh")
if ( WIN32 AND OPENMESH_BUILD_SHARED ) if ( WIN32 AND OPENMESH_BUILD_SHARED )
#!!!! Experimental Feature!!! add_definitions(-DOPENMESHDLL )
add_definitions(-DOPENMESHDLL )
endif() endif()
add_subdirectory (Dualizer) add_subdirectory (Dualizer)
...@@ -77,22 +76,22 @@ if ( BUILD_APPS ) ...@@ -77,22 +76,22 @@ if ( BUILD_APPS )
endif() endif()
if ( WIN32 ) if ( WIN32 )
FILE(GLOB files_install_app_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" ) FILE(GLOB files_install_app_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" )
INSTALL(FILES ${files_install_app_dlls} DESTINATION . ) INSTALL(FILES ${files_install_app_dlls} DESTINATION . )
endif() endif()
else () # QT ,Opengl or glut not found else () # QT ,Opengl or glut not found
if (NOT QT4_FOUND) if (NOT QT4_FOUND)
message ("QT 4 not found! Skipping some apps.") message ("QT 4 not found! Skipping some apps.")
endif () endif ()
if (NOT OPENGL_FOUND) if (NOT OPENGL_FOUND)
message ("OpengGL not found! Skipping some apps.") message ("OpengGL not found! Skipping some apps.")
endif () endif ()
if (NOT GLUT_FOUND) if (NOT GLUT_FOUND)
message ("GLUT not found! Skipping some apps.") message ("GLUT not found! Skipping some apps.")
endif () endif ()
endif () endif ()
......
...@@ -38,7 +38,6 @@ endif() ...@@ -38,7 +38,6 @@ endif()
if (WIN32) if (WIN32)
if ( OPENMESH_BUILD_SHARED ) if ( OPENMESH_BUILD_SHARED )
# Experimental Feature!!!!
add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL)
acg_add_library (OpenMeshCore SHARED ${sources} ${headers}) acg_add_library (OpenMeshCore SHARED ${sources} ${headers})
else() else()
...@@ -121,13 +120,13 @@ install(DIRECTORY . ...@@ -121,13 +120,13 @@ install(DIRECTORY .
#install Template cc files (required by headers) #install Template cc files (required by headers)
install(DIRECTORY . install(DIRECTORY .
DESTINATION include/OpenMesh/Core DESTINATION include/OpenMesh/Core
FILES_MATCHING FILES_MATCHING
PATTERN "*T.cc" PATTERN "*T.cc"
PATTERN "CVS" EXCLUDE PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE PATTERN ".svn" EXCLUDE
PATTERN "tmp" EXCLUDE PATTERN "tmp" EXCLUDE
PATTERN "Templates" EXCLUDE PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE) PATTERN "Debian*" EXCLUDE)
#install the config file #install the config file
install(FILES System/config.h DESTINATION include/OpenMesh/Core/System) install(FILES System/config.h DESTINATION include/OpenMesh/Core/System)
...@@ -138,14 +137,14 @@ install(DIRECTORY IO/ ...@@ -138,14 +137,14 @@ install(DIRECTORY IO/
FILES_MATCHING FILES_MATCHING
PATTERN "*.inl" PATTERN "*.inl"
PATTERN "CVS" EXCLUDE PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE PATTERN ".svn" EXCLUDE
PATTERN "reader" EXCLUDE PATTERN "reader" EXCLUDE
PATTERN "writer" EXCLUDE PATTERN "writer" EXCLUDE
PATTERN "importer" EXCLUDE PATTERN "importer" EXCLUDE
PATTERN "exporter" EXCLUDE PATTERN "exporter" EXCLUDE
PATTERN "tmp" EXCLUDE PATTERN "tmp" EXCLUDE
PATTERN "Debian*" EXCLUDE ) PATTERN "Debian*" EXCLUDE )
endif () endif ()
...@@ -38,7 +38,6 @@ endif() ...@@ -38,7 +38,6 @@ endif()
if (WIN32) if (WIN32)
if ( OPENMESH_BUILD_SHARED ) if ( OPENMESH_BUILD_SHARED )
# Experimental Feature!!!!
add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL)
acg_add_library (OpenMeshTools SHARED ${sources} ${headers}) acg_add_library (OpenMeshTools SHARED ${sources} ${headers})
else() else()
......
...@@ -43,10 +43,10 @@ if ( OPENMESH_BUILD_UNIT_TESTS ) ...@@ -43,10 +43,10 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
if ( NOT WIN32 ) if ( NOT WIN32 )
# Set compiler flags # Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "-g -pedantic -ansi -Wno-long-long") set_target_properties(unittests PROPERTIES COMPILE_FLAGS "-g -pedantic -ansi -Wno-long-long")
else() else()
# Set compiler flags # Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" ) set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" )
...@@ -58,21 +58,34 @@ if ( OPENMESH_BUILD_UNIT_TESTS ) ...@@ -58,21 +58,34 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/unittests.exe ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/unittests.exe
${CMAKE_BINARY_DIR}/Unittests/unittests.exe) ${CMAKE_BINARY_DIR}/Unittests/unittests.exe)
endif()
if ( OPENMESH_BUILD_SHARED ) # If OpenMesh is build as a shared library, we need to copy the dlls to the directory for the unittests!
#!!!! Experimental Feature!!! if ( OPENMESH_BUILD_SHARED )
#!!!! Experimental Feature!!!
#-------- copy dlls to unittests -------- add_custom_command (TARGET unittests POST_BUILD
SET(OPENMESH_TARGETS "OpenMeshTools" "OpenMeshCore") COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/OpenMesh*.dll
${CMAKE_BINARY_DIR}/Unittests/)
message("Copy from ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/OpenMesh*.dll to ${CMAKE_BINARY_DIR}/Unittests/")
endif()
endif()
if ( OPENMESH_BUILD_SHARED )
foreach(TAR ${OPENMESH_TARGETS} ) #-------- copy dlls to unittests --------
add_custom_command(TARGET unittests POST_BUILD SET(OPENMESH_TARGETS "OpenMeshTools" "OpenMeshCore")
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:${TAR}>" foreach(TAR ${OPENMESH_TARGETS} )
"${CMAKE_BINARY_DIR}/Unittests/$<TARGET_FILE_NAME:${TAR}>" add_custom_command(TARGET unittests POST_BUILD
COMMENT "Copying OpenMesh targets to unittests directory") COMMAND "${CMAKE_COMMAND}" -E copy
endforeach(TAR) "$<TARGET_FILE:${TAR}>"
endif() "${CMAKE_BINARY_DIR}/Unittests/$<TARGET_FILE_NAME:${TAR}>"
COMMENT "Copying OpenMesh targets to unittests directory")
endforeach(TAR)
endif()
acg_copy_after_build(unittests ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/) acg_copy_after_build(unittests ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/)
......
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