Several places in the sample's code were calling Unicode versions of Win32 functions with "multibyte" strings. A few changes were required to fix it. I added a class "UTFConverter", which handles calls to unicode/multibyte string conversions. This should help minimize the impacts on code change in case C++'s codecvt_utf8 ever changes. In addition, seveal memory leaks have been found, but these fixes will come in another PR because it goes beyond the scope of this PR. DevIL.lib was removed in CMakeFiles.txt, as it is unused in the sample. Here is a list of the changes: - Fixed MB string calls to Unicode functions. - Added class UTFConverter to handle string conversions. - Removed reference to DevIL.lib. - Fixed compile warnings.
47 lines
1.2 KiB
CMake
47 lines
1.2 KiB
CMake
FIND_PACKAGE(OpenGL)
|
|
FIND_PACKAGE(GLUT)
|
|
|
|
IF ( NOT GLUT_FOUND )
|
|
IF ( MSVC )
|
|
SET ( GLUT_FOUND 1 )
|
|
SET ( GLUT_INCLUDE_DIR ${Assimp_SOURCE_DIR}/samples/freeglut/ )
|
|
SET ( GLUT_LIBRARIES ${Assimp_SOURCE_DIR}/samples/freeglut/lib/freeglut.lib )
|
|
ELSE ( MSVC )
|
|
MESSAGE( WARNING "Please install glut." )
|
|
ENDIF ( MSVC )
|
|
ENDIF ( NOT GLUT_FOUND )
|
|
|
|
if ( MSVC )
|
|
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
|
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
|
endif ( MSVC )
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
${Assimp_SOURCE_DIR}/include
|
|
${Assimp_SOURCE_DIR}/code
|
|
${OPENGL_INCLUDE_DIR}
|
|
${GLUT_INCLUDE_DIR}
|
|
)
|
|
|
|
LINK_DIRECTORIES(
|
|
${Assimp_BINARY_DIR}
|
|
${Assimp_BINARY_DIR}/lib/
|
|
)
|
|
|
|
ADD_EXECUTABLE( assimp_simpletexturedogl WIN32
|
|
SimpleTexturedOpenGL/include/boost_includes.h
|
|
SimpleTexturedOpenGL/src/model_loading.cpp
|
|
)
|
|
|
|
SET_PROPERTY(TARGET assimp_simpletexturedogl PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
|
|
|
TARGET_LINK_LIBRARIES( assimp_simpletexturedogl assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} )
|
|
|
|
SET_TARGET_PROPERTIES( assimp_simpletexturedogl PROPERTIES
|
|
OUTPUT_NAME assimp_simpletexturedogl
|
|
)
|
|
|
|
INSTALL( TARGETS assimp_simpletexturedogl
|
|
DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev
|
|
)
|