@ -60,6 +60,9 @@ if(BUILD_STATIC_PIC)
set_target_properties ( ObjImporter PROPERTIES POSITION_INDEPENDENT_CODE ON )
set_target_properties ( ObjImporter PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
endif ( )
target_link_libraries ( ObjImporter Magnum MagnumMeshTools )
target_link_libraries ( ObjImporter Magnum MagnumMeshTools )
if ( CORRADE_TARGET_WINDOWS )
target_link_libraries ( ObjImporter AnyImageImporter )
endif ( )
install ( FILES ${ ObjImporter_HEADERS } DESTINATION ${ MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR } /ObjImporter )
install ( FILES ${ ObjImporter_HEADERS } DESTINATION ${ MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR } /ObjImporter )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /configure.h DESTINATION ${ MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR } /ObjImporter )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /configure.h DESTINATION ${ MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR } /ObjImporter )
@ -73,11 +76,26 @@ if(BUILD_PLUGINS_STATIC)
endif ( )
endif ( )
if ( BUILD_TESTS )
if ( BUILD_TESTS )
add_library ( MagnumObjImporterTestLib STATIC
# O n W i n 3 2 w e n e e d t o a v o i d d l l i m p o r t i n g A n y I m a g e I m p o r t e r s y m b o l s , b e c a u s e
$ < T A R G E T _ O B J E C T S : O b j I m p o r t e r O b j e c t s >
# i t w o u l d s e a r c h f o r t h e s y m b o l s i n s o m e D L L e v e n w h e n t h e y w e r e l i n k e d
$ { P R O J E C T _ S O U R C E _ D I R } / s r c / d u m m y . c p p ) # X C o d e w o r k a r o u n d , s e e f i l e c o m m e n t f o r d e t a i l s
# s t a t i c a l l y . H o w e v e r i t a p p a r e n t l y d o e s n ' t m a t t e r t h a t t h e y w e r e
# d l l e x p o r t e d w h e n b u i l d i n g t h e s t a t i c l i b r a r y . E H . A n d b e c a u s e t h e
# - D O b j I m p o r t e r O b j e c t s _ E X P O R T S i s n o l o n g e r s e t i n t h i s c a s e , w e n e e d
# t o a v o i d d l l i m p o r t i n g O b j I m p o r t e r s y m b o l s a s w e l l .
if ( CORRADE_TARGET_WINDOWS )
add_library ( MagnumObjImporterTestLib STATIC
$ { O b j I m p o r t e r _ S R C S }
$ { O b j I m p o r t e r _ H E A D E R S } )
target_compile_definitions ( MagnumObjImporterTestLib PRIVATE
" M A G N U M _ A N Y I M A G E I M P O R T E R _ B U I L D _ S T A T I C "
" M A G N U M _ O B J I M P O R T E R _ B U I L D _ S T A T I C " )
else ( )
add_library ( MagnumObjImporterTestLib STATIC
$ < T A R G E T _ O B J E C T S : O b j I m p o r t e r O b j e c t s >
$ { P R O J E C T _ S O U R C E _ D I R } / s r c / d u m m y . c p p ) # X C o d e w o r k a r o u n d , s e e f i l e c o m m e n t f o r d e t a i l s
endif ( )
set_target_properties ( MagnumObjImporterTestLib PROPERTIES FOLDER "MagnumPlugins/ObjImporter" )
set_target_properties ( MagnumObjImporterTestLib PROPERTIES FOLDER "MagnumPlugins/ObjImporter" )
target_link_libraries ( MagnumObjImporterTestLib Magnum MagnumMeshTools )
target_link_libraries ( MagnumObjImporterTestLib Magnum MagnumMeshTools MagnumAnyImageImporterTestLib )
add_subdirectory ( Test )
add_subdirectory ( Test )
endif ( )
endif ( )