Merge pull request #89 from assimp/cmake-fixes

CMake Fixes
pull/90/head
Alexander Gessler 2013-09-18 05:28:23 -07:00
commit d56ff34616
2 changed files with 21 additions and 13 deletions

View File

@ -19,6 +19,12 @@ ADD_EXECUTABLE( assimp_cmd
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
IF( WIN32 )
ADD_CUSTOM_COMMAND(TARGET assimp_cmd
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $<TARGET_FILE_DIR:assimp_cmd>)
ENDIF( WIN32 )
TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES}) TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES})
SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES
OUTPUT_NAME assimp OUTPUT_NAME assimp

View File

@ -1,18 +1,16 @@
FIND_PACKAGE(DirectX REQUIRED) FIND_PACKAGE(DirectX REQUIRED)
# Make sure the compiler can find include files from our Hello library.
include_directories ( INCLUDE_DIRECTORIES (
${Assimp_SOURCE_DIR}/include ${Assimp_SOURCE_DIR}/include
${Assimp_SOURCE_DIR}/code ${Assimp_SOURCE_DIR}/code
${DirectX_INCLUDE_DIR} ${DirectX_INCLUDE_DIR}
) )
# Make sure the linker can find the Hello library once it is built. # Make sure the linker can find the Assimp library once it is built.
link_directories (${Assimp_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib) LINK_DIRECTORIES (${Assimp_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib)
# Add executable called "helloDemo" that is built from the source files ADD_EXECUTABLE( assimp_viewer WIN32
# "demo.cxx" and "demo_b.cxx". The extensions are automatically found.
add_executable( assimp_viewer WIN32
AnimEvaluator.cpp AnimEvaluator.cpp
Background.cpp Background.cpp
Display.cpp Display.cpp
@ -45,13 +43,17 @@ add_executable( assimp_viewer WIN32
SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
IF( WIN32 ) ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
ENDIF( WIN32 )
# Link the executable to the Hello library.
target_link_libraries ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) #
ADD_CUSTOM_COMMAND(TARGET assimp_viewer
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $<TARGET_FILE_DIR:assimp_viewer>)
# Link the executable to the assimp + dx libs.
TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib )
INSTALL( TARGETS assimp_viewer INSTALL( TARGETS assimp_viewer
DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev