Update CMakeLists.txt

This commit includes checking whether ../data directory (from build directory) and ../../stk-assets directory (from build directory) exists or not. If they don't exist, then it gives error message for the corresponding directory. I have included the code for this on line 320.
This commit is contained in:
abhishek1995
2014-03-06 20:51:09 +05:30
parent 0208dbaf8a
commit 62869dc92f

View File

@@ -312,6 +312,18 @@ install(FILES ${PROJECT_BINARY_DIR}/supertuxkart.desktop DESTINATION share/appli
install(FILES data/supertuxkart_32.png data/supertuxkart_128.png DESTINATION share/pixmaps)
install(FILES data/supertuxkart.appdata DESTINATION share/appdata)
# ==== Checking if data folder exists ====
if(NOT IS_DIRECTORY data)
message( FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/data folder doesn't exist" )
endif()
# ==== Checking if stk-assets folder exists ====
if(NOT IS_DIRECTORY ../stk-assets)
set (CUR_DIR ${CMAKE_CURRENT_SOURCE_DIR})
get_filename_component(PARENT_DIR ${CUR_DIR} PATH)
message( FATAL_ERROR "${PARENT_DIR}/stk-assets folder doesn't exist" )
endif()
set(PREFIX ${CMAKE_INSTALL_PREFIX})
configure_file(data/supertuxkart_desktop.template supertuxkart.desktop)
add_dependencies(supertuxkart supertuxkart.desktop)