diff options
-rw-r--r-- | Help/release/dev/OpenWatcom.rst | 9 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_COMPILER_ID.rst | 2 | ||||
-rw-r--r-- | Modules/FindOpenGL.cmake | 40 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Tests/Complex/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/CMakeLists.txt | 8 |
11 files changed, 91 insertions, 15 deletions
diff --git a/Help/release/dev/OpenWatcom.rst b/Help/release/dev/OpenWatcom.rst new file mode 100644 index 0000000..63f6e8c --- /dev/null +++ b/Help/release/dev/OpenWatcom.rst @@ -0,0 +1,9 @@ +OpenWatcom +---------- + +* Support for the Open Watcom compiler has been overhauled. + The :variable:`CMAKE_<LANG>_COMPILER_ID` is now ``OpenWatcom``, + and the :variable:`CMAKE_<LANG>_COMPILER_VERSION` now uses + the Open Watcom external version numbering. The external + version numbers are lower than the internal version number + by 11. diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst index cf9c386..f554f4e 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst @@ -20,13 +20,13 @@ include: Intel = Intel Compiler (intel.com) MIPSpro = SGI MIPSpro (sgi.com) MSVC = Microsoft Visual Studio (microsoft.com) + OpenWatcom = Open Watcom (openwatcom.org) PGI = The Portland Group (pgroup.com) PathScale = PathScale (pathscale.com) SDCC = Small Device C Compiler (sdcc.sourceforge.net) SunPro = Oracle Solaris Studio (oracle.com) TI = Texas Instruments (ti.com) TinyCC = Tiny C Compiler (tinycc.org) - Watcom = Open Watcom (openwatcom.org) XL, VisualAge, zOS = IBM XL (ibm.com) This variable is not guaranteed to be defined for all compilers or diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index a83a6c3..85c3b94 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -4,6 +4,16 @@ # # FindModule for OpenGL and GLU. # +# IMPORTED Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines the :prop_tgt:`IMPORTED` targets: +# +# ``OpenGL::OpenGL`` +# Defined if the system has OpenGL. +# ``OpenGL::GLU`` +# Defined if the system has GLU. +# # Result Variables # ^^^^^^^^^^^^^^^^ # @@ -181,6 +191,36 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}) unset(_OpenGL_REQUIRED_VARS) +# OpenGL:: targets +if(OPENGL_FOUND) + if(NOT TARGET OpenGL::GL) + add_library(OpenGL::GL UNKNOWN IMPORTED) + set_target_properties(OpenGL::GL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}") + if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$") + set_target_properties(OpenGL::GL PROPERTIES + IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}") + else() + set_target_properties(OpenGL::GL PROPERTIES + IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}") + endif() + endif() + + if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU) + add_library(OpenGL::GLU UNKNOWN IMPORTED) + set_target_properties(OpenGL::GLU PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES OpenGL::GL) + if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$") + set_target_properties(OpenGL::GLU PROPERTIES + IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}") + else() + set_target_properties(OpenGL::GLU PROPERTIES + IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}") + endif() + endif() +endif() + mark_as_advanced( OPENGL_INCLUDE_DIR OPENGL_xmesa_INCLUDE_DIR diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 59ccf51..34aefb4 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140606) +set(CMake_VERSION_PATCH 20140609) #set(CMake_VERSION_RC 1) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 87ccfbd..29a5955 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2440,8 +2440,8 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget) } else { - const char* theConfig = - this->CurrentMakefile->GetDefinition("CMAKE_BUILD_TYPE"); + std::string theConfig = + this->CurrentMakefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); this->CreateBuildSettings(cmtarget, buildSettings, theConfig); @@ -2819,11 +2819,7 @@ void cmGlobalXCodeGenerator i != this->CurrentConfigurationTypes.end(); ++i) { // Get the current configuration name. - const char* configName = i->c_str(); - if(!*configName) - { - configName = 0; - } + std::string configName = *i; if(this->XcodeVersion >= 50) { @@ -3510,11 +3506,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( ct = this->CurrentConfigurationTypes.begin(); ct != this->CurrentConfigurationTypes.end(); ++ct) { - const char* configName = 0; - if(!ct->empty()) - { - configName = ct->c_str(); - } + std::string configName = *ct; for(std::vector<cmXCodeObject*>::iterator i = targets.begin(); i != targets.end(); ++i) { @@ -3967,7 +3959,7 @@ bool cmGlobalXCodeGenerator::IsMultiConfig() void cmGlobalXCodeGenerator ::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const { - const char* configName = this->GetCMakeCFGIntDir(); + std::string configName = this->GetCMakeCFGIntDir(); std::string dir = this->GetObjectsNormalDirectory( "$(PROJECT_NAME)", configName, gt->Target); if(this->XcodeVersion >= 21) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 543d58d..c8c8c79 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -875,6 +875,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, return replaceValues.ObjectDir; } } + if(replaceValues.ObjectFileDir) + { + if(variable == "OBJECT_FILE_DIR") + { + return replaceValues.ObjectFileDir; + } + } if(replaceValues.Objects) { if(variable == "OBJECTS") diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 32da21b..ad73073 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -269,6 +269,7 @@ public: const char* Output; const char* Object; const char* ObjectDir; + const char* ObjectFileDir; const char* Flags; const char* ObjectsQuoted; const char* SONameFlag; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a08d731..85017ad 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -684,6 +684,11 @@ cmMakefileTargetGenerator cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); vars.ObjectDir = objectDir.c_str(); + std::string objectFileDir = cmSystemTools::GetFilenamePath(obj); + objectFileDir = this->Convert(objectFileDir, + cmLocalGenerator::START_OUTPUT, + cmLocalGenerator::SHELL); + vars.ObjectFileDir = objectFileDir.c_str(); vars.Flags = flags.c_str(); std::string definesString = "$("; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index c3b4c75..24689fb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -385,6 +385,7 @@ cmNinjaTargetGenerator vars.TargetPDB = "$TARGET_PDB"; vars.TargetCompilePDB = "$TARGET_COMPILE_PDB"; vars.ObjectDir = "$OBJECT_DIR"; + vars.ObjectFileDir = "$OBJECT_FILE_DIR"; cmMakefile* mf = this->GetMakefile(); @@ -623,6 +624,10 @@ cmNinjaTargetGenerator vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( ConvertToNinjaPath(objectDir.c_str()), cmLocalGenerator::SHELL); + std::string objectFileDir = cmSystemTools::GetFilenamePath(objectFileName); + vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( + ConvertToNinjaPath(objectFileDir.c_str()), + cmLocalGenerator::SHELL); this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetTarget(), vars); @@ -651,6 +656,7 @@ cmNinjaTargetGenerator compileObjectVars.Source = escapedSourceFileName.c_str(); compileObjectVars.Object = objectFileName.c_str(); compileObjectVars.ObjectDir = objectDir.c_str(); + compileObjectVars.ObjectFileDir = objectFileDir.c_str(); compileObjectVars.Flags = vars["FLAGS"].c_str(); compileObjectVars.Defines = vars["DEFINES"].c_str(); diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 5fa46bf..222250c 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -83,6 +83,14 @@ set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO + CMAKE_IS_FUN_IN_RELEASE_MODE + ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_MINSIZEREL + CMAKE_IS_FUN_IN_RELEASE_MODE + ) set(TEST_SEP "a b c") separate_arguments(TEST_SEP) diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index d3d9132..3f17dcc 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -83,6 +83,14 @@ set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO + CMAKE_IS_FUN_IN_RELEASE_MODE + ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_MINSIZEREL + CMAKE_IS_FUN_IN_RELEASE_MODE + ) set(TEST_SEP "a b c") separate_arguments(TEST_SEP) |