diff options
-rw-r--r-- | Modules/CPackRPM.cmake | 12 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 9 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 2 | ||||
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 16 | ||||
-rw-r--r-- | Source/cmProjectCommand.h | 8 | ||||
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/CMakeLists.txt | 33 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp | 7 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h | 4 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/iface_test.cpp | 11 | ||||
-rw-r--r-- | Tests/TryCompile/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Tests/TryCompile/testdef.c | 4 |
14 files changed, 125 insertions, 11 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 52fdc91..bf5b5bc 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -637,7 +637,7 @@ if(CPACK_RPM_CHANGELOG_FILE) message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring") endif() else() - set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)") + set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Eric Noulard <eric.noulard@gmail.com> - ${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n Generated by CPack RPM (no Changelog file were provided)") endif() # CPACK_RPM_SPEC_MORE_DEFINE @@ -876,6 +876,13 @@ if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") endif() +# protect @ in pathname in order to avoid their +# interpretation during the configure_file step +set(CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES}") +set(PROTECTED_AT "@") +string(REPLACE "@" "\@PROTECTED_AT\@" CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES_LIST}") +set(CPACK_RPM_INSTALL_FILES_LIST "") + # # USER generated/provided spec file handling. # @@ -982,6 +989,9 @@ else() configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY) endif() +# remove AT protection +unset(PROTECTED_AT) + if(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE execute_process( diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 6afdb97..3acb4f9 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -114,6 +114,15 @@ # and <TMP_DIR> # with corresponding property values. # +# Any builtin step that specifies a "<step>_COMMAND cmd..." or custom +# step that specifies a "COMMAND cmd..." may specify additional command +# lines using the form "COMMAND cmd...". At build time the commands will +# be executed in order and aborted if any one fails. For example: +# ... BUILD_COMMAND make COMMAND echo done ... +# specifies to run "make" and then "echo done" during the build step. +# Whether the current working directory is preserved between commands +# is not defined. Behavior of shell operators like "&&" is not defined. +# # The 'ExternalProject_Get_Property' function retrieves external project # target properties: # ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4ae8f3e..80d424e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130708) +set(CMake_VERSION_TWEAK 20130715) #set(CMake_VERSION_RC 1) diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 8fd95b9..0829add 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -282,6 +282,8 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index, if(emitted.insert(*lib).second) { this->AddTargetDepend(depender_index, lib->c_str(), true); + this->AddInterfaceDepends(depender_index, lib->c_str(), + true, emitted); } } } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 860417f..e312806 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -12,6 +12,7 @@ #include "cmCoreTryCompile.h" #include "cmake.h" #include "cmCacheManager.h" +#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmExportTryCompileFileGenerator.h" #include <cmsys/Directory.hxx> @@ -214,8 +215,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) } // Detect languages to enable. - cmGlobalGenerator* gg = - this->Makefile->GetCMakeInstance()->GetGlobalGenerator(); + cmLocalGenerator* lg = this->Makefile->GetLocalGenerator(); + cmGlobalGenerator* gg = lg->GetGlobalGenerator(); std::set<std::string> testLangs; for(std::vector<std::string>::iterator si = sources.begin(); si != sources.end(); ++si) @@ -295,13 +296,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) for(std::set<std::string>::iterator li = testLangs.begin(); li != testLangs.end(); ++li) { - fprintf(fout, "SET(CMAKE_%s_FLAGS \"", li->c_str()); std::string langFlags = "CMAKE_" + *li + "_FLAGS"; - if(const char* flags = this->Makefile->GetDefinition(langFlags.c_str())) - { - fprintf(fout, " %s ", flags); - } - fprintf(fout, " ${COMPILE_DEFINITIONS}\")\n"); + const char* flags = this->Makefile->GetDefinition(langFlags.c_str()); + fprintf(fout, "SET(CMAKE_%s_FLAGS %s)\n", li->c_str(), + lg->EscapeForCMake(flags?flags:"").c_str()); + fprintf(fout, "SET(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}" + " ${COMPILE_DEFINITIONS}\")\n", li->c_str(), li->c_str()); } fprintf(fout, "INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n"); fprintf(fout, "SET(CMAKE_SUPPRESS_REGENERATION 1)\n"); diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index a53cb3f..9547c4c 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -71,7 +71,13 @@ public: "language \"NONE\" all checks for any language can be disabled. " "If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE, " "the file pointed to by that variable will be included as the last step " - "of the project command."; + "of the project command." + "\n" + "The top-level CMakeLists.txt file for a project must contain a " + "literal, direct call to the project() command; loading one through " + "the include() command is not sufficient. " + "If no such call exists CMake will implicitly add one to the top that " + "enables the default languages (C and CXX)."; } cmTypeMacro(cmProjectCommand, cmCommand); diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index efecd03..73a4b9b 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -184,6 +184,9 @@ set_property(TARGET testSharedLibRequired APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibRequired>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>" ) +set_property(TARGET testSharedLibRequired APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS USING_TESTSHAREDLIBREQUIRED +) set_property(TARGET testSharedLibRequired APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL CUSTOM_PROP diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 3bfbc46..0aa47e8 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -218,3 +218,36 @@ target_compile_definitions(deps_shared_iface2 $<$<BOOL:$<TARGET_PROPERTY:CUSTOM_PROP>>:CUSTOM_PROPERTY_IS_ON> $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH> ) + +add_subdirectory(excludedFromAll) + +add_executable(iface_test_bld iface_test.cpp) +target_link_libraries(iface_test_bld bld_testSharedLibDepends) + +set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY + LINK_INTERFACE_LIBRARIES + excludedFromAll +) +get_target_property(_configs bld_testSharedLibRequired IMPORTED_CONFIGURATIONS) +foreach(_config ${_configs}) + set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY + IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} + excludedFromAll + ) +endforeach() +unset(_configs) +add_executable(iface_test_exp iface_test.cpp) +target_link_libraries(iface_test_exp testSharedLibDepends) + +set_property(TARGET testSharedLibDepends APPEND PROPERTY + LINK_INTERFACE_LIBRARIES + excludedFromAll +) +get_target_property(_configs testSharedLibDepends IMPORTED_CONFIGURATIONS) +foreach(_config ${_configs}) + set_property(TARGET testSharedLibDepends APPEND PROPERTY + IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} + excludedFromAll + ) +endforeach() +unset(_configs) diff --git a/Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt b/Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt new file mode 100644 index 0000000..cd5a59b --- /dev/null +++ b/Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +include(GenerateExportHeader) +add_library(excludedFromAll SHARED EXCLUDE_FROM_ALL excludedFromAll.cpp) +generate_export_header(excludedFromAll) diff --git a/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp new file mode 100644 index 0000000..2269a04 --- /dev/null +++ b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp @@ -0,0 +1,7 @@ + +#include "excludedFromAll.h" + +int excludedFromAll() +{ + return 0; +} diff --git a/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h new file mode 100644 index 0000000..4820c76 --- /dev/null +++ b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h @@ -0,0 +1,4 @@ + +#include "excludedfromall_export.h" + +int EXCLUDEDFROMALL_EXPORT excludedFromAll(); diff --git a/Tests/ExportImport/Import/A/iface_test.cpp b/Tests/ExportImport/Import/A/iface_test.cpp new file mode 100644 index 0000000..fa4474b --- /dev/null +++ b/Tests/ExportImport/Import/A/iface_test.cpp @@ -0,0 +1,11 @@ + +#ifndef USING_TESTSHAREDLIBREQUIRED +#error Expected USING_TESTSHAREDLIBREQUIRED +#endif + +#include "excludedFromAll.h" + +int main(void) +{ + return excludedFromAll(); +} diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 4540fd0..7b25e84 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -89,6 +89,24 @@ if(SHOULD_FAIL) message(SEND_ERROR "Should fail passed ${TRY_OUT}") endif() +# try to compile a file that should compile +set(_c_flags "${CMAKE_C_FLAGS}") +if(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D \"TESTDEF\"") +elseif(WATCOM) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -dTESTDEF") +else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \"-DTESTDEF\"") +endif() +try_compile(SHOULD_PASS + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + ${TryCompile_SOURCE_DIR}/testdef.c + OUTPUT_VARIABLE TRY_OUT) +if(NOT SHOULD_PASS) + message(SEND_ERROR "should pass failed ${TRY_OUT}") +endif() +set(CMAKE_C_FLAGS "${_c_flags}") + if(NOT SHOULD_FAIL) if(SHOULD_PASS) message("All Tests passed, ignore all previous output.") diff --git a/Tests/TryCompile/testdef.c b/Tests/TryCompile/testdef.c new file mode 100644 index 0000000..5401e71 --- /dev/null +++ b/Tests/TryCompile/testdef.c @@ -0,0 +1,4 @@ +#ifndef TESTDEF +# error "TESTDEF should be defined!" +#endif +int main(void) { return 0; } |