2020-02-26 17:19:06 +00:00
|
|
|
SET(SAMPLE_PROJECT_NAME assimp_simpleogl)
|
|
|
|
|
2015-05-19 03:44:54 +00:00
|
|
|
FIND_PACKAGE(OpenGL)
|
|
|
|
FIND_PACKAGE(GLUT)
|
2015-07-04 20:08:56 +00:00
|
|
|
IF ( MSVC )
|
|
|
|
SET(M_LIB)
|
2020-02-23 12:09:35 +00:00
|
|
|
ELSE ()
|
2015-07-04 20:08:56 +00:00
|
|
|
find_library(M_LIB m)
|
2020-02-23 12:09:35 +00:00
|
|
|
ENDIF ()
|
2015-05-19 03:44:54 +00:00
|
|
|
|
|
|
|
IF ( NOT GLUT_FOUND )
|
|
|
|
IF ( MSVC )
|
|
|
|
SET ( GLUT_FOUND 1 )
|
2019-02-07 16:09:05 +00:00
|
|
|
SET ( GLUT_INCLUDE_DIR ${Assimp_SOURCE_DIR}/samples/freeglut/ )
|
|
|
|
SET ( GLUT_LIBRARIES ${Assimp_SOURCE_DIR}/samples/freeglut/lib/freeglut.lib )
|
2020-02-23 12:09:35 +00:00
|
|
|
ELSE ()
|
2015-05-19 03:44:54 +00:00
|
|
|
MESSAGE( WARNING "Please install glut." )
|
2020-02-23 12:09:35 +00:00
|
|
|
ENDIF ()
|
|
|
|
ENDIF ()
|
2015-05-19 03:44:54 +00:00
|
|
|
|
2020-02-26 17:19:06 +00:00
|
|
|
# Used for usage and error messages in the program.
|
|
|
|
ADD_COMPILE_DEFINITIONS(ASSIMP_VERSION="${ASSIMP_VERSION}")
|
|
|
|
ADD_COMPILE_DEFINITIONS(PROJECT_NAME="${SAMPLE_PROJECT_NAME}")
|
|
|
|
|
2017-09-24 09:29:43 +00:00
|
|
|
if ( MSVC )
|
|
|
|
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
|
|
|
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
2020-02-23 12:09:35 +00:00
|
|
|
endif ()
|
2017-09-24 09:29:43 +00:00
|
|
|
|
2015-05-19 03:44:54 +00:00
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${Assimp_SOURCE_DIR}/include
|
|
|
|
${Assimp_SOURCE_DIR}/code
|
|
|
|
${OPENGL_INCLUDE_DIR}
|
2019-09-09 21:00:04 +00:00
|
|
|
${GLUT_INCLUDE_DIR}
|
2019-02-07 16:09:05 +00:00
|
|
|
${Assimp_SOURCE_DIR}/samples/freeglut/include
|
2015-05-19 03:44:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
LINK_DIRECTORIES(
|
|
|
|
${Assimp_BINARY_DIR}
|
|
|
|
${Assimp_BINARY_DIR}/lib
|
|
|
|
)
|
|
|
|
|
2020-02-26 17:19:06 +00:00
|
|
|
ADD_EXECUTABLE( ${SAMPLE_PROJECT_NAME}
|
2015-05-19 03:44:54 +00:00
|
|
|
Sample_SimpleOpenGL.c
|
|
|
|
)
|
|
|
|
|
2020-08-07 20:04:39 +00:00
|
|
|
TARGET_USE_COMMON_OUTPUT_DIRECTORY(${SAMPLE_PROJECT_NAME})
|
|
|
|
|
2020-02-26 17:19:06 +00:00
|
|
|
SET_PROPERTY(TARGET ${SAMPLE_PROJECT_NAME} PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
2015-05-19 03:44:54 +00:00
|
|
|
|
2020-02-26 17:19:06 +00:00
|
|
|
TARGET_LINK_LIBRARIES( ${SAMPLE_PROJECT_NAME} assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${M_LIB} )
|
|
|
|
SET_TARGET_PROPERTIES( ${SAMPLE_PROJECT_NAME} PROPERTIES
|
|
|
|
OUTPUT_NAME ${SAMPLE_PROJECT_NAME}
|
2015-05-19 03:44:54 +00:00
|
|
|
)
|
|
|
|
|
2020-02-26 17:19:06 +00:00
|
|
|
INSTALL( TARGETS ${SAMPLE_PROJECT_NAME}
|
2015-05-19 03:44:54 +00:00
|
|
|
DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev
|
|
|
|
)
|