...
 
Commits (36)
......@@ -733,7 +733,7 @@ syn keyword cmakeVariable contained
\ CTEST_CUSTOM_POST_TEST
\ CTEST_CUSTOM_PRE_MEMCHECK
\ CTEST_CUSTOM_PRE_TEST
\ CTEST_CUSTOM_TEST_IGNORE
\ CTEST_CUSTOM_TESTS_IGNORE
\ CTEST_CUSTOM_WARNING_EXCEPTION
\ CTEST_CUSTOM_WARNING_MATCH
\ CTEST_CVS_CHECKOUT
......
......@@ -15,6 +15,8 @@ projects (Database, Website, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
......
......@@ -15,6 +15,8 @@ projects (JavaScript, Database, Website, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
......
......@@ -15,6 +15,8 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
......
......@@ -12,6 +12,8 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
......
......@@ -28,6 +28,8 @@ by default.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
......
......@@ -6,6 +6,8 @@ Generates Visual Studio 9 2008 project files.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
......
......@@ -22,8 +22,8 @@ These commands are always available.
/command/cmake_policy
/command/configure_file
/command/continue
/command/elseif
/command/else
/command/elseif
/command/endforeach
/command/endfunction
/command/endif
......@@ -53,9 +53,9 @@ These commands are always available.
/command/option
/command/return
/command/separate_arguments
/command/set
/command/set_directory_properties
/command/set_property
/command/set
/command/site_name
/command/string
/command/unset
......
......@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.14
.. toctree::
:maxdepth: 1
CMP0088: FindBISON runs bison in CMAKE_CURRENT_BINARY_DIR when executing. </policy/CMP0088>
CMP0087: install(SCRIPT | CODE) supports generator expressions. </policy/CMP0087>
CMP0086: UseSWIG honors SWIG_MODULE_NAME via -module flag. </policy/CMP0086>
CMP0085: IN_LIST generator expression handles empty list items. </policy/CMP0085>
......
......@@ -541,7 +541,7 @@ Variables for CTest
/variable/CTEST_CUSTOM_POST_TEST
/variable/CTEST_CUSTOM_PRE_MEMCHECK
/variable/CTEST_CUSTOM_PRE_TEST
/variable/CTEST_CUSTOM_TEST_IGNORE
/variable/CTEST_CUSTOM_TESTS_IGNORE
/variable/CTEST_CUSTOM_WARNING_EXCEPTION
/variable/CTEST_CUSTOM_WARNING_MATCH
/variable/CTEST_CVS_CHECKOUT
......
CMP0088
-------
:module:`FindBISON` runs bison in :variable:`CMAKE_CURRENT_BINARY_DIR`
when executing.
The module provides a ``BISON_TARGET`` macro which generates BISON output.
In CMake 3.13 and below the macro would generate a custom command that runs
``bison`` in the source directory. CMake 3.14 and later prefer to run it
in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR` as the
``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation.
This ensures that any implicitly generated file is written to the build
tree rather than the source.
This policy provides compatibility for projects that have not been updated
to expect the new behavior.
The ``OLD`` behavior for this policy is for ``BISON_TARGET`` to use
the current source directory for the ``WORKING_DIRECTORY`` and where
to generate implicit files. The ``NEW`` behavior of this policy is to
use the current binary directory for the ``WORKING_DIRECTORY`` and where
to generate implicit files.
This policy was introduced in CMake version 3.14. Use the
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
Unlike most policies, CMake version |release| does *not* warn
when this policy is not set and simply uses ``OLD`` behavior.
.. include:: DEPRECATED.txt
ANDROID_NATIVE_LIB_DIRECTORIES
------------------------------
Set the Android property that specifies directories to search for the
.so libraries.
Set the Android property that specifies directories to search for the ``.so``
libraries.
This a string property that contains the directory paths separated
by semicolons.
......
FindICE-more-exe
----------------
* The :module:`FindIce` module learned to find
``slice2confluence`` and ``slice2matlab``.
bison_target_policy
-------------------
* The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
See policy :policy:`CMP0088`.
CTEST_CUSTOM_TEST_IGNORE
------------------------
CTEST_CUSTOM_TESTS_IGNORE
-------------------------
A list of regular expressions to use to exclude tests during the
:command:`ctest_test` command.
......
......@@ -48,7 +48,7 @@ macro(__compiler_xl lang)
# files so that we export only the symbols actually provided by the sources.
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>"
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
)
endif()
endmacro()
......@@ -151,7 +151,15 @@ if(BISON_EXECUTABLE)
list(APPEND BISON_TARGET_cmdopt "--report-file=${BISON_TARGET_verbose_file}")
endif()
if(NOT IS_ABSOLUTE "${BISON_TARGET_verbose_file}")
set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_SOURCE_DIR}/${BISON_TARGET_verbose_file}")
cmake_policy(GET CMP0088 _BISON_CMP0088
PARENT_SCOPE # undocumented, do not use outside of CMake
)
if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_BINARY_DIR}/${BISON_TARGET_verbose_file}")
else()
set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_SOURCE_DIR}/${BISON_TARGET_verbose_file}")
endif()
unset(_BISON_CMP0088)
endif()
endmacro()
......@@ -159,6 +167,15 @@ if(BISON_EXECUTABLE)
# adds a custom command and sets
# BISON_TARGET_cmdopt, BISON_TARGET_extraoutputs
macro(BISON_TARGET_option_verbose Name BisonOutput filename)
cmake_policy(GET CMP0088 _BISON_CMP0088
PARENT_SCOPE # undocumented, do not use outside of CMake
)
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
unset(_BISON_CMP0088)
list(APPEND BISON_TARGET_cmdopt "--verbose")
list(APPEND BISON_TARGET_outputs
"${BISON_TARGET_verbose_file}")
......@@ -166,8 +183,9 @@ if(BISON_EXECUTABLE)
if(IS_ABSOLUTE "${filename}")
set(BISON_TARGET_verbose_extra_file "${filename}")
else()
set(BISON_TARGET_verbose_extra_file "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
set(BISON_TARGET_verbose_extra_file "${_BISON_WORKING_DIRECTORY}/${filename}")
endif()
add_custom_command(OUTPUT ${BISON_TARGET_verbose_extra_file}
COMMAND ${CMAKE_COMMAND} -E copy
"${BISON_TARGET_verbose_file}"
......@@ -176,10 +194,11 @@ if(BISON_EXECUTABLE)
DEPENDS
"${BISON_TARGET_verbose_file}"
COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY})
list(APPEND BISON_TARGET_extraoutputs
"${BISON_TARGET_verbose_extra_file}")
unset(BISON_TARGET_verbose_extra_file)
unset(_BISON_WORKING_DIRECTORY)
endif()
endmacro()
......@@ -234,12 +253,23 @@ if(BISON_EXECUTABLE)
list(APPEND BISON_TARGET_outputs "${BISON_TARGET_output_header}")
cmake_policy(GET CMP0088 _BISON_CMP0088
PARENT_SCOPE # undocumented, do not use outside of CMake
)
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
unset(_BISON_CMP0088)
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput}
VERBATIM
DEPENDS ${BisonInput}
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY})
unset(_BISON_WORKING_DIRECTORY)
# define target variables
set(BISON_${Name}_DEFINED TRUE)
......
......@@ -862,8 +862,22 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106900 AND Boost_VERSION VERSION_LESS 107000)
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
set(_Boost_COROUTINE_DEPENDENCIES context)
set(_Boost_FIBER_DEPENDENCIES context)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
if(NOT Boost_VERSION VERSION_LESS 106900)
if(NOT Boost_VERSION VERSION_LESS 107000)
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
set(_Boost_COROUTINE_DEPENDENCIES context)
set(_Boost_FIBER_DEPENDENCIES context)
......@@ -878,7 +892,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
endif()
if(NOT Boost_VERSION VERSION_LESS 107000)
if(NOT Boost_VERSION VERSION_LESS 107100)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif()
endif()
......@@ -1126,7 +1140,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.69.0" "1.69"
"1.70.0" "1.70" "1.69.0" "1.69"
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
......
......@@ -40,6 +40,7 @@ Where ``<C>`` is the name of an Ice component, for example
Ice slice programs are reported in::
Ice_SLICE2CONFLUENCE_EXECUTABLE - path to slice2confluence executable
Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
......@@ -47,6 +48,7 @@ Ice slice programs are reported in::
Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
Ice_SLICE2MATLAB_EXECUTABLE - path to slice2matlab executable
Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
......@@ -185,6 +187,7 @@ Other variables one may set to control this module are::
icestormmigrate)
set(_Ice_slice_programs
slice2confluence
slice2cpp
slice2cs
slice2freezej
......@@ -192,6 +195,7 @@ Other variables one may set to control this module are::
slice2html
slice2java
slice2js
slice2matlab
slice2objc
slice2php
slice2py
......
......@@ -29,9 +29,12 @@ caller can set
THREADS_PREFER_PTHREAD_FLAG
Please note that the compiler flag can only be used with the imported
The compiler flag can only be used with the imported
target. Use of both the imported target as well as this switch is highly
recommended for new code.
This module is not needed for C++11 and later if threading is done using
``std::thread`` from the standard library.
#]=======================================================================]
include (CheckLibraryExists)
......
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 13)
set(CMake_VERSION_PATCH 20190110)
set(CMake_VERSION_PATCH 20190114)
#set(CMake_VERSION_RC 1)
......@@ -90,8 +90,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
}
cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio8Generator(cm, name, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio8Generator(cm, name, platformInGeneratorName)
{
std::string vc10Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
......@@ -406,7 +407,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
return false;
}
} else if (this->SystemName == "Android") {
if (this->DefaultPlatformName != "Win32") {
if (this->PlatformInGeneratorName) {
std::ostringstream e;
e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR "
<< "specifies a platform too: '" << this->GetName() << "'";
......@@ -437,7 +438,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindows(cmMakefile*)
bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
{
if (this->DefaultPlatformName != "Win32") {
if (this->PlatformInGeneratorName) {
std::ostringstream e;
e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR "
<< "specifies a platform too: '" << this->GetName() << "'";
......
......@@ -14,8 +14,6 @@
class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator
{
public:
cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
......@@ -125,6 +123,9 @@ public:
cmIDEFlagTable const* GetNasmFlagTable() const;
protected:
cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
void Generate() override;
virtual bool InitializeSystem(cmMakefile* mf);
virtual bool InitializeWindows(cmMakefile* mf);
......@@ -168,6 +169,8 @@ protected:
private:
class Factory;
friend class Factory;
struct LongestSourcePath
{
LongestSourcePath()
......
......@@ -92,8 +92,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
}
cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio10Generator(cm, name, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio10Generator(cm, name, platformInGeneratorName)
{
std::string vc11Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
......
......@@ -20,13 +20,14 @@ class cmake;
class cmGlobalVisualStudio11Generator : public cmGlobalVisualStudio10Generator
{
public:
cmGlobalVisualStudio11Generator(cmake* cm, const std::string& name,
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
protected:
cmGlobalVisualStudio11Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
bool InitializeWindowsPhone(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
bool SelectWindowsPhoneToolset(std::string& toolset) const override;
......
......@@ -75,8 +75,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
}
cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio11Generator(cm, name, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio11Generator(cm, name, platformInGeneratorName)
{
std::string vc12Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
......
......@@ -18,13 +18,14 @@ class cmake;
class cmGlobalVisualStudio12Generator : public cmGlobalVisualStudio11Generator
{
public:
cmGlobalVisualStudio12Generator(cmake* cm, const std::string& name,
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
protected:
cmGlobalVisualStudio12Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
bool ProcessGeneratorToolsetField(std::string const& key,
std::string const& value) override;
......@@ -44,5 +45,6 @@ protected:
private:
class Factory;
friend class Factory;
};
#endif
......@@ -75,8 +75,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory()
}
cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio12Generator(cm, name, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio12Generator(cm, name, platformInGeneratorName)
{
std::string vc14Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
......
......@@ -18,13 +18,14 @@ class cmake;
class cmGlobalVisualStudio14Generator : public cmGlobalVisualStudio12Generator
{
public:
cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name,
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
protected:
cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
bool InitializeWindows(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
bool SelectWindowsStoreToolset(std::string& toolset) const override;
......@@ -47,5 +48,6 @@ protected:
private:
class Factory;
friend class Factory;
};
#endif
......@@ -76,8 +76,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio15Generator::NewFactory()
}
cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio14Generator(cm, name, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio14Generator(cm, name, platformInGeneratorName)
{
this->ExpressEdition = false;
this->DefaultPlatformToolset = "v141";
......
......@@ -18,8 +18,6 @@ class cmake;
class cmGlobalVisualStudio15Generator : public cmGlobalVisualStudio14Generator
{
public:
cmGlobalVisualStudio15Generator(cmake* cm, const std::string& name,
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
......@@ -32,6 +30,9 @@ public:
std::string GetAuxiliaryToolset() const override;
protected:
cmGlobalVisualStudio15Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
bool InitializeWindows(cmMakefile* mf) override;
bool SelectWindowsStoreToolset(std::string& toolset) const override;
......@@ -53,6 +54,7 @@ protected:
private:
class Factory;
friend class Factory;
mutable cmVSSetupAPIHelper vsSetupAPIHelper;
};
#endif
......@@ -41,19 +41,13 @@ static cmVS7FlagTable cmVS7ExtraFlagTable[] = {
};
cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
cmake* cm, const std::string& platformName)
: cmGlobalVisualStudioGenerator(cm)
cmake* cm, std::string const& platformInGeneratorName)
: cmGlobalVisualStudioGenerator(cm, platformInGeneratorName)
{
this->IntelProjectVersion = 0;
this->DevEnvCommandInitialized = false;
this->MasmEnabled = false;
this->NasmEnabled = false;
if (platformName.empty()) {
this->DefaultPlatformName = "Win32";
} else {
this->DefaultPlatformName = platformName;
}
this->ExtraFlagTable = cmVS7ExtraFlagTable;
}
......@@ -263,14 +257,6 @@ Json::Value cmGlobalVisualStudio7Generator::GetJson() const
}
#endif
std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const
{
if (!this->GeneratorPlatform.empty()) {
return this->GeneratorPlatform;
}
return this->DefaultPlatformName;
}
bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
cmMakefile* mf)
{
......@@ -279,18 +265,6 @@ bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf);
}
bool cmGlobalVisualStudio7Generator::SetGeneratorPlatform(std::string const& p,
cmMakefile* mf)
{
if (this->GetPlatformName() == "x64") {
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
} else if (this->GetPlatformName() == "Itanium") {
mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
}
mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str());
return this->cmGlobalVisualStudioGenerator::SetGeneratorPlatform(p, mf);
}
void cmGlobalVisualStudio7Generator::Generate()
{
// first do the superclass method
......
......@@ -18,13 +18,8 @@ struct cmIDEFlagTable;
class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
{
public:
cmGlobalVisualStudio7Generator(cmake* cm,
const std::string& platformName = "");
~cmGlobalVisualStudio7Generator();
///! Get the name for the platform.
std::string const& GetPlatformName() const;
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
......@@ -34,8 +29,6 @@ public:
bool SetSystemName(std::string const& s, cmMakefile* mf) override;
bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
/**
* Utilized by the generator factory to determine if this generator
* supports toolsets.
......@@ -110,6 +103,9 @@ public:
cmIDEFlagTable const* ExtraFlagTable;
protected:
cmGlobalVisualStudio7Generator(cmake* cm,
std::string const& platformInGeneratorName);
void Generate() override;
std::string const& GetDevEnvCommand();
......@@ -166,8 +162,6 @@ protected:
// Set during OutputSLNFile with the name of the current project.
// There is one SLN file per project.
std::string CurrentProject;
std::string GeneratorPlatform;
std::string DefaultPlatformName;
bool MasmEnabled;
bool NasmEnabled;
......
......@@ -12,8 +12,9 @@
#include "cmake.h"
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio71Generator(cm, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio71Generator(cm, platformInGeneratorName)
{
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
this->Name = name;
......@@ -60,7 +61,7 @@ void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p,
cmMakefile* mf)
{
if (this->DefaultPlatformName == "Win32") {
if (!this->PlatformInGeneratorName) {
this->GeneratorPlatform = p;
return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf);
} else {
......
......@@ -13,9 +13,6 @@
class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
{
public:
cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name,
const std::string& platformName);
///! Get the name for the generator.
std::string GetName() const override { return this->Name; }
......@@ -45,6 +42,9 @@ public:
}
protected:
cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
void AddExtraIDETargets() override;
std::string FindDevEnvCommand() override;
......
......@@ -83,8 +83,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
}
cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
cmake* cm, const std::string& name, const std::string& platformName)
: cmGlobalVisualStudio8Generator(cm, name, platformName)
cmake* cm, const std::string& name,
std::string const& platformInGeneratorName)
: cmGlobalVisualStudio8Generator(cm, name, platformInGeneratorName)
{
this->Version = VS9;
std::string vc9Express;
......
......@@ -13,8 +13,6 @@
class cmGlobalVisualStudio9Generator : public cmGlobalVisualStudio8Generator
{
public:
cmGlobalVisualStudio9Generator(cmake* cm, const std::string& name,
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
/**
......@@ -30,6 +28,10 @@ public:
*/
std::string GetUserMacrosRegKeyBase() override;
protected:
cmGlobalVisualStudio9Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
private:
class Factory;
friend class Factory;
......
......@@ -20,12 +20,20 @@
#include "cmState.h"
#include "cmTarget.h"
cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(cmake* cm)
cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(
cmake* cm, std::string const& platformInGeneratorName)
: cmGlobalGenerator(cm)
{
cm->GetState()->SetIsGeneratorMultiConfig(true);
cm->GetState()->SetWindowsShell(true);
cm->GetState()->SetWindowsVSIDE(true);
if (platformInGeneratorName.empty()) {
this->DefaultPlatformName = "Win32";
} else {
this->DefaultPlatformName = platformInGeneratorName;
this->PlatformInGeneratorName = true;
}
}
cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator()
......@@ -43,6 +51,26 @@ void cmGlobalVisualStudioGenerator::SetVersion(VSVersion v)
this->Version = v;
}
bool cmGlobalVisualStudioGenerator::SetGeneratorPlatform(std::string const& p,
cmMakefile* mf)
{
if (this->GetPlatformName() == "x64") {
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
} else if (this->GetPlatformName() == "Itanium") {
mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
}
mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str());
return this->cmGlobalGenerator::SetGeneratorPlatform(p, mf);
}
std::string const& cmGlobalVisualStudioGenerator::GetPlatformName() const
{
if (!this->GeneratorPlatform.empty()) {
return this->GeneratorPlatform;
}
return this->DefaultPlatformName;
}
const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const
{
switch (this->Version) {
......
......@@ -41,7 +41,6 @@ public:
VS15 = 150
};
cmGlobalVisualStudioGenerator(cmake* cm);
virtual ~cmGlobalVisualStudioGenerator();
VSVersion GetVersion() const;
......@@ -50,6 +49,14 @@ public:
/** Is the installed VS an Express edition? */
bool IsExpressEdition() const { return this->ExpressEdition; }
bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
/**
* Get the name of the target platform (architecture) for which we generate.
* The names are as defined by VS, e.g. "Win32", "x64", "Itanium", "ARM".
*/
std::string const& GetPlatformName() const;
/**
* Configure CMake's Visual Studio macros file into the user's Visual
* Studio macros directory.
......@@ -133,6 +140,9 @@ public:
bool dryRun) override;
protected:
cmGlobalVisualStudioGenerator(cmake* cm,
std::string const& platformInGeneratorName);
void AddExtraIDETargets() override;
// Does this VS version link targets to each other if there are
......@@ -166,6 +176,10 @@ protected:
VSVersion Version;
bool ExpressEdition;
std::string GeneratorPlatform;
std::string DefaultPlatformName;
bool PlatformInGeneratorName = false;
private:
virtual std::string GetVSMakeProgram() = 0;
void PrintCompilerAdvice(std::ostream&, std::string const&,
......
......@@ -258,6 +258,9 @@ class cmMakefile;
SELECT(POLICY, CMP0087, \
"Install CODE|SCRIPT allow the use of generator " \
"expressions.", \
3, 14, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0088, \
"FindBISON runs bison in CMAKE_CURRENT_BINARY_DIR when executing.", \
3, 14, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
......
......@@ -13,6 +13,7 @@
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
#include <memory>
#include <utility>
......@@ -86,10 +87,43 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
bool const validQt = (qtVersion.Major == 4) ||
(qtVersion.Major == 5) || (qtVersion.Major == 6);
bool const mocIsValid = moc && (validQt || !mocExec.empty());
bool const uicIsValid = uic && (validQt || !uicExec.empty());
bool const rccIsValid = rcc && (validQt || !rccExec.empty());
bool const mocAvailable = (validQt || !mocExec.empty());
bool const uicAvailable = (validQt || !uicExec.empty());
bool const rccAvailable = (validQt || !rccExec.empty());
bool const mocIsValid = (moc && mocAvailable);
bool const uicIsValid = (uic && uicAvailable);
bool const rccIsValid = (rcc && uicAvailable);
// Disabled AUTOMOC/UIC/RCC warning
bool const mocDisabled = (moc && !mocAvailable);
bool const uicDisabled = (uic && !uicAvailable);
bool const rccDisabled = (rcc && !rccAvailable);
if (mocDisabled || uicDisabled || rccDisabled) {
std::string msg = "AUTOGEN: No valid Qt version found for target ";
msg += target->GetName();
msg += ". ";
{
std::vector<std::string> lst;
if (mocDisabled) {
lst.emplace_back("AUTOMOC");
}
if (uicDisabled) {
lst.emplace_back("AUTOUIC");
}
if (rccDisabled) {
lst.emplace_back("AUTORCC");
}
msg += cmJoin(lst, ", ");
}
msg += " disabled. Consider adding:\n";
if (uicDisabled) {
msg += " find_package(Qt5 COMPONENTS Widgets)\n";
} else {
msg += " find_package(Qt5 COMPONENTS Core)\n";
}
msg += "to your CMakeLists.txt file.";
target->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
}
if (mocIsValid || uicIsValid || rccIsValid) {
// Create autogen target initializer
Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
......
......@@ -623,6 +623,7 @@ void cmVisualStudio10TargetGenerator::Generate()
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
this->WriteWinRTPackageCertificateKeyFile(e0);
this->WritePathAndIncrementalLinkOptions(e0);
this->WriteCEDebugProjectConfigurationValues(e0);
this->WriteItemDefinitionGroups(e0);
this->WriteCustomCommands(e0);
this->WriteAllSources(e0);
......@@ -1071,6 +1072,32 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
}
}
void cmVisualStudio10TargetGenerator::WriteCEDebugProjectConfigurationValues(
Elem& e0)
{
if (!this->GlobalGenerator->TargetsWindowsCE()) {
return;
}
const char* additionalFiles =
this->GeneratorTarget->GetProperty("DEPLOYMENT_ADDITIONAL_FILES");
const char* remoteDirectory =
this->GeneratorTarget->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY");
if (!(additionalFiles || remoteDirectory)) {
return;
}
for (std::string const& c : this->Configurations) {
Elem e1(e0, "PropertyGroup");
e1.Attribute("Condition", this->CalcCondition(c));
if (remoteDirectory) {
e1.Element("RemoteDirectory", remoteDirectory);
}
if (additionalFiles) {
e1.Element("CEAdditionalFiles", additionalFiles);
}
}
}
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
Elem& e1, std::string const& config)
{
......
......@@ -57,6 +57,7 @@ private:
void WriteProjectConfigurations(Elem& e0);
void WriteProjectConfigurationValues(Elem& e0);
void WriteMSToolConfigurationValues(Elem& e1, std::string const& config);
void WriteCEDebugProjectConfigurationValues(Elem& e0);
void WriteMSToolConfigurationValuesManaged(Elem& e1,
std::string const& config);
void WriteHeaderSource(Elem& e1, cmSourceFile const* sf);
......
......@@ -163,6 +163,49 @@ if(BUILD_TESTING)
set(CPACK_BINARY_NUGET OFF)
endif()
if(WIN32)
# Macro to search for available Windows CE SDKs in the windows Registry
macro(select_wince_sdk selected_reg selected_sdk)
if(CMAKE_HOST_WIN32)
execute_process(COMMAND reg QUERY "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs"
OUTPUT_VARIABLE sdk_reg
ERROR_VARIABLE my_err)
string(REGEX REPLACE "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows CE Tools\\\\SDKs\\\\" ";" sdk_list "${sdk_reg}")
list(LENGTH sdk_list sdk_list_len)
if (${sdk_list_len} GREATER 1)
list(GET sdk_list 1 _sdk) # The first entry is always empty due to the regex replace above
string(STRIP ${_sdk} _sdk) # Make sure there is no newline in the SDK name
endif()
# Build a key to be used by get_filename_component that is pointing to the SDK directory
set(_reg "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs\\${_sdk}]")
# Set return values
set(${selected_reg} ${_reg})
set(${selected_sdk} ${_sdk})
endif(CMAKE_HOST_WIN32)
endmacro(select_wince_sdk)
set(reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]")
set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]")
set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]")
set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]")
set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]")
set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]")
set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]")
set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
select_wince_sdk(reg_wince wince_sdk)
set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm)
get_filename_component(r "${reg_${reg}}" ABSOLUTE)
if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry")
set(${reg} 1)
else()
set(${reg} 0)
endif()
endforeach()
endif()
#---------------------------------------------------------------------------
# Add tests below here.
......@@ -2125,50 +2168,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
endif()
if(WIN32)
# Macro to search for available Windows CE SDKs in the windows Registry
macro(select_wince_sdk selected_reg selected_sdk)
if(CMAKE_HOST_WIN32)
execute_process(COMMAND reg QUERY "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs"
OUTPUT_VARIABLE sdk_reg
ERROR_VARIABLE my_err)
string(REGEX REPLACE "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows CE Tools\\\\SDKs\\\\" ";" sdk_list "${sdk_reg}")
list(LENGTH sdk_list sdk_list_len)
if (${sdk_list_len} GREATER 1)
list(GET sdk_list 1 _sdk) # The first entry is always empty due to the regex replace above
string(STRIP ${_sdk} _sdk) # Make sure there is no newline in the SDK name
endif()
# Build a key to be used by get_filename_component that is pointing to the SDK directory
set(_reg "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs\\${_sdk}]")
# Set return values
set(${selected_reg} ${_reg})
set(${selected_sdk} ${_sdk})
endif(CMAKE_HOST_WIN32)
endmacro(select_wince_sdk)
set(reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]")
set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]")
set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]")
set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]")
set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]")
set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]")
set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]")
set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
select_wince_sdk(reg_wince wince_sdk)
set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm)
get_filename_component(r "${reg_${reg}}" ABSOLUTE)
if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry")
set(${reg} 1)
else()
set(${reg} 0)
endif()
endforeach()
endif()
get_filename_component(ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME)
if(WIN32 AND ntver VERSION_GREATER 6.1) # Windows >= 8.0
macro(add_test_VSWinStorePhone name generator systemName systemVersion architecture)
......
cmake_minimum_required(VERSION 3.13)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
^CMake Warning \(dev\) in CMakeLists.txt:
AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC,
AUTORCC disabled. Consider adding:
find_package\(Qt5 COMPONENTS Widgets\)
to your CMakeLists.txt file.
This warning is for project developers. Use -Wno-dev to suppress it.
enable_language(CXX)
add_executable(main empty.cpp)
set_property(TARGET main PROPERTY AUTOMOC 1)
set_property(TARGET main PROPERTY AUTORCC 1)
set_property(TARGET main PROPERTY AUTOUIC 1)
include(RunCMake)
run_cmake(NoQt)
......@@ -42,7 +42,12 @@ function(add_RunCMake_test_group test types)
# much system information so it is easier to set programs and environment
# values here
unset(${test}_${type}_FOUND_PREREQUIREMENTS)
include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
else()
string(REGEX MATCH "^[^.]*" main_type "${type}")
include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${main_type}/Prerequirements.cmake")
endif()
get_test_prerequirements("${test}_${type}_FOUND_PREREQUIREMENTS"
"${TEST_CONFIG_DIR}/${type}_config.cmake")
......@@ -145,6 +150,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
add_RunCMake_test(AndroidTestUtilities)
add_RunCMake_test(Autogen)
add_RunCMake_test(BuildDepends)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
......@@ -338,6 +344,9 @@ endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^9]|9[0-9])")
add_RunCMake_test(VS10Project)
if( vs12 AND wince )
add_RunCMake_test( VS10ProjectWinCE "-DRunCMake_GENERATOR_PLATFORM=${wince_sdk}")
endif()
endif()
if(XCODE_VERSION)
......@@ -456,7 +465,53 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
add_RunCMake_test(ctest_labels_for_subprojects)
endif()
add_RunCMake_test_group(CPack "DEB;RPM;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External")
set(cpack_tests
DEB.CUSTOM_NAMES
DEB.DEBUGINFO
DEB.DEFAULT_PERMISSIONS
DEB.DEPENDENCIES
DEB.EMPTY_DIR
DEB.VERSION
DEB.EXTRA
DEB.GENERATE_SHLIBS
DEB.GENERATE_SHLIBS_LDCONFIG
DEB.LONG_FILENAMES
DEB.MINIMAL
DEB.PER_COMPONENT_FIELDS
DEB.TIMESTAMPS
DEB.MD5SUMS
DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY
RPM.CUSTOM_BINARY_SPEC_FILE
RPM.CUSTOM_NAMES
RPM.DEBUGINFO
RPM.DEFAULT_PERMISSIONS
RPM.DEPENDENCIES
RPM.DIST
RPM.EMPTY_DIR
RPM.VERSION
RPM.INSTALL_SCRIPTS
RPM.MAIN_COMPONENT
RPM.MINIMAL
RPM.PARTIALLY_RELOCATABLE_WARNING
RPM.PER_COMPONENT_FIELDS
RPM.SINGLE_DEBUGINFO
RPM.EXTRA_SLASH_IN_PATH
RPM.SOURCE_PACKAGE
RPM.SUGGESTS
RPM.SYMLINKS
RPM.USER_FILELIST
7Z
TBZ2
TGZ
TXZ
TZ
ZIP
STGZ
External
)
add_RunCMake_test_group(CPack "${cpack_tests}")
# add a test to make sure symbols are exported from a shared library
# for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used
add_RunCMake_test(AutoExportDll)
......
......@@ -2,6 +2,7 @@ cmake_policy(SET CMP0057 NEW)
function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACKAGING_TYPE package_target)
if(TEST_TYPE IN_LIST types)
string(REGEX MATCH "^[^.]*" GENERATOR_TYPE "${TEST_TYPE}")
set(RunCMake_TEST_NO_CLEAN TRUE)
if(package_target)
set(full_test_name_ "${TEST_NAME}-package-target")
......@@ -21,8 +22,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-Prerequirements.cmake")
include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-Prerequirements.cmake")
if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake")
include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake")
set(FOUND_PREREQUIREMENTS false)
get_test_prerequirements("FOUND_PREREQUIREMENTS" "${config_file}")
......@@ -35,7 +36,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
endif()
# execute cmake
set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${TEST_TYPE}"
set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${GENERATOR_TYPE}"
"-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}"
"-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}"
"-DPACKAGING_TYPE=${PACKAGING_TYPE}")
......@@ -64,9 +65,9 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
endif()
if(source)
set(pack_params_ -G ${TEST_TYPE} --config ./CPackSourceConfig.cmake)
set(pack_params_ -G ${GENERATOR_TYPE} --config ./CPackSourceConfig.cmake)
FILE(APPEND ${RunCMake_TEST_BINARY_DIR}/CPackSourceConfig.cmake
"\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_} -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE:STRING=${TEST_TYPE}\")")
"\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_} -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE:STRING=${GENERATOR_TYPE}\")")
else()
unset(pack_params_)
endif()
......@@ -91,18 +92,18 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
)
foreach(o out err)
if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-std${o}.txt")
elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt")
if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-std${o}.txt")
elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-std${o}.txt")
elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/default_expected_std${o}.txt)
set(RunCMake-std${o}-file "${TEST_TYPE}/default_expected_std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/${GENERATOR_TYPE}/default_expected_std${o}.txt)
set(RunCMake-std${o}-file "${GENERATOR_TYPE}/default_expected_std${o}.txt")
else()
unset(RunCMake-std${o}-file)
endif()
......@@ -110,12 +111,12 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
# verify result
run_cmake_command(
${TEST_TYPE}/${full_test_name_}
${GENERATOR_TYPE}/${full_test_name_}
"${CMAKE_COMMAND}"
-DRunCMake_TEST=${full_test_name_}
-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}
-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}
-DGENERATOR_TYPE=${TEST_TYPE}
-DGENERATOR_TYPE=${GENERATOR_TYPE}
-DPACKAGING_TYPE=${PACKAGING_TYPE}
"-Dsrc_dir=${RunCMake_SOURCE_DIR}"
"-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
......
^(CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*(-package-target)?-build((-[^-]*-subtest/)|/)_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec(\n|$))*$
^(CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.[^/]*/CPack/[^-]*(-package-target)?-build((-[^-]*-subtest/)|/)_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec(\n|$))*$
......@@ -4,35 +4,35 @@ include(RunCMake)
include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake")
# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_NAMES "RPM;DEB;TGZ" true "COMPONENT")
run_cpack_test(DEBUGINFO "RPM;DEB" true "COMPONENT")
run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM;DEB" false "MONOLITHIC;COMPONENT")
run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT")
run_cpack_test(DIST "RPM" false "MONOLITHIC")
run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true "MONOLITHIC;COMPONENT")
run_cpack_test(VERSION "RPM;DEB" false "MONOLITHIC;COMPONENT")
run_cpack_test(EXTRA "DEB" false "COMPONENT")
run_cpack_test_subtests(GENERATE_SHLIBS "soversion_not_zero;soversion_zero" "DEB" true "COMPONENT")
run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true "COMPONENT")
run_cpack_test(INSTALL_SCRIPTS "RPM" false "COMPONENT")
run_cpack_test(LONG_FILENAMES "DEB" false "MONOLITHIC")
run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false "COMPONENT")
run_cpack_test(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
run_cpack_test_package_target(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM.CUSTOM_BINARY_SPEC_FILE" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ" true "COMPONENT")
run_cpack_test(DEBUGINFO "RPM.DEBUGINFO;DEB.DEBUGINFO" true "COMPONENT")
run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM.DEFAULT_PERMISSIONS;DEB.DEFAULT_PERMISSIONS" false "MONOLITHIC;COMPONENT")
run_cpack_test(DEPENDENCIES "RPM.DEPENDENCIES;DEB.DEPENDENCIES" true "COMPONENT")
run_cpack_test(DIST "RPM.DIST" false "MONOLITHIC")
run_cpack_test(EMPTY_DIR "RPM.EMPTY_DIR;DEB.EMPTY_DIR;TGZ" true "MONOLITHIC;COMPONENT")
run_cpack_test(VERSION "RPM.VERSION;DEB.VERSION" false "MONOLITHIC;COMPONENT")
run_cpack_test(EXTRA "DEB.EXTRA" false "COMPONENT")
run_cpack_test_subtests(GENERATE_SHLIBS "soversion_not_zero;soversion_zero" "DEB.GENERATE_SHLIBS" true "COMPONENT")