Commit 5ed8f3c0 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'patch-1' into 'master'

Split openmeshcore static/shared MinGW compilation

As with ms compilers, the shared/static compilation depends on export macros.

Besides this is inconsistent with the behavior for openmeshtools library.

Why did you add this ?

See merge request !72
parents 46aed2c4 ecdd59a8
Pipeline #2206 passed with stage
in 70 minutes and 34 seconds
include (ACGCommon) include (ACGCommon)
include_directories ( include_directories (
../.. ../..
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src
) )
# source code directories # source code directories
set (directories set (directories
. .
Geometry Geometry
IO IO
IO/exporter IO/exporter
IO/importer IO/importer
IO/reader IO/reader
IO/writer IO/writer
Mesh Mesh
Mesh/gen Mesh/gen
System System
Utils Utils
) )
# collect all header and source files # collect all header and source files
acg_append_files (headers "*.hh" ${directories}) acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories}) acg_append_files (sources "*.cc" ${directories})
#Drop the template only cc files #Drop the template only cc files
acg_drop_templates(sources) acg_drop_templates(sources)
# Disable Library installation when not building OpenMesh on its own but as part of another project! # Disable Library installation when not building OpenMesh on its own but as part of another project!
if ( NOT ${PROJECT_NAME} MATCHES "OpenMesh") if ( NOT ${PROJECT_NAME} MATCHES "OpenMesh")
set(ACG_NO_LIBRARY_INSTALL true) set(ACG_NO_LIBRARY_INSTALL true)
endif() endif()
if (WIN32 AND NOT MINGW) if (WIN32)
if ( OPENMESH_BUILD_SHARED ) if ( OPENMESH_BUILD_SHARED )
add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL)
acg_add_library (OpenMeshCore SHARED ${sources} ${headers}) acg_add_library (OpenMeshCore SHARED ${sources} ${headers})
else() else()
# OpenMesh has no dll exports so we have to build a static library on windows # OpenMesh has no dll exports so we have to build a static library on windows
acg_add_library (OpenMeshCore STATIC ${sources} ${headers}) acg_add_library (OpenMeshCore STATIC ${sources} ${headers})
endif() endif()
else () else ()
acg_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers}) acg_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers})
set_target_properties (OpenMeshCore PROPERTIES VERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR} set_target_properties (OpenMeshCore PROPERTIES VERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR}
SOVERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR} ) SOVERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR} )
endif () endif ()
# Add core as dependency before fixbundle # Add core as dependency before fixbundle
if ( (${PROJECT_NAME} MATCHES "OpenMesh") AND BUILD_APPS ) if ( (${PROJECT_NAME} MATCHES "OpenMesh") AND BUILD_APPS )
if ( WIN32 ) if ( WIN32 )
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" ) if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
add_dependencies (fixbundle OpenMeshCore) add_dependencies (fixbundle OpenMeshCore)
endif() endif()
endif() endif()
# Add core as dependency before fixbundle # Add core as dependency before fixbundle
if ( APPLE ) if ( APPLE )
# let bundle generation depend on targets # let bundle generation depend on targets
add_dependencies (fixbundle OpenMeshCore) add_dependencies (fixbundle OpenMeshCore)
endif () endif ()
endif() endif()
# if we build debug and release in the same dir, we want to install both! # if we build debug and release in the same dir, we want to install both!
if ( ${PROJECT_NAME} MATCHES "OpenMesh") if ( ${PROJECT_NAME} MATCHES "OpenMesh")
if ( WIN32 ) if ( WIN32 )
FILE(GLOB files_install_libs "${CMAKE_BINARY_DIR}/Build/lib/*.lib" ) FILE(GLOB files_install_libs "${CMAKE_BINARY_DIR}/Build/lib/*.lib" )
FILE(GLOB files_install_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" ) FILE(GLOB files_install_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" )
INSTALL(FILES ${files_install_libs} DESTINATION lib ) INSTALL(FILES ${files_install_libs} DESTINATION lib )
INSTALL(FILES ${files_install_dlls} DESTINATION . ) INSTALL(FILES ${files_install_dlls} DESTINATION . )
endif() endif()
endif() endif()
# Install Header Files (Apple) # Install Header Files (Apple)
if ( NOT ACG_PROJECT_MACOS_BUNDLE AND APPLE ) if ( NOT ACG_PROJECT_MACOS_BUNDLE AND APPLE )
FILE(GLOB files_install_Geometry "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*T.cc" ) FILE(GLOB files_install_Geometry "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*T.cc" )
FILE(GLOB files_install_IO "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*T.cc" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.inl" ) FILE(GLOB files_install_IO "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*T.cc" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.inl" )
FILE(GLOB files_install_IO_importer "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*T.cc" ) FILE(GLOB files_install_IO_importer "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*T.cc" )
FILE(GLOB files_install_IO_exporter "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*T.cc" ) FILE(GLOB files_install_IO_exporter "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*T.cc" )
FILE(GLOB files_install_IO_reader "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*T.cc" ) FILE(GLOB files_install_IO_reader "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*T.cc" )
FILE(GLOB files_install_IO_writer "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*T.cc" ) FILE(GLOB files_install_IO_writer "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*T.cc" )
FILE(GLOB files_install_Mesh "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*T.cc" ) FILE(GLOB files_install_Mesh "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*T.cc" )
FILE(GLOB files_install_Mesh_Gen "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*T.cc" ) FILE(GLOB files_install_Mesh_Gen "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*T.cc" )
FILE(GLOB files_install_System "${CMAKE_CURRENT_SOURCE_DIR}/System/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/System/*T.cc" "${CMAKE_CURRENT_SOURCE_DIR}/System/config.h" ) FILE(GLOB files_install_System "${CMAKE_CURRENT_SOURCE_DIR}/System/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/System/*T.cc" "${CMAKE_CURRENT_SOURCE_DIR}/System/config.h" )
FILE(GLOB files_install_Utils "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*T.cc" ) FILE(GLOB files_install_Utils "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*T.cc" )
INSTALL(FILES ${files_install_Geometry} DESTINATION include/OpenMesh/Core/Geometry ) INSTALL(FILES ${files_install_Geometry} DESTINATION include/OpenMesh/Core/Geometry )
INSTALL(FILES ${files_install_IO} DESTINATION include/OpenMesh/Core/IO ) INSTALL(FILES ${files_install_IO} DESTINATION include/OpenMesh/Core/IO )
INSTALL(FILES ${files_install_IO_importer} DESTINATION include/OpenMesh/Core/IO/importer ) INSTALL(FILES ${files_install_IO_importer} DESTINATION include/OpenMesh/Core/IO/importer )
INSTALL(FILES ${files_install_IO_exporter} DESTINATION include/OpenMesh/Core/IO/exporter ) INSTALL(FILES ${files_install_IO_exporter} DESTINATION include/OpenMesh/Core/IO/exporter )
INSTALL(FILES ${files_install_IO_reader} DESTINATION include/OpenMesh/Core/IO/reader ) INSTALL(FILES ${files_install_IO_reader} DESTINATION include/OpenMesh/Core/IO/reader )
INSTALL(FILES ${files_install_IO_writer} DESTINATION include/OpenMesh/Core/IO/writer ) INSTALL(FILES ${files_install_IO_writer} DESTINATION include/OpenMesh/Core/IO/writer )
INSTALL(FILES ${files_install_Mesh} DESTINATION include/OpenMesh/Core/Mesh ) INSTALL(FILES ${files_install_Mesh} DESTINATION include/OpenMesh/Core/Mesh )
INSTALL(FILES ${files_install_Mesh_Gen} DESTINATION include/OpenMesh/Core/Mesh/gen ) INSTALL(FILES ${files_install_Mesh_Gen} DESTINATION include/OpenMesh/Core/Mesh/gen )
INSTALL(FILES ${files_install_System} DESTINATION include/OpenMesh/Core/System ) INSTALL(FILES ${files_install_System} DESTINATION include/OpenMesh/Core/System )
INSTALL(FILES ${files_install_Utils} DESTINATION include/OpenMesh/Core/Utils ) INSTALL(FILES ${files_install_Utils} DESTINATION include/OpenMesh/Core/Utils )
endif() endif()
# Only install if the project name matches OpenMesh. # Only install if the project name matches OpenMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenMesh") if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenMesh")
# Install Header Files) # Install Header Files)
install(DIRECTORY . install(DIRECTORY .
DESTINATION include/OpenMesh/Core DESTINATION include/OpenMesh/Core
FILES_MATCHING FILES_MATCHING
PATTERN "*.hh" PATTERN "*.hh"
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 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)
#install inlined Files from IO #install inlined Files from IO
install(DIRECTORY IO/ install(DIRECTORY IO/
DESTINATION include/OpenMesh/Core/IO DESTINATION include/OpenMesh/Core/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 ()
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