diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-17 15:21:45 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-17 15:21:45 (GMT) |
commit | 9891260a6dab66c9ea44b5c2e244f3128625baf5 (patch) | |
tree | 930651e4383fe1d904cc9c493bd859cb97b530af /Modules | |
parent | 2694ad76c538333d3ff45613bd1201f97af003cd (diff) | |
download | CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.zip CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.tar.gz CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.tar.bz2 |
ENH: add support for watcom wmake and wcl386
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeBackwardCompatibilityCXX.cmake | 7 | ||||
-rw-r--r-- | Modules/CMakeFindWMake.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/Windows-wcl386.cmake | 56 | ||||
-rw-r--r-- | Modules/TestForSSTREAM.cmake | 29 | ||||
-rw-r--r-- | Modules/TestForSSTREAM.cxx | 11 | ||||
-rw-r--r-- | Modules/readme.txt | 2 |
6 files changed, 102 insertions, 6 deletions
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake index c6eead1..29dabc6 100644 --- a/Modules/CMakeBackwardCompatibilityCXX.cmake +++ b/Modules/CMakeBackwardCompatibilityCXX.cmake @@ -34,10 +34,7 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) INCLUDE(CheckIncludeFileCXX) INCLUDE(TestForSTDNamespace) INCLUDE(TestForANSIForScope) - CHECK_INCLUDE_FILE_CXX("sstream" CMAKE_HAS_ANSI_STRING_STREAM) + INCLUDE(TestForSSTREAM) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}") - IF(NOT CMAKE_HAS_ANSI_STRING_STREAM) - SET( CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL - "Does the compiler support sstream or stringstream.") - ENDIF(NOT CMAKE_HAS_ANSI_STRING_STREAM) ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) + diff --git a/Modules/CMakeFindWMake.cmake b/Modules/CMakeFindWMake.cmake new file mode 100644 index 0000000..4353d65 --- /dev/null +++ b/Modules/CMakeFindWMake.cmake @@ -0,0 +1,3 @@ +SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING + "Program used to build from makefiles.") +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake new file mode 100644 index 0000000..fb81be5 --- /dev/null +++ b/Modules/Platform/Windows-wcl386.cmake @@ -0,0 +1,56 @@ +SET(CMAKE_LIBRARY_PATH_FLAG "libpath ") +SET(CMAKE_LINK_LIBRARY_FLAG "library ") + +IF(CMAKE_VERBOSE_MAKEFILE) + SET(CMAKE_WCL_QUIET) + SET(CMAKE_WLINK_QUIET) + SET(CMAKE_LIB_QUIET) +ELSE(CMAKE_VERBOSE_MAKEFILE) + SET(CMAKE_WCL_QUIET "-zq") + SET(CMAKE_WLINK_QUIET "option quiet") + SET(CMAKE_LIB_QUIET "-q") +ENDIF(CMAKE_VERBOSE_MAKEFILE) + +SET(CMAKE_BUILD_TYPE_INIT Debug) +SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs") +SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2") +SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG") +SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG") +SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG") +SET (CMAKE_C_FLAGS_INIT "-w=3 ") +SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -od") +SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG") +SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG") +SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -ot -dNDEBUG") +SET (CMAKE_STANDARD_LIBRARIES "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib" CACHE STRING + "Libraries linked by defalut with all applications.") + +SET(CMAKE_C_LINK_EXECUTABLE + "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + +SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}) + +# compile a C++ file into an object file +SET(CMAKE_CXX_COMPILE_OBJECT + "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -fo<OBJECT> -c -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}") + +# compile a C file into an object file +SET(CMAKE_C_COMPILE_OBJECT + "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}") + +SET(CMAKE_CXX_CREATE_SHARED_LIBRARY + "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES>" + "wlib -q -n -b <TARGET_BASE>.lib +<TARGET_BASE>.dll ${CMAKE_END_TEMP_FILE}") +SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) + +# create a C shared library +SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) + +# create a C shared module just copy the shared library rule +SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) + +# create a C++ static library +SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b <TARGET> <OBJECTS> ") + +# create a C static library +SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake new file mode 100644 index 0000000..f0d12d9 --- /dev/null +++ b/Modules/TestForSSTREAM.cmake @@ -0,0 +1,29 @@ +# # - Test for std:: namespace support +# check if the compiler supports std:: on stl classes +# CMAKE_NO_STD_NAMESPACE - defined by the results +# +IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$") + MESSAGE(STATUS "Check for sstream") + TRY_COMPILE(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR} + ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx + OUTPUT_VARIABLE OUTPUT) + IF (CMAKE_HAS_ANSI_STRING_STREAM) + MESSAGE(STATUS "Check for sstream - found") + SET (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL + "Does the compiler support sstream") + FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining if the CXX compiler has sstream passed with " + "the following output:\n${OUTPUT}\n\n") + ELSE (CMAKE_HAS_ANSI_STRING_STREAM) + MESSAGE(STATUS "Check for sstream - not found") + SET (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL + "Does the compiler support sstream") + FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Determining if the CXX compiler has sstream failed with " + "the following output:\n${OUTPUT}\n\n") + ENDIF (CMAKE_HAS_ANSI_STRING_STREAM) +ENDIF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$") + + + + diff --git a/Modules/TestForSSTREAM.cxx b/Modules/TestForSSTREAM.cxx new file mode 100644 index 0000000..af4a4bb --- /dev/null +++ b/Modules/TestForSSTREAM.cxx @@ -0,0 +1,11 @@ +#include <sstream> +int main(int, char*[]) +{ + std::ostringstream os; + os << "12345"; + if(os.str().size() == 5) + { + return 0; + } + return -1; +} diff --git a/Modules/readme.txt b/Modules/readme.txt index 1d336ac..5ca0628 100644 --- a/Modules/readme.txt +++ b/Modules/readme.txt @@ -28,7 +28,7 @@ If you need other commands to do special things then it should still begin with You really should also provide backwards compatibility any old settings that were actually in use. Make sure you comment them as deprecated, so that no-one starts using them. -To correctly docuement a module, create a comment block at the top with # comments. There are three types of comments that can be in the block: +To correctly document a module, create a comment block at the top with # comments. There are three types of comments that can be in the block: 1. The brief description of the module, this is done by: # - a small description |