Skip to content
Browse files

cmake: fix defines always being defined

PLUGINDIR, DATADIR, and SYSCONFDIR were always defined by cmake even when not wanted.
let config.h handle these and only when they have a value
  • Loading branch information...
1 parent b4034ef commit 4869ebfb3db1877dc6c86b6edc52d8375bc4a941 @bradallred bradallred committed Jun 9, 2013
Showing with 7 additions and 8 deletions.
  1. +3 −3 cmake/cmake_config.h.in
  2. +0 −5 gemrb/core/CMakeLists.txt
  3. +4 −0 gemrb/core/InterfaceConfig.cpp
View
6 cmake/cmake_config.h.in
@@ -5,9 +5,9 @@
#cmakedefine HAVE_STRNDUP 1
#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_FORBIDDEN_OBJECT_TO_FUNCTION_CAST 1
-#define PLUGINDIR "${PLUGIN_DIR}"
-#define DATADIR "${DATA_DIR}"
-#define SYSCONFDIR "${SYSCONF_DIR}"
+#cmakedefine PLUGINDIR "${PLUGIN_DIR}"
+#cmakedefine DATADIR "${DATA_DIR}"
+#cmakedefine SYSCONFDIR "${SYSCONF_DIR}"
#cmakedefine NOCOLOR ${NOCOLOR}
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_UNISTD_H 1
View
5 gemrb/core/CMakeLists.txt
@@ -151,11 +151,6 @@ else (STATIC_LINK)
ENDIF(WIN32)
endif (STATIC_LINK)
-SET_TARGET_PROPERTIES(gemrb_core PROPERTIES
- COMPILE_DEFINITIONS
- "PLUGINDIR=\"${PLUGIN_DIR}\";DATADIR=\"${DATA_DIR}\";SYSCONFDIR=\"${SYSCONF_DIR}\""
- )
-
IF (APPLE)
SET_TARGET_PROPERTIES(gemrb_core PROPERTIES
INSTALL_NAME_DIR ${LIB_DIR})
View
4 gemrb/core/InterfaceConfig.cpp
@@ -18,6 +18,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "globals.h"
#include "InterfaceConfig.h"

0 comments on commit 4869ebf

Please sign in to comment.
Something went wrong with that request. Please try again.