Permalink
Browse files

Modified the Config scripts to ask the user explicitly for additional…

… include and library directories.
  • Loading branch information...
1 parent f711dd3 commit 9dec0936761055abc9f4650ce4bd60b19aa2b328 @CyberBotX CyberBotX committed Dec 7, 2012
Showing with 270 additions and 137 deletions.
  1. +8 −1 CMakeLists.txt
  2. +58 −7 Config
  3. BIN Config.exe
  4. +2 −2 cmake/Anope.cmake
  5. +202 −127 src/win32/Config.cs
View
@@ -209,12 +209,19 @@ else(CMAKE244_OR_BETTER)
include(TestCXXAcceptsFlag)
endif(CMAKE244_OR_BETTER)
-# If extra directories were specified, tell cmake about them.
+# If extra include directories were specified, tell cmake about them.
if(EXTRA_INCLUDE)
include_directories(${EXTRA_INCLUDE})
link_directories(${EXTRA_INCLUDE})
endif(EXTRA_INCLUDE)
+# If extra library directories were specified, tell cmake about them.
+if(EXTRA_LIBS)
+ foreach(LIB ${EXTRA_LIBS})
+ set(CXXFLAGS "${CXXFLAGS} -L${LIB}")
+ endforeach(LIB)
+endif(EXTRA_LIBS)
+
# Find gettext
find_package(Gettext)
View
@@ -40,7 +40,8 @@ Run_Build_System () {
WITH_INST=""
WITH_RUN=""
WITH_PERM=""
- RUN_CC_PL=""
+ EXTRA_INCLUDE=""
+ EXTRA_LIBS=""
GEN_TYPE=""
if [ "$INSTDIR" != "" ] ; then
@@ -73,6 +74,14 @@ Run_Build_System () {
PCH="-DUSE_PCH:BOOLEAN=OFF"
fi
+ if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
+ EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
+ fi
+
+ if [ "$EXTRA_LIB_DIRS" != "" ] ; then
+ EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
+ fi
+
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
@@ -88,9 +97,9 @@ Run_Build_System () {
REAL_SOURCE_DIR="$SOURCE_DIR"
fi
- echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
+ echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
- cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
+ cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
echo ""
if [ "$SOURCE_DIR" = "." ] ; then
@@ -124,6 +133,8 @@ UMASK=
DEBUG="yes"
USE_RUN_CC_PL="no"
USE_PCH="no"
+EXTRA_INCLUDE_DIRS=
+EXTRA_LIB_DIRS=
EXTRA_CONFIG_ARGS=
CAN_QUICK="no"
SOURCE_DIR=`dirname $0`
@@ -386,14 +397,52 @@ echo ""
####
-echo "Are there any extra arguments you wish to pass to cmake?"
-echo "You may only need to do this if cmake is unable to locate"
+echo "Are there any extra include directories you wish to use?"
+echo "You may only need to do this if CMake is unable to locate"
echo "missing dependencies without hints."
-echo "You can do this by: -DEXTRA_INCLUDE:STRING=/path/to/files;/path/to/more/files"
+echo "Separate directories with semicolons."
+echo "If you need no extra include directories, enter NONE in all caps."
+echo2 "[$EXTRA_INCLUDE_DIRS] "
+if read INPUT ; then : ; else echo "" ; exit 1 ; fi
+if [ "$INPUT" ] ; then
+ if [ "$INPUT" = "NONE" ] ; then
+ EXTRA_INCLUDE_DIRS=""
+ else
+ EXTRA_INCLUDE_DIRS=$INPUT
+ fi
+fi
+echo ""
+
+####
+
+echo "Are there any extra library directories you wish to use?"
+echo "You may only need to do this if CMake is unable to locate"
+echo "missing dependencies without hints."
+echo "Separate directories with semicolons."
+echo "If you need no extra library directories, enter NONE in all caps."
+echo2 "[$EXTRA_LIB_DIRS] "
+if read INPUT ; then : ; else echo "" ; exit 1 ; fi
+if [ "$INPUT" ] ; then
+ if [ "$INPUT" = "NONE" ] ; then
+ EXTRA_LIB_DIRS=""
+ else
+ EXTRA_LIB_DIRS=$INPUT
+ fi
+fi
+echo ""
+
+####
+
+echo "Are there any extra arguments you wish to pass to CMake?"
+echo "If you need no extra arugments to CMake, enter NONE in all caps."
echo2 "[$EXTRA_CONFIG_ARGS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
- EXTRA_CONFIG_ARGS=$INPUT
+ if [ "$INPUT" = "NONE" ] ; then
+ EXTRA_CONFIG_ARGS=""
+ else
+ EXTRA_CONFIG_ARGS=$INPUT
+ fi
fi
echo ""
@@ -412,6 +461,8 @@ UMASK=$UMASK
DEBUG="$DEBUG"
USE_RUN_CC_PL="$USE_RUN_CC_PL"
USE_PCH="$USE_PCH"
+EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
+EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
EOT
echo "done."
View
Binary file not shown.
View
@@ -447,9 +447,9 @@ macro(calculate_libraries SRC SKIP VERBOSE SRC_LDFLAGS EXTRA_DEPENDS)
foreach(LIBRARY ${REQUIRED_LIBRARY})
# Locate the library to see if it exists
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
- find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE})
+ find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
- find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE})
+ find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE} ${EXTRA_LIBS})
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
# If the library was found, we will add it to the linker flags
if(FOUND_${LIBRARY}_LIBRARY)
Oops, something went wrong.

0 comments on commit 9dec093

Please sign in to comment.