diff options
-rw-r--r-- | Modules/CMakeCSharpInformation.cmake | 22 | ||||
-rw-r--r-- | Modules/FindDevIL.cmake | 4 | ||||
-rw-r--r-- | Modules/FindOpenSSL.cmake | 4 | ||||
-rw-r--r-- | Source/cmFileCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmSourceGroupCommand.cxx | 32 | ||||
-rw-r--r-- | Tests/SourceGroups/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/SourceGroups/main.c | 9 | ||||
-rw-r--r-- | Tests/SourceGroups/tree_foo.c | 4 | ||||
-rw-r--r-- | Tests/SourceGroups/tree_prefix_bar.c | 4 | ||||
-rw-r--r-- | Tests/SourceGroups/tree_prefix_foo.c | 4 | ||||
-rwxr-xr-x | bootstrap | 1 |
11 files changed, 60 insertions, 37 deletions
diff --git a/Modules/CMakeCSharpInformation.cmake b/Modules/CMakeCSharpInformation.cmake index dc775bd..cd86016 100644 --- a/Modules/CMakeCSharpInformation.cmake +++ b/Modules/CMakeCSharpInformation.cmake @@ -68,38 +68,38 @@ if(CMAKE_CSharp_STANDARD_LIBRARIES_INIT) mark_as_advanced(CMAKE_CSharp_STANDARD_LIBRARIES) endif() -# set missing flags (if they do not exist). This is needed in the +# set missing flags (if they are not defined). This is needed in the # unlikely case that you have only C# and no C/C++ targets in your # project. -if(NOT EXISTS CMAKE_SHARED_LINKER_FLAGS) +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS) set(CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_SHARED_LINKER_FLAGS_DEBUG) +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_DEBUG) set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_SHARED_LINKER_FLAGS_RELEASE) +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELEASE) set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL) +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL) set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO) +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO) set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_EXE_LINKER_FLAGS) +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS) set(CMAKE_EXE_LINKER_FLAGS "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_EXE_LINKER_FLAGS_DEBUG) +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_DEBUG) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_EXE_LINKER_FLAGS_RELEASE) +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELEASE) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_EXE_LINKER_FLAGS_MINSIZEREL) +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_MINSIZEREL) set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "" CACHE STRING "" FORCE) endif() -if(NOT EXISTS CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO) +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO) set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE) endif() diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake index 45fab82..7d43482 100644 --- a/Modules/FindDevIL.cmake +++ b/Modules/FindDevIL.cmake @@ -25,7 +25,7 @@ # library interfaces with OpenGL. It is not strictly needed # in applications. # IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files. -# IL_FOUND - this is set to TRUE if all the above variables were set. +# DevIL_FOUND - this is set to TRUE if all the above variables were set. # This will be set to false if ILU or ILUT are not found, # even if they are not needed. In most systems, if one # library is found all the others are as well. That's the @@ -70,3 +70,5 @@ find_library(ILU_LIBRARIES FIND_PACKAGE_HANDLE_STANDARD_ARGS(DevIL DEFAULT_MSG IL_LIBRARIES ILU_LIBRARIES IL_INCLUDE_DIR) +# provide legacy variable for compatiblity +set(IL_FOUND ${DevIL_FOUND}) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 609bc17..f7e9637 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -375,7 +375,7 @@ set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) if (OPENSSL_VERSION) find_package_handle_standard_args(OpenSSL REQUIRED_VARS - OPENSSL_SSL_LIBRARY + #OPENSSL_SSL_LIBRARY # FIXME: require based on a component request? OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR VERSION_VAR @@ -385,7 +385,7 @@ if (OPENSSL_VERSION) ) else () find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" - OPENSSL_SSL_LIBRARY + #OPENSSL_SSL_LIBRARY # FIXME: require based on a component request? OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR ) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 91cecb3..dc97e37 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -42,6 +42,10 @@ #include "cmFileLockResult.h" #endif +#if defined(_WIN32) +#include <windows.h> +#endif + class cmSystemToolsFileTime; // Table of permissions flags. diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 23048bf..d722954 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceGroupCommand.h" -#include <algorithm> -#include <iterator> #include <set> #include <sstream> @@ -15,7 +13,7 @@ namespace { const size_t RootIndex = 1; const size_t FilesWithoutPrefixKeywordIndex = 2; const size_t FilesWithPrefixKeywordIndex = 4; -const size_t PrefixKeywordIdex = 2; +const size_t PrefixKeywordIndex = 2; std::vector<std::string> tokenizePath(const std::string& path) { @@ -79,17 +77,26 @@ cmSourceGroup* addSourceGroup(const std::vector<std::string>& tokenizedPath, return sg; } -std::string prepareFilePathForTree(const std::string& path) +std::string prepareFilePathForTree(const std::string& path, + const std::string& currentSourceDir) { + if (!cmSystemTools::FileIsFullPath(path)) { + return cmSystemTools::CollapseFullPath(currentSourceDir + "/" + path); + } return cmSystemTools::CollapseFullPath(path); } std::vector<std::string> prepareFilesPathsForTree( std::vector<std::string>::const_iterator begin, - std::vector<std::string>::const_iterator end) + std::vector<std::string>::const_iterator end, + const std::string& currentSourceDir) { - std::vector<std::string> prepared(std::distance(begin, end)); - std::transform(begin, end, prepared.begin(), prepareFilePathForTree); + std::vector<std::string> prepared; + + for (; begin != end; ++begin) { + prepared.push_back(prepareFilePathForTree(*begin, currentSourceDir)); + } + return prepared; } @@ -228,13 +235,13 @@ bool cmSourceGroupCommand::checkTreeArgumentsPreconditions( } if (args[FilesWithoutPrefixKeywordIndex] != "FILES" && - args[PrefixKeywordIdex] != "PREFIX") { + args[PrefixKeywordIndex] != "PREFIX") { errorMsg = "Unknown argument \"" + args[2] + "\". Perhaps the FILES keyword is missing.\n"; return false; } - if (args[PrefixKeywordIdex] == "PREFIX" && + if (args[PrefixKeywordIndex] == "PREFIX" && (args.size() < 5 || args[FilesWithPrefixKeywordIndex] != "FILES")) { errorMsg = "Missing FILES arguments."; return false; @@ -253,13 +260,14 @@ bool cmSourceGroupCommand::processTree(const std::vector<std::string>& args, const std::string root = cmSystemTools::CollapseFullPath(args[RootIndex]); std::string prefix; size_t filesBegin = FilesWithoutPrefixKeywordIndex + 1; - if (args[PrefixKeywordIdex] == "PREFIX") { - prefix = args[PrefixKeywordIdex + 1]; + if (args[PrefixKeywordIndex] == "PREFIX") { + prefix = args[PrefixKeywordIndex + 1]; filesBegin = FilesWithPrefixKeywordIndex + 1; } const std::vector<std::string> filesVector = - prepareFilesPathsForTree(args.begin() + filesBegin, args.end()); + prepareFilesPathsForTree(args.begin() + filesBegin, args.end(), + this->Makefile->GetCurrentSourceDirectory()); if (!rootIsPrefix(root, filesVector, errorMsg)) { return false; diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt index 9289e84..4e4a030 100644 --- a/Tests/SourceGroups/CMakeLists.txt +++ b/Tests/SourceGroups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.8) project(SourceGroups) # this is not really a test which can fail @@ -33,10 +33,11 @@ source_group(EmptyGroup) set(root ${CMAKE_CURRENT_SOURCE_DIR}) set(tree_files_without_prefix ${root}/sub1/tree_bar.c - ${root}/sub1/tree_baz.c - ${root}/sub1/tree_subdir/tree_foobar.c) + sub1/tree_baz.c + sub1/../sub1/tree_subdir/tree_foobar.c) -set(tree_files_with_prefix ${root}/tree_foo.c) +set(tree_files_with_prefix ${root}/tree_prefix_foo.c + tree_prefix_bar.c) source_group(TREE ${root} FILES ${tree_files_without_prefix}) diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c index b88f2f8..4d84cf2 100644 --- a/Tests/SourceGroups/main.c +++ b/Tests/SourceGroups/main.c @@ -5,7 +5,8 @@ extern int bar(void); extern int foobar(void); extern int barbar(void); extern int baz(void); -extern int tree_foo(void); +extern int tree_prefix_foo(void); +extern int tree_prefix_bar(void); extern int tree_bar(void); extern int tree_foobar(void); extern int tree_baz(void); @@ -15,7 +16,9 @@ int main() printf("foo: %d bar: %d foobar: %d barbar: %d baz: %d\n", foo(), bar(), foobar(), barbar(), baz()); - printf("tree_foo: %d tree_bar: %d tree_foobar: %d tree_baz: %d\n", - tree_foo(), tree_bar(), tree_foobar(), tree_baz()); + printf("tree_prefix_foo: %d tree_prefix_bar: %d tree_bar: %d tree_foobar: " + "%d tree_baz: %d\n", + tree_prefix_foo(), tree_prefix_bar(), tree_bar(), tree_foobar(), + tree_baz()); return 0; } diff --git a/Tests/SourceGroups/tree_foo.c b/Tests/SourceGroups/tree_foo.c deleted file mode 100644 index d392e41..0000000 --- a/Tests/SourceGroups/tree_foo.c +++ /dev/null @@ -1,4 +0,0 @@ -int tree_foo(void) -{ - return 6; -} diff --git a/Tests/SourceGroups/tree_prefix_bar.c b/Tests/SourceGroups/tree_prefix_bar.c new file mode 100644 index 0000000..bd98476 --- /dev/null +++ b/Tests/SourceGroups/tree_prefix_bar.c @@ -0,0 +1,4 @@ +int tree_prefix_bar(void) +{ + return 66; +} diff --git a/Tests/SourceGroups/tree_prefix_foo.c b/Tests/SourceGroups/tree_prefix_foo.c new file mode 100644 index 0000000..92c2fd7 --- /dev/null +++ b/Tests/SourceGroups/tree_prefix_foo.c @@ -0,0 +1,4 @@ +int tree_prefix_foo(void) +{ + return 6; +} @@ -1419,6 +1419,7 @@ fi cmake_c_flags_String="-DKWSYS_STRING_C" if ${cmake_system_mingw}; then cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP" + cmake_cxx_flags_EncodingCXX="${cmake_c_flags_EncodingC}" cmake_cxx_flags_cmProcessOutput="${cmake_c_flags_EncodingC}" fi cmake_cxx_flags_SystemTools=" |