From b80f7241c1614e67d49aa41a93949cc2988754af Mon Sep 17 00:00:00 2001 From: florianf Date: Sat, 30 Jan 2010 11:08:04 +0000 Subject: [PATCH] Bug 557: config.h misses INSTALL_SUBDIR_* variables on first cmake run The first time cmake runs in a new supertux build tree, config.h is generated before the INSTALL_SUBDIR_{BIN,SHARE} variables are set and thus contains empty values for these variables. If the executable is built right away and run, it crashes because it cannot find the data files. Resolves #557. Thanks to Matt McCutchen for this patch. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6293 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e80830561..522488c4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,11 +147,6 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/src/addon/addon_manager. INCLUDE(ConfigureChecks) -## Create config.h and version.h - -configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h ) -include_directories (${CMAKE_BINARY_DIR}/) - ## Also execute instructions in src/squirrel/CMakeLists.txt ADD_SUBDIRECTORY(external/squirrel) @@ -162,6 +157,7 @@ LINK_DIRECTORIES(external/squirrel) ## Some additional include paths +include_directories (${CMAKE_BINARY_DIR}/) include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src/) include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/include/) include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/) @@ -410,6 +406,10 @@ INSTALL(DIRECTORY data/images data/locale DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +## Create config.h now that INSTALL_SUBDIR_* have been set. + +configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h ) + ## CPack/Installation-specific stuff -- 2.11.0