diff --git a/CMakeLists.txt b/CMakeLists.txt index 56376f1d9..c1d063547 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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/ ) diff --git a/INSTALL b/INSTALL index ed90de2f2..b94af6f4b 100644 --- a/INSTALL +++ b/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. diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index 79175a987..0a379f680 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -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 +) diff --git a/tools/assimp_cmd/makefile b/tools/assimp_cmd/makefile deleted file mode 100644 index 413f6859d..000000000 --- a/tools/assimp_cmd/makefile +++ /dev/null @@ -1,63 +0,0 @@ - -# --------------------------------------------------------------------------- -# Makefile for assimp_cmd -# aramis_acg@users.sourceforge.net -# -# Usage: make - -# 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 \ No newline at end of file