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