Add assimp command line tools to CMAKE build. Add it to make install as well. Needs more testing on different systems.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@568 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
5738860990
commit
f7aa189118
|
@ -13,6 +13,7 @@ SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin )
|
|||
SET( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" )
|
||||
|
||||
SET( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" )
|
||||
SET( BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" )
|
||||
SET( LIBRARY_VERSION "1.0.0" )
|
||||
SET( LIBRARY_SOVERSION "1" )
|
||||
|
||||
|
@ -20,9 +21,8 @@ SET( LIBRARY_SOVERSION "1" )
|
|||
add_subdirectory( code/ )
|
||||
IF( WIN32 )
|
||||
add_subdirectory( test/ )
|
||||
add_subdirectory( tools/assimp_cmd/ )
|
||||
add_subdirectory( tools/assimp_view/ )
|
||||
ENDIF( WIN32 )
|
||||
|
||||
|
||||
add_subdirectory( tools/assimp_cmd/ )
|
||||
|
||||
|
|
4
INSTALL
4
INSTALL
|
@ -41,6 +41,10 @@ favourite build script generator from *here* and have fun.
|
|||
If you use cmake only to get a makefile, run
|
||||
'make' and 'make install' afterwards.
|
||||
|
||||
NOTE: in order to use the assimp command line tools, you may
|
||||
need to run ldconfig as root to make the so loader find
|
||||
the assimp shared library --
|
||||
|
||||
Note that running make from ./code is deprecated, although there
|
||||
is still a suitable makefile in it.
|
||||
|
||||
|
|
|
@ -39,38 +39,11 @@ add_executable( assimp_cmd
|
|||
WriteDumb.cpp
|
||||
)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( PSDK_PATH "C:/Program Files/Microsoft Platform SDK/Bin" )
|
||||
SET( PSDK_INC "C:/Program Files/Microsoft Platform SDK/Include" )
|
||||
|
||||
FIND_PATH(DX9_INCLUDE_PATH d3d9.h
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}/Include"
|
||||
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Include"
|
||||
DOC "The directory where D3D9.h resides")
|
||||
|
||||
|
||||
FIND_LIBRARY(D3D9_LIBRARY d3d9.lib
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
||||
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Lib/x86"
|
||||
DOC "The directory where d3d9.lib resides")
|
||||
|
||||
FIND_LIBRARY(D3DX9_LIBRARY d3dx9.lib
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
||||
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Lib/x86"
|
||||
DOC "The directory where d3dx9.lib resides")
|
||||
|
||||
SET( DX9_LIBRARIES ${D3D9_LIBRARY} ${D3DX9_LIBRARY} )
|
||||
|
||||
FIND_LIBRARY( WIN32_COMCTRL comctl32.lib
|
||||
PATHS
|
||||
"C:/Programme/Microsoft Platform SDK for Windows Server 2003 R2/Lib"
|
||||
DOC "Path to psdk"
|
||||
)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
# Link the executable to the Hello library.
|
||||
target_link_libraries ( assimp_cmd assimp ${DX9_LIBRARIES} comctl32.lib Winmm.lib )
|
||||
# Link the executable to the assimp library and rename it to assimp as well :-)
|
||||
target_link_libraries ( assimp_cmd assimp )
|
||||
INSTALL(PROGRAMS ../../bin/assimp_cmd
|
||||
DESTINATION "${BIN_INSTALL_DIR}"
|
||||
RENAME assimp
|
||||
)
|
||||
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Makefile for assimp_cmd
|
||||
# aramis_acg@users.sourceforge.net
|
||||
#
|
||||
# Usage: make <target> <macros>
|
||||
|
||||
# TARGETS:
|
||||
# all Build assimp_cmd tool and assimp if necessary
|
||||
# clean Cleanup all object files, including those from core
|
||||
# cleanme Cleanup only my object files
|
||||
|
||||
# MACROS: (make clean before you change one)
|
||||
# NOBOOST=1 Build Assimp against boost workaround
|
||||
# SINGLETHREADED=1 Build Assimp single-threaded library
|
||||
# DEBUG=1 Build debug build of Assimp library
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
# C++ object files
|
||||
OBJECTS := $(patsubst %.cpp,%.o, $(wildcard *.cpp))
|
||||
|
||||
|
||||
# Include flags for gcc
|
||||
INCLUDEFLAGS = -I../../include
|
||||
|
||||
# Library flags for gcc
|
||||
LIBRARYFLAGS = -L../../bin/gcc/
|
||||
|
||||
# Preprocessor defines for gcc
|
||||
DEFINEFLAGS =
|
||||
|
||||
# GCC compiler flags
|
||||
CPPFLAGS=-Wall
|
||||
|
||||
|
||||
# Setup environment for debug build
|
||||
ifeq ($(DEBUG),1)
|
||||
DEFINEFLAGS += -D_DEBUG -DDEBUG
|
||||
else
|
||||
CPPFLAGS += -o3
|
||||
DEFINEFLAGS += -DNDEBUG -D_NDEBUG
|
||||
endif
|
||||
|
||||
# Output path of executable
|
||||
OUTPUT = ../../bin/gcc/assimp
|
||||
|
||||
|
||||
all: $(OBJECTS)
|
||||
cd ../../code/ && $(MAKE) static
|
||||
gcc -s -o$(OUTPUT) $(OBJECTS) $(LIBRARYFLAGS) -lassimp -lstdc++
|
||||
|
||||
%.o:%.cpp
|
||||
$(CXX) -g -c $(CPPFLAGS) $? -o $@ $(INCLUDEFLAGS) $(DEFINEFLAGS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-del *.o
|
||||
cd ../../code/ && $(MAKE) clean
|
||||
|
||||
.PHONY: cleanme
|
||||
cleanme:
|
||||
-del *.o
|
Loading…
Reference in New Issue