Add support for make install

master
rubenwardy 2014-06-18 20:19:53 +01:00
parent 90716ae22b
commit c2e06c3205
4 changed files with 40 additions and 3 deletions

2
.gitignore vendored
View File

@ -8,6 +8,8 @@ Makefile
# Configuration/generated
editor.conf
common.hpp
install_manifest.txt
#################
## Eclipse

34
CMakeLists.txt Executable file → Normal file
View File

@ -1,8 +1,25 @@
# Set up project
cmake_minimum_required(VERSION 2.6)
project(NodeBoxGenerator)
project(NodeBoxEditor)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
# Configuration
option (RUN_IN_PLACE
"Whether editor should run in place (see readme.md)" ON)
IF (RUN_IN_PLACE)
set (BOOL_RUN_IN_PLACE true)
ELSE (RUN_IN_PLACE)
set (BOOL_RUN_IN_PLACE false)
ENDIF (RUN_IN_PLACE)
set(NBE_MAJOR_VERSION 0)
set(NBE_MINOR_VERSION 6)
set(NBE_PATCH_VERSION 4)
set(NBE_DESCR_VERSION "\"0.6.4 - Stone\"")
configure_file (
src/common.hpp.in
src/common.hpp
)
# Dependancies
find_package(Irrlicht REQUIRED)
find_package(ZLIB REQUIRED)
@ -66,9 +83,22 @@ set_target_properties(${PROJECT_NAME}
)
# Install DLLs
if (NOT RUN_IN_PLACE)
install (FILES media/fontlucida.png DESTINATION nbe/media)
install (FILES media/gui_scale.png DESTINATION nbe/media)
install (FILES media/icon_mode_node.png DESTINATION nbe/media)
install (FILES media/icon_mode_nodebox.png DESTINATION nbe/media)
install (FILES media/sky.jpg DESTINATION nbe/media)
install (FILES media/texture_box.png DESTINATION nbe/media)
install (FILES media/texture_terrain.png DESTINATION nbe/media)
install (FILES editor.conf.example DESTINATION nbe)
install (FILES README.md DESTINATION nbe)
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
endif (NOT RUN_IN_PLACE)
if(WIN32)
if(DEFINED IRRLICHT_DLL)
message(Installing irrlicht dll)
install(FILES ${IRRLICHT_DLL})
install(FILES ${IRRLICHT_DLL} DESTINATION bin)
endif()
endif()

View File

@ -26,7 +26,8 @@ enum FileParserType
};
// Defines
#define EDITOR_TEXT_VERSION "0.6.4 - Stone"
#define EDITOR_TEXT_VERSION @NBE_DESCR_VERSION@
#define RUN_IN_PLACE @BOOL_RUN_IN_PLACE@
#define EDITOR_VERSION 1
#define EDITOR_PARSER 1

View File

@ -27,6 +27,10 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
#if !RUN_IN_PLACE
system("cd ../nbe");
#endif
// Init Settings
conf->set("snapping", "true");
conf->set("limiting", "true");