diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-25 17:36:47 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-25 17:36:47 +0000 |
commit | 60b18508e094dc4721a3e6090ff86f2e992d2984 (patch) | |
tree | 3f4032df12a9deee82476d8904cfeb8b224ae0d3 | |
parent | 8fc031fb84e7e266fbdf476b59d97f529c28dc36 (diff) |
Fix problem with CMake under Windows, spotted by therock247uk on the forums, CMake now checks for the environment variable VCINSTALLDIR (only set in the Visual Studio command prompt) and also fixes the check for #ifndef.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2207 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Anope.cmake | 26 | ||||
-rw-r--r-- | src/modules/CMakeLists.txt | 8 |
2 files changed, 17 insertions, 17 deletions
diff --git a/Anope.cmake b/Anope.cmake index ef65641be..6a2f0d6a7 100644 --- a/Anope.cmake +++ b/Anope.cmake @@ -316,21 +316,21 @@ macro(find_includes SRC INCLUDES) set(LAST_DEF ${DEFINE}) set(LAST_CHECK FALSE) # If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped - if(NOT ${DEFINE}) - set(VALID_LINE TRUE) - else(NOT ${DEFINE}) - set(VALUE_LINE FALSE) - endif(NOT ${DEFINE}) + if(${DEFINE}) + set(VALID_LINE FALSE) + else(${DEFINE}) + set(VALUE_LINE TRUE) + endif(${DEFINE}) else(FOUND_IFNDEF) # If we found a #else on the line, we check the last define in the opposite direction if(FOUND_ELSE) # When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check if(LAST_CHECK) - if(NOT ${LAST_DEF}) - set(VALID_LINE TRUE) - else(NOT ${LAST_DEF}) + if(${LAST_DEF}) set(VALID_LINE FALSE) - endif(NOT ${LAST_DEF}) + else(${LAST_DEF}) + set(VALID_LINE TRUE) + endif(${LAST_DEF}) # When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check else(LAST_CHECK) if(${LAST_DEF}) @@ -386,11 +386,11 @@ macro(calculate_depends SRC) # The following checks will only be done if there was a request for angle includes to be checked if(CHECK_ANGLE_INCLUDES) # Find the path of the include file - if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH) - find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include) - else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH) + if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) + find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include) + else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME}) - endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH) + endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) # If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler if(FOUND_${FILENAME}_INCLUDE) find_in_list(DEFAULT_INCLUDE_DIRS "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_DEFAULTS) diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index 21b35c0b3..7a62f9970 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -46,11 +46,11 @@ foreach(SRC ${MODULES_SRCS}) # Iterate through the libraries given foreach(LIBRARY ${REQUIRED_LIBRARY}) # Locate the library to see if it exists - if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH) - find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib) - else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH) + 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) + else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR}) find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY}) - endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH) + 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) # Get the path only of the library, to add it to linker flags |