Skip to content

Commit

Permalink
Debug build has prefix _d. Added install target
Browse files Browse the repository at this point in the history
  • Loading branch information
Ybalrid committed Jul 17, 2018
1 parent 2d77721 commit 3d32713
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
37 changes: 24 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ project(Ogre_glTF)
#to build a library
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
set(CMAKE_INSTALL_PREFIX "./output")

if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "_d")
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake)

#get Ogre from your system. May need to set some variable for Windows folks
find_package(OGRE COMPONENTS HlmsPbs REQUIRED)


file(GLOB librarySources ./src/*.cpp ./src/private_headers/*.hpp ./include/*.hpp)
file(GLOB testSources ./test/*.cpp ./test/*.hpp ./include/*.hpp)
file(GLOB pluginTestSources ./pluginTest/*.cpp ./pluginTest/*.hpp ./include/*.hpp)
Expand All @@ -22,19 +25,16 @@ add_library(Ogre_glTF SHARED ${librarySources})

target_compile_definitions(Ogre_glTF PUBLIC Ogre_glTF_DLL_EXPORT_CONFIG_ON)



if(MSVC)
add_executable(Ogre_glTF_TEST WIN32 ${testSources})
add_executable(Ogre_gltf_PluginTest WIN32 ${pluginTestSources})
#add_executable(Ogre_glTF_TEST_static WIN32 ${testSources})
add_executable(Ogre_glTF_TEST WIN32 ${testSources})
add_executable(Ogre_gltf_PluginTest WIN32 ${pluginTestSources})
#add_executable(Ogre_glTF_TEST_static WIN32 ${testSources})
else()
add_executable(Ogre_glTF_TEST ${testSources})
add_executable(Ogre_gltf_PluginTest ${pluginTestSources})
#add_executable(Ogre_glTF_TEST_static ${testSources})
add_executable(Ogre_glTF_TEST ${testSources})
add_executable(Ogre_gltf_PluginTest ${pluginTestSources})
#add_executable(Ogre_glTF_TEST_static ${testSources})
endif(MSVC)


target_include_directories( Ogre_glTF PUBLIC
#Ogre and the physics based high level material system
${OGRE_INCLUDE_DIRS}
Expand All @@ -46,8 +46,6 @@ target_include_directories( Ogre_glTF PUBLIC
./thirdParty/tinygltf/
)



#target_include_directories( Ogre_glTF_static PUBLIC
# #Ogre and the physics based high level material system
# ${OGRE_INCLUDE_DIRS}
Expand Down Expand Up @@ -110,3 +108,16 @@ target_link_libraries(Ogre_gltf_PluginTest
# Ogre_glTF_static
#)

#installation
if(WIN32)
set(CMAKE_INSTALL_PREFIX "./sdk" CACHE PATH "Installation prefix on windows, should be a subdirectory of the build directory" FORCE)
endif()

install(TARGETS Ogre_glTF DESTINATION "bin")
install(FILES
./include/Ogre_glTF.hpp
./include/Ogre_glTF_OgrePlugin.hpp
./include/Ogre_glTF_OgreResource.hpp
./include/Ogre_glTF_DLL.hpp
DESTINATION
"include")
2 changes: 1 addition & 1 deletion pluginTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const char GL_RENDER_PLUGIN[] = "./RenderSystem_GL3Plus";
#ifdef _WIN32
#ifdef _DEBUG
const char D3D11_RENDER_PLUGIN[] = "./RenderSystem_Direct3D11_d";
const char Ogre_glTF_PluginPath[] = "./Debug/Ogre_glTF";
const char Ogre_glTF_PluginPath[] = "./Debug/Ogre_glTF_d";
#else
const char D3D11_RENDER_PLUGIN[] = "./RenderSystem_Direct3D11";
const char Ogre_glTF_PluginPath[] = "./Release/Ogre_glTF";
Expand Down

0 comments on commit 3d32713

Please sign in to comment.