ENH: add support for watcom wmake and wcl386

This commit is contained in:
Bill Hoffman 2006-01-17 10:21:45 -05:00
parent 2694ad76c5
commit 9891260a6d
49 changed files with 979 additions and 474 deletions

View File

@ -34,10 +34,7 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
INCLUDE(CheckIncludeFileCXX) INCLUDE(CheckIncludeFileCXX)
INCLUDE(TestForSTDNamespace) INCLUDE(TestForSTDNamespace)
INCLUDE(TestForANSIForScope) INCLUDE(TestForANSIForScope)
CHECK_INCLUDE_FILE_CXX("sstream" CMAKE_HAS_ANSI_STRING_STREAM) INCLUDE(TestForSSTREAM)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}") 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) ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)

View File

@ -0,0 +1,3 @@
SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
"Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)

View File

@ -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})

View File

@ -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$")

View File

@ -0,0 +1,11 @@
#include <sstream>
int main(int, char*[])
{
std::ostringstream os;
os << "12345";
if(os.str().size() == 5)
{
return 0;
}
return -1;
}

View File

@ -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. 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: 1. The brief description of the module, this is done by:
# - a small description # - a small description

View File

@ -175,6 +175,7 @@ IF (WIN32)
SET(SRCS ${SRCS} SET(SRCS ${SRCS}
cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.cxx
cmGlobalNMakeMakefileGenerator.cxx cmGlobalNMakeMakefileGenerator.cxx
cmGlobalWatcomWMakeGenerator.cxx
cmGlobalMSYSMakefileGenerator.cxx cmGlobalMSYSMakefileGenerator.cxx
cmGlobalMinGWMakefileGenerator.cxx cmGlobalMinGWMakefileGenerator.cxx
cmGlobalVisualStudio6Generator.cxx cmGlobalVisualStudio6Generator.cxx
@ -316,6 +317,15 @@ IF (NOT DART_ROOT)
ENDIF (NOT DART_ROOT) ENDIF (NOT DART_ROOT)
IF(BUILD_TESTING) IF(BUILD_TESTING)
SET(CMAKE_TEST_GENERATOR "" CACHE STRING "Generator used when running tests")
SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH "Generator used when running tests")
IF(NOT CMAKE_TEST_GENERATOR)
SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
ELSE(NOT CMAKE_TEST_GENERATOR)
SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
ENDIF(NOT CMAKE_TEST_GENERATOR)
# This variable is set by cmake, however to # This variable is set by cmake, however to
# test cmake we want to make sure that # test cmake we want to make sure that
# the ctest from this cmake is used for testing # the ctest from this cmake is used for testing
@ -332,8 +342,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/CommandLineTest" "${CMake_SOURCE_DIR}/Tests/CommandLineTest"
"${CMake_BINARY_DIR}/Tests/CommandLineTest" "${CMake_BINARY_DIR}/Tests/CommandLineTest"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project CommandLineTest --build-project CommandLineTest
--test-command CommandLineTest) --test-command CommandLineTest)
@ -342,8 +352,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/TarTest" "${CMake_SOURCE_DIR}/Tests/TarTest"
"${CMake_BINARY_DIR}/Tests/TarTest" "${CMake_BINARY_DIR}/Tests/TarTest"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project TestTar --build-project TestTar
--test-command TestTarExec) --test-command TestTarExec)
@ -352,9 +362,9 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/CustomCommand" "${CMake_SOURCE_DIR}/Tests/CustomCommand"
"${CMake_BINARY_DIR}/Tests/CustomCommand" "${CMake_BINARY_DIR}/Tests/CustomCommand"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project CustomCommand --build-project CustomCommand
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
--test-command CustomCommand --test-command CustomCommand
) )
@ -364,9 +374,9 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/FindPackageTest" "${CMake_SOURCE_DIR}/Tests/FindPackageTest"
"${CMake_BINARY_DIR}/Tests/FindPackageTest" "${CMake_BINARY_DIR}/Tests/FindPackageTest"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project FindPackageTest --build-project FindPackageTest
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command FindPackageTest) --test-command FindPackageTest)
ADD_TEST(SystemInformation ${CMAKE_CTEST_COMMAND} ADD_TEST(SystemInformation ${CMAKE_CTEST_COMMAND}
@ -374,9 +384,9 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/SystemInformation" "${CMake_SOURCE_DIR}/Tests/SystemInformation"
"${CMake_BINARY_DIR}/Tests/SystemInformation" "${CMake_BINARY_DIR}/Tests/SystemInformation"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project DumpInformation --build-project DumpInformation
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command DumpInformation) --test-command DumpInformation)
ADD_TEST(StringFileTest ${CMAKE_CTEST_COMMAND} ADD_TEST(StringFileTest ${CMAKE_CTEST_COMMAND}
@ -384,9 +394,9 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/StringFileTest" "${CMake_SOURCE_DIR}/Tests/StringFileTest"
"${CMake_BINARY_DIR}/Tests/StringFileTest" "${CMake_BINARY_DIR}/Tests/StringFileTest"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project StringFileTest --build-project StringFileTest
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command StringFileTest) --test-command StringFileTest)
ADD_TEST(MathTest ${CMAKE_CTEST_COMMAND} ADD_TEST(MathTest ${CMAKE_CTEST_COMMAND}
@ -394,18 +404,18 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/MathTest" "${CMake_SOURCE_DIR}/Tests/MathTest"
"${CMake_BINARY_DIR}/Tests/MathTest" "${CMake_BINARY_DIR}/Tests/MathTest"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project MathTest --build-project MathTest
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command MathTestExec) --test-command MathTestExec)
ADD_TEST(TryCompile ${CMAKE_CTEST_COMMAND} ADD_TEST(TryCompile ${CMAKE_CTEST_COMMAND}
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/TryCompile" "${CMake_SOURCE_DIR}/Tests/TryCompile"
"${CMake_BINARY_DIR}/Tests/TryCompile" "${CMake_BINARY_DIR}/Tests/TryCompile"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project TryCompile --build-project TryCompile
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command TryCompile) --test-command TryCompile)
@ -413,9 +423,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_SOURCE_DIR}/Tests/Simple"
"${CMake_BINARY_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project Simple --build-project Simple
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command simple) --test-command simple)
@ -423,9 +433,9 @@ IF(BUILD_TESTING)
# --build-and-test # --build-and-test
# "${CMake_SOURCE_DIR}/Tests/SameName" # "${CMake_SOURCE_DIR}/Tests/SameName"
# "${CMake_BINARY_DIR}/Tests/SameName" # "${CMake_BINARY_DIR}/Tests/SameName"
# --build-generator ${CMAKE_GENERATOR} # --build-generator ${CMAKE_TEST_GENERATOR}
# --build-project SameName # --build-project SameName
# --build-makeprogram ${MAKEPROGRAM} # --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-two-config # --build-two-config
# --test-command # --test-command
# "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2") # "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
@ -434,9 +444,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/OutOfSource" "${CMake_SOURCE_DIR}/Tests/OutOfSource"
"${CMake_BINARY_DIR}/Tests/OutOfSource" "${CMake_BINARY_DIR}/Tests/OutOfSource"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project OutOfSource --build-project OutOfSource
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command --test-command
"${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple") "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
@ -445,9 +455,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/PreOrder" "${CMake_SOURCE_DIR}/Tests/PreOrder"
"${CMake_BINARY_DIR}/Tests/PreOrder" "${CMake_BINARY_DIR}/Tests/PreOrder"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project PreOrder --build-project PreOrder
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command simple) --test-command simple)
@ -455,9 +465,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/COnly" "${CMake_SOURCE_DIR}/Tests/COnly"
"${CMake_BINARY_DIR}/Tests/COnly" "${CMake_BINARY_DIR}/Tests/COnly"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project conly --build-project conly
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command conly) --test-command conly)
@ -465,9 +475,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/MacroTest" "${CMake_SOURCE_DIR}/Tests/MacroTest"
"${CMake_BINARY_DIR}/Tests/MacroTest" "${CMake_BINARY_DIR}/Tests/MacroTest"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project littleMacroTest --build-project littleMacroTest
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command miniMacroTest) --test-command miniMacroTest)
@ -477,9 +487,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/SimpleInstall" "${CMake_SOURCE_DIR}/Tests/SimpleInstall"
"${CMake_BINARY_DIR}/Tests/SimpleInstall" "${CMake_BINARY_DIR}/Tests/SimpleInstall"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project TestSimpleInstall --build-project TestSimpleInstall
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--build-options --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
@ -488,9 +498,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/SimpleInstallS2" "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2"
"${CMake_BINARY_DIR}/Tests/SimpleInstallS2" "${CMake_BINARY_DIR}/Tests/SimpleInstallS2"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project TestSimpleInstall --build-project TestSimpleInstall
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--build-options --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
@ -501,9 +511,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/X11" "${CMake_SOURCE_DIR}/Tests/X11"
"${CMake_BINARY_DIR}/Tests/X11" "${CMake_BINARY_DIR}/Tests/X11"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project UseX11 --build-project UseX11
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command UseX11) --test-command UseX11)
@ -511,9 +521,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/LoadCommand" "${CMake_SOURCE_DIR}/Tests/LoadCommand"
"${CMake_BINARY_DIR}/Tests/LoadCommand" "${CMake_BINARY_DIR}/Tests/LoadCommand"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project LoadedCommand --build-project LoadedCommand
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command LoadedCommand) --test-command LoadedCommand)
@ -521,9 +531,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig"
"${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project LoadedCommand --build-project LoadedCommand
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command LoadedCommand --test-command LoadedCommand
) )
@ -538,10 +548,12 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Complex" "${CMake_SOURCE_DIR}/Tests/Complex"
"${CMake_BINARY_DIR}/Tests/Complex" "${CMake_BINARY_DIR}/Tests/Complex"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project complex --build-project complex
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
--build-options
-DCMAKE_TEST_DIFFERENT_GENERATOR:BOOL=${CMAKE_TEST_DIFFERENT_GENERATOR}
--test-command complex --test-command complex
) )
@ -549,9 +561,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/ComplexOneConfig" "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
"${CMake_BINARY_DIR}/Tests/ComplexOneConfig" "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project complex --build-project complex
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
--test-command complex) --test-command complex)
@ -559,9 +571,9 @@ IF(BUILD_TESTING)
# --build-and-test # --build-and-test
# "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths" # "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"
# "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths" # "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths"
# --build-generator ${CMAKE_GENERATOR} # --build-generator ${CMAKE_TEST_GENERATOR}
# --build-project complex # --build-project complex
# --build-makeprogram ${MAKEPROGRAM} # --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin" # --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin"
# --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON # --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON
# --test-command complex) # --test-command complex)
@ -572,9 +584,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Example" "${CMake_SOURCE_DIR}/Example"
"${CMake_BINARY_DIR}/Example" "${CMake_BINARY_DIR}/Example"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project HELLO --build-project HELLO
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Example/Demo" --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo"
--test-command helloDemo --test-command helloDemo
) )
@ -584,8 +596,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Tutorial/Step1" "${CMake_SOURCE_DIR}/Tests/Tutorial/Step1"
"${CMake_BINARY_DIR}/Tests/Tutorial/Step1" "${CMake_BINARY_DIR}/Tests/Tutorial/Step1"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Tutorial --build-project Tutorial
--test-command Tutorial 25.0) --test-command Tutorial 25.0)
@ -594,8 +606,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Tutorial/Step2" "${CMake_SOURCE_DIR}/Tests/Tutorial/Step2"
"${CMake_BINARY_DIR}/Tests/Tutorial/Step2" "${CMake_BINARY_DIR}/Tests/Tutorial/Step2"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Tutorial --build-project Tutorial
--test-command Tutorial 25.0) --test-command Tutorial 25.0)
@ -604,8 +616,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Tutorial/Step3" "${CMake_SOURCE_DIR}/Tests/Tutorial/Step3"
"${CMake_BINARY_DIR}/Tests/Tutorial/Step3" "${CMake_BINARY_DIR}/Tests/Tutorial/Step3"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Tutorial --build-project Tutorial
--test-command Tutorial 25.0) --test-command Tutorial 25.0)
@ -614,8 +626,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Tutorial/Step4" "${CMake_SOURCE_DIR}/Tests/Tutorial/Step4"
"${CMake_BINARY_DIR}/Tests/Tutorial/Step4" "${CMake_BINARY_DIR}/Tests/Tutorial/Step4"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Tutorial --build-project Tutorial
--test-command Tutorial 25.0) --test-command Tutorial 25.0)
@ -624,8 +636,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Tutorial/Step5" "${CMake_SOURCE_DIR}/Tests/Tutorial/Step5"
"${CMake_BINARY_DIR}/Tests/Tutorial/Step5" "${CMake_BINARY_DIR}/Tests/Tutorial/Step5"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Tutorial --build-project Tutorial
--test-command Tutorial 25.0) --test-command Tutorial 25.0)
@ -633,9 +645,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/Testing" "${CMake_SOURCE_DIR}/Tests/Testing"
"${CMake_BINARY_DIR}/Tests/Testing" "${CMake_BINARY_DIR}/Tests/Testing"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project testing --build-project testing
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Testing/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Testing/bin"
--test-command testing --test-command testing
) )
@ -644,9 +656,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_SOURCE_DIR}/Tests/Wrapping"
"${CMake_BINARY_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project wrapping --build-project wrapping
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--test-command wrapping --test-command wrapping
) )
@ -663,9 +675,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_SOURCE_DIR}/Tests/Wrapping"
"${CMake_BINARY_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project Wrapping --build-project Wrapping
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--test-command qtwrapping --test-command qtwrapping
) )
@ -675,8 +687,8 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_SOURCE_DIR}/Tests/TestDriver"
"${CMake_BINARY_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest --build-project TestDriverTest
--test-command TestDriverTest test1 --test-command TestDriverTest test1
@ -686,8 +698,8 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_SOURCE_DIR}/Tests/TestDriver"
"${CMake_BINARY_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest --build-project TestDriverTest
--test-command TestDriverTest test2 --test-command TestDriverTest test2
@ -697,8 +709,8 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_SOURCE_DIR}/Tests/TestDriver"
"${CMake_BINARY_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest --build-project TestDriverTest
--test-command TestDriverTest subdir/test3 --test-command TestDriverTest subdir/test3
@ -710,8 +722,8 @@ IF(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut" "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec"
--build-project Dependency --build-project Dependency
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-options --build-options
-DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
--test-command exec --test-command exec
@ -723,8 +735,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_SOURCE_DIR}/Tests/Dependency"
"${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut" "${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut/Exec" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut/Exec"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Dependency --build-project Dependency
--test-command exec --test-command exec
) )
@ -734,8 +746,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_SOURCE_DIR}/Tests/Dependency"
"${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut" "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec2" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec2"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Dependency --build-project Dependency
--build-options --build-options
-DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
@ -747,8 +759,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_SOURCE_DIR}/Tests/Dependency"
"${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut" "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec3" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec3"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Dependency --build-project Dependency
--build-options --build-options
-DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
@ -759,8 +771,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_SOURCE_DIR}/Tests/Dependency"
"${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut" "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec4" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec4"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Dependency --build-project Dependency
--build-options --build-options
-DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
@ -773,8 +785,8 @@ IF(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/Jump/WithLibOut" "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable"
--build-project Jump --build-project Jump
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-options --build-options
-DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
--test-command jumpExecutable --test-command jumpExecutable
@ -787,8 +799,8 @@ IF(BUILD_TESTING)
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
--build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
--build-project Jump --build-project Jump
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command jumpExecutable --test-command jumpExecutable
) )
@ -797,8 +809,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/LinkLine" "${CMake_SOURCE_DIR}/Tests/LinkLine"
"${CMake_BINARY_DIR}/Tests/LinkLine" "${CMake_BINARY_DIR}/Tests/LinkLine"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLine" --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLine"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project Linkline --build-project Linkline
--test-command Exec --test-command Exec
) )
@ -807,8 +819,8 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
"${CMake_BINARY_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLineOrder" --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
--build-project LinkLineOrder --build-project LinkLineOrder
--test-command Exec1 --test-command Exec1
@ -819,8 +831,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
"${CMake_BINARY_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLineOrder" --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project LinkLineOrder --build-project LinkLineOrder
--test-command Exec2 --test-command Exec2
) )
@ -829,23 +841,26 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/ExternalOBJ" "${CMake_SOURCE_DIR}/Tests/ExternalOBJ"
"${CMake_BINARY_DIR}/Tests/ExternalOBJ" "${CMake_BINARY_DIR}/Tests/ExternalOBJ"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project ExternalOBJ --build-project ExternalOBJ
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/ExternalOBJ" --build-exe-dir "${CMake_BINARY_DIR}/ExternalOBJ"
--test-command executable --test-command executable
) )
ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND} IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
--build-and-test ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND}
"${CMake_SOURCE_DIR}/Source/kwsys" --build-and-test
"${CMake_BINARY_DIR}/Tests/kwsys" "${CMake_SOURCE_DIR}/Source/kwsys"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/kwsys" "${CMake_BINARY_DIR}/Tests/kwsys"
--build-generator ${CMAKE_GENERATOR} --build-exe-dir "${CMake_BINARY_DIR}/Tests/kwsys"
--build-makeprogram ${MAKEPROGRAM} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project kwsys --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command testIOS --build-project kwsys
) --test-command testIOS
)
ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
IF (WIN32) IF (WIN32)
ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND} ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
@ -853,8 +868,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_SOURCE_DIR}/Tests/SubDir"
"${CMake_BINARY_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable" --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project SUBDIR --build-project SUBDIR
--test-command test --test-command test
"${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
@ -866,8 +881,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_SOURCE_DIR}/Tests/SubDir"
"${CMake_BINARY_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir"
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable" --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project SUBDIR --build-project SUBDIR
--test-command test --test-command test
"${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
@ -875,30 +890,30 @@ IF(BUILD_TESTING)
) )
ENDIF (WIN32) ENDIF (WIN32)
IF("${CMAKE_GENERATOR}" MATCHES "Makefile") IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND} ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/MakeClean" "${CMake_SOURCE_DIR}/Tests/MakeClean"
"${CMake_BINARY_DIR}/Tests/MakeClean" "${CMake_BINARY_DIR}/Tests/MakeClean"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project MakeClean --build-project MakeClean
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/MakeClean" --build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
--test-command check_clean --test-command check_clean
) )
ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile") ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio") IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND} ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND}
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/VSExternalInclude" "${CMake_SOURCE_DIR}/Tests/VSExternalInclude"
"${CMake_BINARY_DIR}/Tests/VSExternalInclude" "${CMake_BINARY_DIR}/Tests/VSExternalInclude"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project VSExternalInclude --build-project VSExternalInclude
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command VSExternalInclude) --test-command VSExternalInclude)
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio") ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
IF (APPLE AND CMAKE_COMPILER_IS_GNUCXX) IF (APPLE AND CMAKE_COMPILER_IS_GNUCXX)
ADD_TEST(BundleTest ${CMAKE_CTEST_COMMAND} ADD_TEST(BundleTest ${CMAKE_CTEST_COMMAND}
@ -906,8 +921,8 @@ IF(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/BundleTest" "${CMake_SOURCE_DIR}/Tests/BundleTest"
"${CMake_BINARY_DIR}/Tests/BundleTest" "${CMake_BINARY_DIR}/Tests/BundleTest"
--build-two-config --build-two-config
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project BundleTest --build-project BundleTest
--test-command BundleTest.app/Contents/MacOS/BundleTest) --test-command BundleTest.app/Contents/MacOS/BundleTest)
@ -915,8 +930,8 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/ObjC++" "${CMake_SOURCE_DIR}/Tests/ObjC++"
"${CMake_BINARY_DIR}/Tests/ObjC++" "${CMake_BINARY_DIR}/Tests/ObjC++"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project objc++ --build-project objc++
--test-command objc++ --test-command objc++
) )
@ -943,9 +958,9 @@ IF(BUILD_TESTING)
) )
ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS) ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS)
IF("${CMAKE_GENERATOR}" MATCHES Xcode) IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
ENDIF("${CMAKE_GENERATOR}" MATCHES Xcode) ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
# If there is CMakeLists.txt in the binary tree, assume in-source build # If there is CMakeLists.txt in the binary tree, assume in-source build
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
@ -958,11 +973,11 @@ IF(BUILD_TESTING)
--build-nocmake --build-nocmake
--build-noclean --build-noclean
--build-makeprogram ${CMake_SOURCE_DIR}/bootstrap --build-makeprogram ${CMake_SOURCE_DIR}/bootstrap
--build-generator "${CMAKE_GENERATOR}" --build-generator "${CMAKE_TEST_GENERATOR}"
--test-command ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake) --test-command ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
ENDIF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) ENDIF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
IF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles")
# see if we can find a fortran compiler on the machine # see if we can find a fortran compiler on the machine
# if so, add the fortran test and see if it works. # if so, add the fortran test and see if it works.
SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95 SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95
@ -975,9 +990,9 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/Fortran" "${CMake_SOURCE_DIR}/Tests/Fortran"
"${CMake_BINARY_DIR}/Tests/Fortran" "${CMake_BINARY_DIR}/Tests/Fortran"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project testf --build-project testf
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--test-command testf) --test-command testf)
ENDIF(CMAKE_Fortran_COMPILER_FULLPATH) ENDIF(CMAKE_Fortran_COMPILER_FULLPATH)
@ -995,16 +1010,16 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/Java" "${CMake_SOURCE_DIR}/Tests/Java"
"${CMake_BINARY_DIR}/Tests/Java" "${CMake_BINARY_DIR}/Tests/Java"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-project hello --build-project hello
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config --build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
ENDIF("${JNI_FILE}" MATCHES "JDK1_2") ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
ENDIF(JNI_H) ENDIF(JNI_H)
ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW) ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles")
IF (CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE OR WXWINDOWS_INCLUDE_DIR) IF (CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE OR WXWINDOWS_INCLUDE_DIR)
# Will be set if the wxwindows gui is on # Will be set if the wxwindows gui is on
@ -1012,8 +1027,8 @@ IF(BUILD_TESTING)
--build-and-test --build-and-test
"${CMake_SOURCE_DIR}/Tests/UseWX" "${CMake_SOURCE_DIR}/Tests/UseWX"
"${CMake_BINARY_DIR}/Tests/UseWX" "${CMake_BINARY_DIR}/Tests/UseWX"
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir ${CMake_BINARY_DIR}/Tests/UseWX --build-exe-dir ${CMake_BINARY_DIR}/Tests/UseWX
--build-project UsewxWindows --build-project UsewxWindows
--build-options -DCMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE:FILEPATH=${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --build-options -DCMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE:FILEPATH=${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE}

View File

@ -27,17 +27,17 @@
extern "C" extern "C"
{ {
void *cmGetClientData(void *info) void CCONV *cmGetClientData(void *info)
{ {
return ((cmLoadedCommandInfo *)info)->ClientData; return ((cmLoadedCommandInfo *)info)->ClientData;
} }
void cmSetClientData(void *info, void *cd) void CCONV cmSetClientData(void *info, void *cd)
{ {
((cmLoadedCommandInfo *)info)->ClientData = cd; ((cmLoadedCommandInfo *)info)->ClientData = cd;
} }
void cmSetError(void *info, const char *err) void CCONV cmSetError(void *info, const char *err)
{ {
if (((cmLoadedCommandInfo *)info)->Error) if (((cmLoadedCommandInfo *)info)->Error)
{ {
@ -46,35 +46,35 @@ void cmSetError(void *info, const char *err)
((cmLoadedCommandInfo *)info)->Error = strdup(err); ((cmLoadedCommandInfo *)info)->Error = strdup(err);
} }
unsigned int cmGetCacheMajorVersion(void *arg) unsigned int CCONV cmGetCacheMajorVersion(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetCacheMajorVersion(); return mf->GetCacheMajorVersion();
} }
unsigned int cmGetCacheMinorVersion(void *arg) unsigned int CCONV cmGetCacheMinorVersion(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetCacheMinorVersion(); return mf->GetCacheMinorVersion();
} }
unsigned int cmGetMajorVersion(void *) unsigned int CCONV cmGetMajorVersion(void *)
{ {
return cmMakefile::GetMajorVersion(); return cmMakefile::GetMajorVersion();
} }
unsigned int cmGetMinorVersion(void *) unsigned int CCONV cmGetMinorVersion(void *)
{ {
return cmMakefile::GetMinorVersion(); return cmMakefile::GetMinorVersion();
} }
void cmAddDefinition(void *arg, const char* name, const char* value) void CCONV cmAddDefinition(void *arg, const char* name, const char* value)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
mf->AddDefinition(name,value); mf->AddDefinition(name,value);
} }
/* Add a definition to this makefile and the global cmake cache. */ /* Add a definition to this makefile and the global cmake cache. */
void cmAddCacheDefinition(void *arg, const char* name, const char* value, void CCONV cmAddCacheDefinition(void *arg, const char* name, const char* value,
const char* doc, const char* doc,
int type) int type)
{ {
@ -109,75 +109,75 @@ void cmAddCacheDefinition(void *arg, const char* name, const char* value,
} }
} }
const char* cmGetProjectName(void *arg) const char* CCONV cmGetProjectName(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetProjectName(); return mf->GetProjectName();
} }
const char* cmGetHomeDirectory(void *arg) const char* CCONV cmGetHomeDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetHomeDirectory(); return mf->GetHomeDirectory();
} }
const char* cmGetHomeOutputDirectory(void *arg) const char* CCONV cmGetHomeOutputDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetHomeOutputDirectory(); return mf->GetHomeOutputDirectory();
} }
const char* cmGetStartDirectory(void *arg) const char* CCONV cmGetStartDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetStartDirectory(); return mf->GetStartDirectory();
} }
const char* cmGetStartOutputDirectory(void *arg) const char* CCONV cmGetStartOutputDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetStartOutputDirectory(); return mf->GetStartOutputDirectory();
} }
const char* cmGetCurrentDirectory(void *arg) const char* CCONV cmGetCurrentDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetCurrentDirectory(); return mf->GetCurrentDirectory();
} }
const char* cmGetCurrentOutputDirectory(void *arg) const char* CCONV cmGetCurrentOutputDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetCurrentOutputDirectory(); return mf->GetCurrentOutputDirectory();
} }
const char* cmGetDefinition(void *arg,const char*def) const char* CCONV cmGetDefinition(void *arg,const char*def)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetDefinition(def); return mf->GetDefinition(def);
} }
int cmIsOn(void *arg, const char* name) int CCONV cmIsOn(void *arg, const char* name)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return static_cast<int>(mf->IsOn(name)); return static_cast<int>(mf->IsOn(name));
} }
/** Check if a command exists. */ /** Check if a command exists. */
int cmCommandExists(void *arg, const char* name) int CCONV cmCommandExists(void *arg, const char* name)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return static_cast<int>(mf->CommandExists(name)); return static_cast<int>(mf->CommandExists(name));
} }
void cmAddDefineFlag(void *arg, const char* definition) void CCONV cmAddDefineFlag(void *arg, const char* definition)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
mf->AddDefineFlag(definition); mf->AddDefineFlag(definition);
} }
void cmAddLinkDirectoryForTarget(void *arg, const char *tgt, const char* d) void CCONV cmAddLinkDirectoryForTarget(void *arg, const char *tgt, const char* d)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
mf->AddLinkDirectoryForTarget(tgt,d); mf->AddLinkDirectoryForTarget(tgt,d);
} }
void cmAddExecutable(void *arg, const char *exename, void CCONV cmAddExecutable(void *arg, const char *exename,
int numSrcs, const char **srcs, int win32) int numSrcs, const char **srcs, int win32)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
@ -194,7 +194,7 @@ void cmAddExecutable(void *arg, const char *exename,
} }
} }
void cmAddUtilityCommand(void *arg, const char* utilityName, void CCONV cmAddUtilityCommand(void *arg, const char* utilityName,
const char* command, const char* command,
const char* arguments, const char* arguments,
int all, int all,
@ -242,7 +242,7 @@ void cmAddUtilityCommand(void *arg, const char* utilityName,
mf->AddUtilityCommand(utilityName, (all ? true : false), mf->AddUtilityCommand(utilityName, (all ? true : false),
output, depends2, commandLines); output, depends2, commandLines);
} }
void cmAddCustomCommand(void *arg, const char* source, void CCONV cmAddCustomCommand(void *arg, const char* source,
const char* command, const char* command,
int numArgs, const char **args, int numArgs, const char **args,
int numDepends, const char **depends, int numDepends, const char **depends,
@ -287,7 +287,7 @@ void cmAddCustomCommand(void *arg, const char* source,
commandLines, no_comment); commandLines, no_comment);
} }
void cmAddCustomCommandToOutput(void *arg, const char* output, void CCONV cmAddCustomCommandToOutput(void *arg, const char* output,
const char* command, const char* command,
int numArgs, const char **args, int numArgs, const char **args,
const char* main_dependency, const char* main_dependency,
@ -323,7 +323,7 @@ void cmAddCustomCommandToOutput(void *arg, const char* output,
commandLines, no_comment); commandLines, no_comment);
} }
void cmAddCustomCommandToTarget(void *arg, const char* target, void CCONV cmAddCustomCommandToTarget(void *arg, const char* target,
const char* command, const char* command,
int numArgs, const char **args, int numArgs, const char **args,
int commandType) int commandType)
@ -366,7 +366,7 @@ void cmAddCustomCommandToTarget(void *arg, const char* target,
cctype, no_comment); cctype, no_comment);
} }
void cmAddLinkLibraryForTarget(void *arg, const char *tgt, const char*value, void CCONV cmAddLinkLibraryForTarget(void *arg, const char *tgt, const char*value,
int libtype) int libtype)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
@ -385,7 +385,7 @@ void cmAddLinkLibraryForTarget(void *arg, const char *tgt, const char*value,
} }
} }
void cmAddLibrary(void *arg, const char *libname, int shared, void CCONV cmAddLibrary(void *arg, const char *libname, int shared,
int numSrcs, const char **srcs) int numSrcs, const char **srcs)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
@ -398,7 +398,7 @@ void cmAddLibrary(void *arg, const char *libname, int shared,
mf->AddLibrary(libname, (shared ? true : false), srcs2); mf->AddLibrary(libname, (shared ? true : false), srcs2);
} }
char *cmExpandVariablesInString(void *arg, const char *source, char CCONV *cmExpandVariablesInString(void *arg, const char *source,
int escapeQuotes, int atOnly) int escapeQuotes, int atOnly)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
@ -417,7 +417,7 @@ char *cmExpandVariablesInString(void *arg, const char *source,
} }
int cmExecuteCommand(void *arg, const char *name, int CCONV cmExecuteCommand(void *arg, const char *name,
int numArgs, const char **args) int numArgs, const char **args)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
@ -432,7 +432,7 @@ int cmExecuteCommand(void *arg, const char *name,
return mf->ExecuteCommand(lff); return mf->ExecuteCommand(lff);
} }
void cmExpandSourceListArguments(void *arg, void CCONV cmExpandSourceListArguments(void *arg,
int numArgs, int numArgs,
const char **args, const char **args,
int *resArgc, int *resArgc,
@ -462,7 +462,7 @@ void cmExpandSourceListArguments(void *arg,
*resArgv = resargv; *resArgv = resargv;
} }
void cmFreeArguments(int argc, char **argv) void CCONV cmFreeArguments(int argc, char **argv)
{ {
int i; int i;
for (i = 0; i < argc; ++i) for (i = 0; i < argc; ++i)
@ -475,7 +475,7 @@ void cmFreeArguments(int argc, char **argv)
} }
} }
int cmGetTotalArgumentSize(int argc, char **argv) int CCONV cmGetTotalArgumentSize(int argc, char **argv)
{ {
int i; int i;
int result = 0; int result = 0;
@ -489,13 +489,13 @@ int cmGetTotalArgumentSize(int argc, char **argv)
return result; return result;
} }
void *cmGetSource(void *arg, const char *name) void CCONV *cmGetSource(void *arg, const char *name)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return (void *)mf->GetSource(name); return (void *)mf->GetSource(name);
} }
void * cmAddSource(void *arg, void *arg2) void * CCONV cmAddSource(void *arg, void *arg2)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
cmSourceFile *sf = static_cast<cmSourceFile *>(arg2); cmSourceFile *sf = static_cast<cmSourceFile *>(arg2);
@ -503,54 +503,54 @@ void * cmAddSource(void *arg, void *arg2)
} }
void * cmCreateSourceFile() void * CCONV cmCreateSourceFile()
{ {
return (void *)(new cmSourceFile); return (void *)(new cmSourceFile);
} }
void cmDestroySourceFile(void *arg) void CCONV cmDestroySourceFile(void *arg)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
delete sf; delete sf;
} }
const char *cmSourceFileGetSourceName(void *arg) const char * CCONV cmSourceFileGetSourceName(void *arg)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
return sf->GetSourceName().c_str(); return sf->GetSourceName().c_str();
} }
const char *cmSourceFileGetFullPath(void *arg) const char * CCONV cmSourceFileGetFullPath(void *arg)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
return sf->GetFullPath().c_str(); return sf->GetFullPath().c_str();
} }
const char *cmSourceFileGetProperty(void *arg,const char *prop) const char * CCONV cmSourceFileGetProperty(void *arg,const char *prop)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
return sf->GetProperty(prop); return sf->GetProperty(prop);
} }
int cmSourceFileGetPropertyAsBool(void *arg,const char *prop) int CCONV cmSourceFileGetPropertyAsBool(void *arg,const char *prop)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
return (sf->GetPropertyAsBool(prop) ? 1: 0); return (sf->GetPropertyAsBool(prop) ? 1: 0);
} }
void cmSourceFileSetProperty(void *arg,const char *prop, const char *val) void CCONV cmSourceFileSetProperty(void *arg,const char *prop, const char *val)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
sf->SetProperty(prop,val); sf->SetProperty(prop,val);
} }
void cmSourceFileAddDepend(void *arg, const char *depend) void CCONV cmSourceFileAddDepend(void *arg, const char *depend)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
sf->GetDepends().push_back(depend); sf->GetDepends().push_back(depend);
} }
void cmSourceFileSetName(void *arg, const char* name, const char* dir, void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,
int numSourceExtensions, int numSourceExtensions,
const char **sourceExtensions, const char **sourceExtensions,
int numHeaderExtensions, int numHeaderExtensions,
@ -571,7 +571,7 @@ void cmSourceFileSetName(void *arg, const char* name, const char* dir,
sf->SetName(name,dir, srcs, hdrs); sf->SetName(name,dir, srcs, hdrs);
} }
void cmSourceFileSetName2(void *arg, const char* name, const char* dir, void CCONV cmSourceFileSetName2(void *arg, const char* name, const char* dir,
const char *ext, int headerFileOnly) const char *ext, int headerFileOnly)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
@ -579,7 +579,7 @@ void cmSourceFileSetName2(void *arg, const char* name, const char* dir,
} }
char *cmGetFilenameWithoutExtension(const char *name) char * CCONV cmGetFilenameWithoutExtension(const char *name)
{ {
std::string sres = cmSystemTools::GetFilenameWithoutExtension(name); std::string sres = cmSystemTools::GetFilenameWithoutExtension(name);
char *result = (char *)malloc(sres.size()+1); char *result = (char *)malloc(sres.size()+1);
@ -587,7 +587,7 @@ char *cmGetFilenameWithoutExtension(const char *name)
return result; return result;
} }
char *cmGetFilenamePath(const char *name) char * CCONV cmGetFilenamePath(const char *name)
{ {
std::string sres = cmSystemTools::GetFilenamePath(name); std::string sres = cmSystemTools::GetFilenamePath(name);
char *result = (char *)malloc(sres.size()+1); char *result = (char *)malloc(sres.size()+1);
@ -595,7 +595,7 @@ char *cmGetFilenamePath(const char *name)
return result; return result;
} }
char *cmCapitalized(const char *name) char * CCONV cmCapitalized(const char *name)
{ {
std::string sres = cmSystemTools::Capitalized(name); std::string sres = cmSystemTools::Capitalized(name);
char *result = (char *)malloc(sres.size()+1); char *result = (char *)malloc(sres.size()+1);
@ -603,23 +603,23 @@ char *cmCapitalized(const char *name)
return result; return result;
} }
void cmCopyFileIfDifferent(const char *name1, const char *name2) void CCONV cmCopyFileIfDifferent(const char *name1, const char *name2)
{ {
cmSystemTools::CopyFileIfDifferent(name1,name2); cmSystemTools::CopyFileIfDifferent(name1,name2);
} }
void cmRemoveFile(const char *name) void CCONV cmRemoveFile(const char *name)
{ {
cmSystemTools::RemoveFile(name); cmSystemTools::RemoveFile(name);
} }
void cmDisplayStatus(void *arg, const char* message) void CCONV cmDisplayStatus(void *arg, const char* message)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
mf->DisplayStatus(message, -1); mf->DisplayStatus(message, -1);
} }
void cmFree(void *data) void CCONV cmFree(void *data)
{ {
free(data); free(data);
} }

View File

@ -32,6 +32,11 @@
extern "C" { extern "C" {
#endif #endif
#ifdef __WATCOMC__
#define CCONV __cdecl
#else
#define CCONV
#endif
/*========================================================================= /*=========================================================================
this is the structure of function entry points that a plugin may call. This this is the structure of function entry points that a plugin may call. This
structure must be kept in sync with the static decaled at the bottom of structure must be kept in sync with the static decaled at the bottom of
@ -46,67 +51,67 @@ typedef struct
/* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how
information is passed from the InitialPass to FInalPass for commands information is passed from the InitialPass to FInalPass for commands
that need a FinalPass and need information from the InitialPass */ that need a FinalPass and need information from the InitialPass */
void *(*GetClientData) (void *info); void *(CCONV *GetClientData) (void *info);
/* return the summed size in characters of all the arguments */ /* return the summed size in characters of all the arguments */
int (*GetTotalArgumentSize) (int argc, char **argv); int (CCONV *GetTotalArgumentSize) (int argc, char **argv);
/* free all the memory associated with an argc, argv pair */ /* free all the memory associated with an argc, argv pair */
void (*FreeArguments) (int argc, char **argv); void (CCONV *FreeArguments) (int argc, char **argv);
/* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how
information is passed from the InitialPass to FInalPass for commands information is passed from the InitialPass to FInalPass for commands
that need a FinalPass and need information from the InitialPass */ that need a FinalPass and need information from the InitialPass */
void (*SetClientData) (void *info, void *cd); void (CCONV *SetClientData) (void *info, void *cd);
/* when an error occurs, call this function to set the error string */ /* when an error occurs, call this function to set the error string */
void (*SetError) (void *info, const char *err); void (CCONV *SetError) (void *info, const char *err);
/*========================================================================= /*=========================================================================
The following functions all directly map to methods in the cmMakefile The following functions all directly map to methods in the cmMakefile
class. See cmMakefile.h for descriptions of what each method does. All of class. See cmMakefile.h for descriptions of what each method does. All of
these methods take the void * makefile pointer as their first argument. these methods take the void * makefile pointer as their first argument.
=========================================================================*/ =========================================================================*/
void (*AddCacheDefinition) (void *mf, const char* name, void (CCONV *AddCacheDefinition) (void *mf, const char* name,
const char* value, const char* value,
const char* doc, int cachetype); const char* doc, int cachetype);
void (*AddCustomCommand) (void *mf, const char* source, void (CCONV *AddCustomCommand) (void *mf, const char* source,
const char* command, const char* command,
int numArgs, const char **args, int numArgs, const char **args,
int numDepends, const char **depends, int numDepends, const char **depends,
int numOutputs, const char **outputs, int numOutputs, const char **outputs,
const char *target); const char *target);
void (*AddDefineFlag) (void *mf, const char* definition); void (CCONV *AddDefineFlag) (void *mf, const char* definition);
void (*AddDefinition) (void *mf, const char* name, const char* value); void (CCONV *AddDefinition) (void *mf, const char* name, const char* value);
void (*AddExecutable) (void *mf, const char *exename, void (CCONV *AddExecutable) (void *mf, const char *exename,
int numSrcs, const char **srcs, int win32); int numSrcs, const char **srcs, int win32);
void (*AddLibrary) (void *mf, const char *libname, void (CCONV *AddLibrary) (void *mf, const char *libname,
int shared, int numSrcs, const char **srcs); int shared, int numSrcs, const char **srcs);
void (*AddLinkDirectoryForTarget) (void *mf, const char *tgt, void (CCONV *AddLinkDirectoryForTarget) (void *mf, const char *tgt,
const char* d); const char* d);
void (*AddLinkLibraryForTarget) (void *mf, const char *tgt, void (CCONV *AddLinkLibraryForTarget) (void *mf, const char *tgt,
const char *libname, int libtype); const char *libname, int libtype);
void (*AddUtilityCommand) (void *mf, const char* utilityName, void (CCONV *AddUtilityCommand) (void *mf, const char* utilityName,
const char *command, const char *arguments, const char *command, const char *arguments,
int all, int numDepends, const char **depends, int all, int numDepends, const char **depends,
int numOutputs, const char **outputs); int numOutputs, const char **outputs);
int (*CommandExists) (void *mf, const char* name); int (CCONV *CommandExists) (void *mf, const char* name);
int (*ExecuteCommand) (void *mf, const char *name, int (CCONV *ExecuteCommand) (void *mf, const char *name,
int numArgs, const char **args); int numArgs, const char **args);
void (*ExpandSourceListArguments) (void *mf,int argc, const char **argv, void (CCONV *ExpandSourceListArguments) (void *mf,int argc, const char **argv,
int *resArgc, char ***resArgv, int *resArgc, char ***resArgv,
unsigned int startArgumentIndex); unsigned int startArgumentIndex);
char *(*ExpandVariablesInString) (void *mf, const char *source, char *(CCONV *ExpandVariablesInString) (void *mf, const char *source,
int escapeQuotes, int atOnly); int escapeQuotes, int atOnly);
unsigned int (*GetCacheMajorVersion) (void *mf); unsigned int (CCONV *GetCacheMajorVersion) (void *mf);
unsigned int (*GetCacheMinorVersion) (void *mf); unsigned int (CCONV *GetCacheMinorVersion) (void *mf);
const char* (*GetCurrentDirectory) (void *mf); const char* (CCONV *GetCurrentDirectory) (void *mf);
const char* (*GetCurrentOutputDirectory) (void *mf); const char* (CCONV *GetCurrentOutputDirectory) (void *mf);
const char* (*GetDefinition) (void *mf, const char *def); const char* (CCONV *GetDefinition) (void *mf, const char *def);
const char* (*GetHomeDirectory) (void *mf); const char* (CCONV *GetHomeDirectory) (void *mf);
const char* (*GetHomeOutputDirectory) (void *mf); const char* (CCONV *GetHomeOutputDirectory) (void *mf);
unsigned int (*GetMajorVersion) (void *mf); unsigned int (CCONV *GetMajorVersion) (void *mf);
unsigned int (*GetMinorVersion) (void *mf); unsigned int (CCONV *GetMinorVersion) (void *mf);
const char* (*GetProjectName) (void *mf); const char* (CCONV *GetProjectName) (void *mf);
const char* (*GetStartDirectory) (void *mf); const char* (CCONV *GetStartDirectory) (void *mf);
const char* (*GetStartOutputDirectory) (void *mf); const char* (CCONV *GetStartOutputDirectory) (void *mf);
int (*IsOn) (void *mf, const char* name); int (CCONV *IsOn) (void *mf, const char* name);
/*========================================================================= /*=========================================================================
@ -114,23 +119,23 @@ typedef struct
cmSourceFiles. Please see cmSourceFile.h for additional information on many cmSourceFiles. Please see cmSourceFile.h for additional information on many
of these methods. Some of these methods are in cmMakefile.h. of these methods. Some of these methods are in cmMakefile.h.
=========================================================================*/ =========================================================================*/
void *(*AddSource) (void *mf, void *sf); void *(CCONV *AddSource) (void *mf, void *sf);
void *(*CreateSourceFile) (); void *(CCONV *CreateSourceFile) ();
void (*DestroySourceFile) (void *sf); void (CCONV *DestroySourceFile) (void *sf);
void *(*GetSource) (void *mf, const char* sourceName); void *(CCONV *GetSource) (void *mf, const char* sourceName);
void (*SourceFileAddDepend) (void *sf, const char *depend); void (CCONV *SourceFileAddDepend) (void *sf, const char *depend);
const char *(*SourceFileGetProperty) (void *sf, const char *prop); const char *(CCONV *SourceFileGetProperty) (void *sf, const char *prop);
int (*SourceFileGetPropertyAsBool) (void *sf, const char *prop); int (CCONV *SourceFileGetPropertyAsBool) (void *sf, const char *prop);
const char *(*SourceFileGetSourceName) (void *sf); const char *(CCONV *SourceFileGetSourceName) (void *sf);
const char *(*SourceFileGetFullPath) (void *sf); const char *(CCONV *SourceFileGetFullPath) (void *sf);
void (*SourceFileSetName) (void *sf, const char* name, const char* dir, void (CCONV *SourceFileSetName) (void *sf, const char* name, const char* dir,
int numSourceExtensions, int numSourceExtensions,
const char **sourceExtensions, const char **sourceExtensions,
int numHeaderExtensions, int numHeaderExtensions,
const char **headerExtensions); const char **headerExtensions);
void (*SourceFileSetName2) (void *sf, const char* name, const char* dir, void (CCONV *SourceFileSetName2) (void *sf, const char* name, const char* dir,
const char *ext, int headerFileOnly); const char *ext, int headerFileOnly);
void (*SourceFileSetProperty) (void *sf, const char *prop, void (CCONV *SourceFileSetProperty) (void *sf, const char *prop,
const char *value); const char *value);
@ -138,28 +143,28 @@ typedef struct
The following methods are from cmSystemTools.h see that file for specific The following methods are from cmSystemTools.h see that file for specific
documentation on each method. documentation on each method.
=========================================================================*/ =========================================================================*/
char *(*Capitalized)(const char *); char *(CCONV *Capitalized)(const char *);
void (*CopyFileIfDifferent)(const char *f1, const char *f2); void (CCONV *CopyFileIfDifferent)(const char *f1, const char *f2);
char *(*GetFilenameWithoutExtension)(const char *); char *(CCONV *GetFilenameWithoutExtension)(const char *);
char *(*GetFilenamePath)(const char *); char *(CCONV *GetFilenamePath)(const char *);
void (*RemoveFile)(const char *f1); void (CCONV *RemoveFile)(const char *f1);
void (*Free)(void *); void (CCONV *Free)(void *);
/*========================================================================= /*=========================================================================
The following are new functions added after 1.6 The following are new functions added after 1.6
=========================================================================*/ =========================================================================*/
void (*AddCustomCommandToOutput) (void *mf, const char* output, void (CCONV *AddCustomCommandToOutput) (void *mf, const char* output,
const char* command, const char* command,
int numArgs, const char **args, int numArgs, const char **args,
const char* main_dependency, const char* main_dependency,
int numDepends, const char **depends); int numDepends, const char **depends);
void (*AddCustomCommandToTarget) (void *mf, const char* target, void (CCONV *AddCustomCommandToTarget) (void *mf, const char* target,
const char* command, const char* command,
int numArgs, const char **args, int numArgs, const char **args,
int commandType); int commandType);
/* display status information */ /* display status information */
void (*DisplaySatus) (void *info, const char *message); void (CCONV *DisplaySatus) (void *info, const char *message);
/* this is the end of the C function stub API structure */ /* this is the end of the C function stub API structure */
} cmCAPI; } cmCAPI;
@ -202,11 +207,11 @@ define the different types of custom commands for a target
/*========================================================================= /*=========================================================================
Finally we define the key data structures and function prototypes Finally we define the key data structures and function prototypes
=========================================================================*/ =========================================================================*/
typedef const char* (*CM_DOC_FUNCTION)(); typedef const char* (CCONV *CM_DOC_FUNCTION)();
typedef int (*CM_INITIAL_PASS_FUNCTION)(void *info, void *mf, typedef int (CCONV *CM_INITIAL_PASS_FUNCTION)(void *info, void *mf,
int argc, char *[]); int argc, char *[]);
typedef void (*CM_FINAL_PASS_FUNCTION)(void *info, void *mf); typedef void (CCONV *CM_FINAL_PASS_FUNCTION)(void *info, void *mf);
typedef void (*CM_DESTRUCTOR_FUNCTION)(void *info); typedef void (CCONV *CM_DESTRUCTOR_FUNCTION)(void *info);
typedef struct { typedef struct {
unsigned long reserved1; /* Reserved for future use. DO NOT USE. */ unsigned long reserved1; /* Reserved for future use. DO NOT USE. */
@ -223,7 +228,7 @@ Finally we define the key data structures and function prototypes
void *ClientData; void *ClientData;
} cmLoadedCommandInfo; } cmLoadedCommandInfo;
typedef void (*CM_INIT_FUNCTION)(cmLoadedCommandInfo *); typedef void (CCONV *CM_INIT_FUNCTION)(cmLoadedCommandInfo *);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -135,6 +135,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// target so that make with no arguments will run it. // target so that make with no arguments will run it.
// Just depend on the all target to drive the build. // Just depend on the all target to drive the build.
std::vector<std::string> depends; std::vector<std::string> depends;
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
std::vector<std::string> no_commands; std::vector<std::string> no_commands;
depends.push_back("all"); depends.push_back("all");
@ -146,10 +151,16 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
depends, depends,
no_commands); no_commands);
depends.clear();
if(sym)
{
depends.push_back(sym);
}
// Write and empty all: // Write and empty all:
lg->WriteMakeRule(makefileStream, lg->WriteMakeRule(makefileStream,
"The main recursive all target", "all", "The main recursive all target", "all",
no_commands, no_commands); depends, no_commands);
lg->WriteMakeVariables(makefileStream); lg->WriteMakeVariables(makefileStream);
@ -590,6 +601,7 @@ cmGlobalUnixMakefileGenerator3
for (i = 0; i < m_LocalGenerators.size(); ++i) for (i = 0; i < m_LocalGenerators.size(); ++i)
{ {
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]); lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
// for each target Generate the rule files for each target. // for each target Generate the rule files for each target.
cmTargets& targets = lg->GetMakefile()->GetTargets(); cmTargets& targets = lg->GetMakefile()->GetTargets();
@ -618,6 +630,10 @@ cmGlobalUnixMakefileGenerator3
commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2", commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
t->second.GetName())); t->second.GetName()));
depends.clear(); depends.clear();
if(sym)
{
depends.push_back(sym);
}
depends.push_back("cmake_check_build_system"); depends.push_back("cmake_check_build_system");
lg->WriteMakeRule(ruleFileStream, lg->WriteMakeRule(ruleFileStream,
"Build rule for target.", "Build rule for target.",
@ -695,6 +711,11 @@ cmGlobalUnixMakefileGenerator3
// Write the rule. // Write the rule.
localName += "/all"; localName += "/all";
depends.clear(); depends.clear();
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
this->AppendGlobalTargetDepends(depends,t->second); this->AppendGlobalTargetDepends(depends,t->second);
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.", lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
localName.c_str(), depends, commands); localName.c_str(), depends, commands);
@ -714,6 +735,10 @@ cmGlobalUnixMakefileGenerator3
commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2", commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
localName.c_str())); localName.c_str()));
depends.clear(); depends.clear();
if(sym)
{
depends.push_back(sym);
}
depends.push_back("cmake_check_build_system"); depends.push_back("cmake_check_build_system");
localName = lg->GetRelativeTargetDirectory(t->second); localName = lg->GetRelativeTargetDirectory(t->second);
localName += "/rule"; localName += "/rule";
@ -733,6 +758,10 @@ cmGlobalUnixMakefileGenerator3
makeTargetName = localName; makeTargetName = localName;
makeTargetName += "/clean"; makeTargetName += "/clean";
depends.clear(); depends.clear();
if(sym)
{
depends.push_back(sym);
}
commands.clear(); commands.clear();
commands.push_back(lg->GetRecursiveMakeCall(makefileName.c_str(), commands.push_back(lg->GetRecursiveMakeCall(makefileName.c_str(),
makeTargetName.c_str())); makeTargetName.c_str()));
@ -905,6 +934,11 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
} }
} }
} }
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
no_depends.push_back(sym);
}
lg->WriteMakeRule(ruleFileStream, "Help Target", lg->WriteMakeRule(ruleFileStream, "Help Target",
"help:", "help:",
no_depends, commands); no_depends, commands);

View File

@ -0,0 +1,65 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "cmGlobalWatcomWMakeGenerator.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator()
{
m_FindMakeProgramFile = "CMakeFindWMake.cmake";
m_ForceUnixPaths = false;
}
void cmGlobalWatcomWMakeGenerator::EnableLanguage(std::vector<std::string>const& l,
cmMakefile *mf)
{
// pick a default
mf->AddDefinition("WATCOM", "1");
mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
mf->AddDefinition("CMAKE_WINDOWS_OBJECT_PATH", "1");
mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
mf->AddDefinition("CMAKE_NO_QUOTED_OBJECTS", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf);
}
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
lg->SetSilentNoColon(true);
lg->SetEchoNeedsQuote(false);
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("-s -h");
lg->SetGlobalGenerator(this);
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(false);
lg->SetUnixCD(false);
lg->SetIncludeDirective("!include");
return lg;
}
//----------------------------------------------------------------------------
void cmGlobalWatcomWMakeGenerator::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.name = this->GetName();
entry.brief = "Generates Watcom WMake makefiles.";
entry.full = "";
}

View File

@ -0,0 +1,50 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef cmGlobalWatcomWMakeGenerator_h
#define cmGlobalWatcomWMakeGenerator_h
#include "cmGlobalUNIXMakefileGenerator3.h"
/** \class cmGlobalWatcomWMakeGenerator
* \brief Write a NMake makefiles.
*
* cmGlobalWatcomWMakeGenerator manages nmake build process for a tree
*/
class cmGlobalWatcomWMakeGenerator : public cmGlobalUnixMakefileGenerator3
{
public:
cmGlobalWatcomWMakeGenerator();
static cmGlobalGenerator* New() { return new cmGlobalWatcomWMakeGenerator; }
///! Get the name for the generator.
virtual const char* GetName() const {
return cmGlobalWatcomWMakeGenerator::GetActualName();}
static const char* GetActualName() {return "Watcom WMake";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
};
#endif

View File

@ -41,6 +41,7 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3() cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
{ {
m_SilentNoColon = false;
m_WindowsShell = false; m_WindowsShell = false;
m_IncludeDirective = "include"; m_IncludeDirective = "include";
m_MakefileVariableSize = 0; m_MakefileVariableSize = 0;
@ -609,7 +610,10 @@ cmLocalUnixMakefileGenerator3
std::string relativeObj = this->GetHomeRelativeOutputPath(); std::string relativeObj = this->GetHomeRelativeOutputPath();
relativeObj += obj; relativeObj += obj;
if(m_Makefile->GetDefinition("CMAKE_WINDOWS_OBJECT_PATH"))
{
relativeObj = cmSystemTools::ConvertToOutputPath(relativeObj.c_str());
}
// Write the build rule. // Write the build rule.
// Build the set of compiler flags. // Build the set of compiler flags.
std::string flags; std::string flags;
@ -849,6 +853,11 @@ cmLocalUnixMakefileGenerator3
// Collect the commands and dependencies. // Collect the commands and dependencies.
std::vector<std::string> commands; std::vector<std::string> commands;
std::vector<std::string> depends; std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
// Utility targets store their rules in pre- and post-build commands. // Utility targets store their rules in pre- and post-build commands.
this->AppendCustomDepends(depends, target.GetPreBuildCommands()); this->AppendCustomDepends(depends, target.GetPreBuildCommands());
@ -1122,6 +1131,11 @@ cmLocalUnixMakefileGenerator3
// Write special "install" target to run cmake_install.cmake script. // Write special "install" target to run cmake_install.cmake script.
{ {
std::vector<std::string> depends; std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
std::vector<std::string> commands; std::vector<std::string> commands;
std::string cmd; std::string cmd;
if(m_Makefile->GetDefinition("CMake_BINARY_DIR")) if(m_Makefile->GetDefinition("CMake_BINARY_DIR"))
@ -1150,9 +1164,14 @@ cmLocalUnixMakefileGenerator3
"install", depends, commands); "install", depends, commands);
} }
std::vector<std::string> no_depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
no_depends.push_back(sym);
}
// Write special "rebuild_cache" target to re-run cmake. // Write special "rebuild_cache" target to re-run cmake.
{ {
std::vector<std::string> no_depends;
std::vector<std::string> commands; std::vector<std::string> commands;
this->AppendEcho(commands, "Running CMake to regenerate build system..."); this->AppendEcho(commands, "Running CMake to regenerate build system...");
commands.push_back( commands.push_back(
@ -1168,7 +1187,6 @@ cmLocalUnixMakefileGenerator3
// Otherwise default to the interactive command-line interface. // Otherwise default to the interactive command-line interface.
if(m_Makefile->GetDefinition("CMAKE_EDIT_COMMAND")) if(m_Makefile->GetDefinition("CMAKE_EDIT_COMMAND"))
{ {
std::vector<std::string> no_depends;
std::vector<std::string> commands; std::vector<std::string> commands;
this->AppendEcho(commands, "Running CMake cache editor..."); this->AppendEcho(commands, "Running CMake cache editor...");
commands.push_back( commands.push_back(
@ -1181,7 +1199,6 @@ cmLocalUnixMakefileGenerator3
} }
else else
{ {
std::vector<std::string> no_depends;
std::vector<std::string> commands; std::vector<std::string> commands;
this->AppendEcho(commands, this->AppendEcho(commands,
"Running interactive CMake command-line interface..."); "Running interactive CMake command-line interface...");
@ -1201,8 +1218,8 @@ cmLocalUnixMakefileGenerator3
// name of this special target. This gives a make-time choice to // name of this special target. This gives a make-time choice to
// the user. // the user.
std::vector<std::string> commands; std::vector<std::string> commands;
no_depends.clear();
commands.clear(); commands.clear();
std::vector<std::string> no_depends;
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")) if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{ {
makefileStream makefileStream
@ -1210,12 +1227,18 @@ cmLocalUnixMakefileGenerator3
<< "VERBOSE = 1\n" << "VERBOSE = 1\n"
<< "\n"; << "\n";
} }
if(m_SilentNoColon)
this->WriteMakeRule(makefileStream, {
"Suppress display of executed commands.", makefileStream << "$(VERBOSE).SILENT\n";
"$(VERBOSE).SILENT", }
no_depends, else
commands); {
this->WriteMakeRule(makefileStream,
"Suppress display of executed commands.",
"$(VERBOSE).SILENT",
no_depends,
commands);
}
// Special target to cleanup operation of make tool. // Special target to cleanup operation of make tool.
std::vector<std::string> depends; std::vector<std::string> depends;
@ -1255,6 +1278,12 @@ cmLocalUnixMakefileGenerator3
std::vector<std::string> no_depends; std::vector<std::string> no_depends;
std::vector<std::string> commands; std::vector<std::string> commands;
commands.push_back(runRule); commands.push_back(runRule);
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
no_depends.push_back(sym);
}
this->WriteMakeRule(makefileStream, this->WriteMakeRule(makefileStream,
"Special rule to run CMake to check the build system " "Special rule to run CMake to check the build system "
"integrity.\n" "integrity.\n"
@ -1284,6 +1313,11 @@ cmLocalUnixMakefileGenerator3
{ {
// The helper target depends on the real target. // The helper target depends on the real target.
std::vector<std::string> depends; std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
depends.push_back(realTarget); depends.push_back(realTarget);
// There are no commands. // There are no commands.
@ -1956,12 +1990,25 @@ cmLocalUnixMakefileGenerator3
<< "# Object files for target " << target.GetName() << "\n" << "# Object files for target " << target.GetName() << "\n"
<< variableName.c_str() << " ="; << variableName.c_str() << " =";
std::string object; std::string object;
const char* objName = m_Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS");
const char* lineContinue = m_Makefile->GetDefinition("CMAKE_MAKE_LINE_CONTINUE");
if(!lineContinue)
{
lineContinue = "\\";
}
for(std::vector<std::string>::const_iterator i = objects.begin(); for(std::vector<std::string>::const_iterator i = objects.begin();
i != objects.end(); ++i) i != objects.end(); ++i)
{ {
ruleFileStream ruleFileStream
<< " \\\n" << " " << lineContinue << "\n";
<< this->ConvertToQuotedOutputPath(i->c_str()); if(objName)
{
ruleFileStream << this->Convert(i->c_str(), START_OUTPUT, MAKEFILE);
}
else
{
ruleFileStream << this->ConvertToQuotedOutputPath(i->c_str());
}
} }
ruleFileStream ruleFileStream
<< "\n"; << "\n";
@ -1979,8 +2026,16 @@ cmLocalUnixMakefileGenerator3
{ {
object = this->Convert(i->c_str(),START_OUTPUT); object = this->Convert(i->c_str(),START_OUTPUT);
ruleFileStream ruleFileStream
<< " \\\n" << " " << lineContinue << "\n"
<< this->ConvertToQuotedOutputPath(object.c_str()); << m_Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME");
if(objName)
{
ruleFileStream << this->Convert(i->c_str(), START_OUTPUT, MAKEFILE);
}
else
{
ruleFileStream << this->ConvertToQuotedOutputPath(i->c_str());
}
} }
ruleFileStream ruleFileStream
<< "\n" << "\n"
@ -2053,7 +2108,12 @@ cmLocalUnixMakefileGenerator3
cmTarget& target, cmTarget& target,
const std::vector<std::string>& files) const std::vector<std::string>& files)
{ {
std::vector<std::string> no_depends; std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
std::vector<std::string> commands; std::vector<std::string> commands;
// Construct the clean target name. // Construct the clean target name.
@ -2066,7 +2126,7 @@ cmLocalUnixMakefileGenerator3
m_Makefile->GetHomeOutputDirectory()); m_Makefile->GetHomeOutputDirectory());
// Write the rule. // Write the rule.
this->WriteMakeRule(ruleFileStream, 0, this->WriteMakeRule(ruleFileStream, 0,
cleanTarget.c_str(), no_depends, commands); cleanTarget.c_str(), depends, commands);
} }
@ -2210,6 +2270,7 @@ cmLocalUnixMakefileGenerator3
std::string std::string
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p) cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
{ {
// Split the path into its components. // Split the path into its components.
std::vector<std::string> components; std::vector<std::string> components;
cmSystemTools::SplitPath(p, components); cmSystemTools::SplitPath(p, components);
@ -2894,6 +2955,11 @@ void cmLocalUnixMakefileGenerator3
dir += "/directorystart"; dir += "/directorystart";
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE); dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
// if at the top the rule is called all // if at the top the rule is called all
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
if (!m_Parent) if (!m_Parent)
{ {
dir = "all"; dir = "all";
@ -2908,11 +2974,19 @@ void cmLocalUnixMakefileGenerator3
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE); dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
commands.clear(); commands.clear();
depends.clear(); depends.clear();
if(sym)
{
depends.push_back(sym);
}
this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir); this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir);
this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands); this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands);
// write the depend rule, really a recompute depends rule // write the depend rule, really a recompute depends rule
depends.clear(); depends.clear();
if(sym)
{
depends.push_back(sym);
}
commands.clear(); commands.clear();
std::string cmakefileName = "CMakeFiles/Makefile.cmake"; std::string cmakefileName = "CMakeFiles/Makefile.cmake";
this->Convert(cmakefileName.c_str(),HOME_OUTPUT, this->Convert(cmakefileName.c_str(),HOME_OUTPUT,

View File

@ -115,6 +115,12 @@ public:
*/ */
void SetUnixCD(bool v) {m_UnixCD = v;} void SetUnixCD(bool v) {m_UnixCD = v;}
/**
* Set Support Verbose Variable. If true, then .SILENT will
* be not end with : i.e. .SILENT: or .SILENT
*/
void SetSilentNoColon(bool v) {m_SilentNoColon = v;}
/** /**
* Set the string used to include one makefile into another default * Set the string used to include one makefile into another default
* is include. * is include.
@ -365,6 +371,7 @@ private:
bool m_DefineWindowsNULL; bool m_DefineWindowsNULL;
bool m_UnixCD; bool m_UnixCD;
bool m_PassMakeflags; bool m_PassMakeflags;
bool m_SilentNoColon;
//========================================================================== //==========================================================================
// Flag for whether echo command needs quotes. // Flag for whether echo command needs quotes.

View File

@ -131,6 +131,7 @@ protected:
RegexReplacement(const char* s): number(-1), value(s) {} RegexReplacement(const char* s): number(-1), value(s) {}
RegexReplacement(const std::string& s): number(-1), value(s) {} RegexReplacement(const std::string& s): number(-1), value(s) {}
RegexReplacement(int n): number(n), value() {} RegexReplacement(int n): number(n), value() {}
RegexReplacement() {};
int number; int number;
std::string value; std::string value;
}; };

View File

@ -47,6 +47,7 @@
# endif # endif
# include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h"
# include "cmGlobalWatcomWMakeGenerator.h"
# include "cmGlobalMSYSMakefileGenerator.h" # include "cmGlobalMSYSMakefileGenerator.h"
# include "cmGlobalMinGWMakefileGenerator.h" # include "cmGlobalMinGWMakefileGenerator.h"
# include "cmWin32ProcessExecution.h" # include "cmWin32ProcessExecution.h"
@ -1606,6 +1607,8 @@ void cmake::AddDefaultGenerators()
&cmGlobalBorlandMakefileGenerator::New; &cmGlobalBorlandMakefileGenerator::New;
m_Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = m_Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] =
&cmGlobalNMakeMakefileGenerator::New; &cmGlobalNMakeMakefileGenerator::New;
m_Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] =
&cmGlobalWatcomWMakeGenerator::New;
m_Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = m_Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] =
&cmGlobalMSYSMakefileGenerator::New; &cmGlobalMSYSMakefileGenerator::New;
m_Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = m_Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] =

View File

@ -74,7 +74,7 @@ const char* Directory::GetFile(unsigned long dindex)
// First microsoft compilers // First microsoft compilers
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__WATCOMC__)
#include <windows.h> #include <windows.h>
#include <io.h> #include <io.h>
#include <ctype.h> #include <ctype.h>

View File

@ -12,7 +12,9 @@
=========================================================================*/ =========================================================================*/
#include <stdio.h> #include <stdio.h>
#ifdef __WATCOMC__
#define _unlink unlink
#endif
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
FILE* ifp; FILE* ifp;
@ -76,6 +78,9 @@ int main(int argc, char* argv[])
fprintf(ofp, "extern %s_EXPORT int %sEncodedWriteArray%s(const char* fname)\n", fprintf(ofp, "extern %s_EXPORT int %sEncodedWriteArray%s(const char* fname)\n",
argv[3], argv[3], argv[4]); argv[3], argv[3], argv[4]);
fprintf(ofp, "{\n"); fprintf(ofp, "{\n");
fprintf(ofp, "#ifdef __WATCOMC__\n");
fprintf(ofp, "#define _unlink unlink\n");
fprintf(ofp, "#endif\n");
fprintf(ofp, " FILE* ofp = fopen(fname, \"wb\");\n"); fprintf(ofp, " FILE* ofp = fopen(fname, \"wb\");\n");
fprintf(ofp, " if(!ofp) { return 0; }\n"); fprintf(ofp, " if(!ofp) { return 0; }\n");
for(i=0; i < count; ++i) for(i=0; i < count; ++i)

View File

@ -35,7 +35,7 @@
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
namespace KWSYS_NAMESPACE namespace KWSYS_NAMESPACE
{ {
#if defined( _WIN32 ) || defined( APPLE ) || defined( __CYGWIN__ ) #if defined( _WIN32 ) || defined( APPLE ) || defined( __CYGWIN__ )

View File

@ -45,6 +45,9 @@ Q190351 and Q150956.
#include <string.h> /* strlen, strdup */ #include <string.h> /* strlen, strdup */
#include <stdio.h> /* sprintf */ #include <stdio.h> /* sprintf */
#include <io.h> /* _unlink */ #include <io.h> /* _unlink */
#ifdef __WATCOMC__
#define _unlink unlink
#endif
#ifndef _MAX_FNAME #ifndef _MAX_FNAME
#define _MAX_FNAME 4096 #define _MAX_FNAME 4096

View File

@ -367,9 +367,7 @@ RegistryHelper::~RegistryHelper()
bool RegistryHelper::Open(const char *toplevel, const char *subkey, bool RegistryHelper::Open(const char *toplevel, const char *subkey,
int readonly) int readonly)
{ {
this->EntriesMap.erase( this->EntriesMap.clear();
this->EntriesMap.begin(),
this->EntriesMap.end());
m_Empty = 1; m_Empty = 1;
#ifdef _WIN32 #ifdef _WIN32
@ -416,7 +414,7 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
} }
} }
m_HomeDirectory = homeDirectory; m_HomeDirectory = homeDirectory;
str << m_HomeDirectory << "/." << toplevel << "rc"; str << m_HomeDirectory.c_str() << "/." << toplevel << "rc";
if ( readonly == Registry::READWRITE ) if ( readonly == Registry::READWRITE )
{ {
kwsys_ios::ofstream ofs( str.str().c_str(), kwsys_ios::ios::out|kwsys_ios::ios::app ); kwsys_ios::ofstream ofs( str.str().c_str(), kwsys_ios::ios::out|kwsys_ios::ios::app );
@ -503,7 +501,7 @@ bool RegistryHelper::Close()
} }
kwsys_ios::ostringstream str; kwsys_ios::ostringstream str;
str << m_HomeDirectory << "/." << this->GetTopLevel() << "rc"; str << m_HomeDirectory.c_str() << "/." << this->GetTopLevel() << "rc";
kwsys_ios::ofstream *ofs = new kwsys_ios::ofstream(str.str().c_str(), kwsys_ios::ios::out); kwsys_ios::ofstream *ofs = new kwsys_ios::ofstream(str.str().c_str(), kwsys_ios::ios::out);
if ( !ofs ) if ( !ofs )
{ {
@ -531,9 +529,7 @@ bool RegistryHelper::Close()
*ofs << it->first.c_str() << " = " << this->EncodeValue(it->second.c_str()).c_str() << kwsys_ios::endl; *ofs << it->first.c_str() << " = " << this->EncodeValue(it->second.c_str()).c_str() << kwsys_ios::endl;
} }
} }
this->EntriesMap.erase( this->EntriesMap.clear();
this->EntriesMap.begin(),
this->EntriesMap.end());
ofs->close(); ofs->close();
delete ofs; delete ofs;
this->SetSubKey(0); this->SetSubKey(0);
@ -673,7 +669,8 @@ kwsys_stl::string RegistryHelper::CreateKey( const char *key )
return ""; return "";
} }
kwsys_ios::ostringstream ostr; kwsys_ios::ostringstream ostr;
ostr << this->EncodeKey(this->m_SubKey.c_str()) << "\\" << this->EncodeKey(key); ostr << this->EncodeKey(this->m_SubKey.c_str()).c_str()
<< "\\" << this->EncodeKey(key).c_str();
return ostr.str(); return ostr.str();
} }

View File

@ -85,7 +85,7 @@ public:
} }
#endif #endif
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)) #if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) ||defined(__BORLANDC__) || defined(__MINGW32__))
#include <io.h> #include <io.h>
#include <direct.h> #include <direct.h>
#define _unlink unlink #define _unlink unlink
@ -99,8 +99,15 @@ public:
#else #else
# define KWSYS_SYSTEMTOOLS_MAXPATH 16384 # define KWSYS_SYSTEMTOOLS_MAXPATH 16384
#endif #endif
#if defined(__WATCOMC__)
#include <direct.h>
#define _mkdir mkdir
#define _rmdir rmdir
#define _getcwd getcwd
#define _chdir chdir
#endif
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)) #if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
inline int Mkdir(const char* dir) inline int Mkdir(const char* dir)
{ {
return _mkdir(dir); return _mkdir(dir);
@ -1856,7 +1863,11 @@ kwsys_stl::string SystemTools
SystemTools::GetPath(path, "CMAKE_FILE_PATH"); SystemTools::GetPath(path, "CMAKE_FILE_PATH");
SystemTools::GetPath(path); SystemTools::GetPath(path);
// now add the additional paths // now add the additional paths
path.insert(path.end(), userPaths.begin(), userPaths.end()); for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
i != userPaths.end(); ++i)
{
path.push_back(*i);
}
// now look for the file // now look for the file
kwsys_stl::string tryPath; kwsys_stl::string tryPath;
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin(); for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
@ -1911,8 +1922,11 @@ kwsys_stl::string SystemTools::FindProgram(
} }
// now add the additional paths // now add the additional paths
path.insert(path.end(), userPaths.begin(), userPaths.end()); for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
i != userPaths.end(); ++i)
{
path.push_back(*i);
}
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin(); for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
p != path.end(); ++p) p != path.end(); ++p)
{ {
@ -1987,7 +2001,11 @@ kwsys_stl::string SystemTools
kwsys_stl::vector<kwsys_stl::string> path; kwsys_stl::vector<kwsys_stl::string> path;
SystemTools::GetPath(path); SystemTools::GetPath(path);
// now add the additional paths // now add the additional paths
path.insert(path.end(), userPaths.begin(), userPaths.end()); for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
i != userPaths.end(); ++i)
{
path.push_back(*i);
}
kwsys_stl::string tryPath; kwsys_stl::string tryPath;
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin(); for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
p != path.end(); ++p) p != path.end(); ++p)

View File

@ -18,6 +18,7 @@
#include <@KWSYS_NAMESPACE@/stl/string> #include <@KWSYS_NAMESPACE@/stl/string>
#include <@KWSYS_NAMESPACE@/stl/vector> #include <@KWSYS_NAMESPACE@/stl/vector>
#include <@KWSYS_NAMESPACE@/stl/map> #include <@KWSYS_NAMESPACE@/stl/map>
#include <@KWSYS_NAMESPACE@/stl/algorithm>
#include <@KWSYS_NAMESPACE@/Configure.h> #include <@KWSYS_NAMESPACE@/Configure.h>

View File

@ -26,7 +26,16 @@ int main() { return 0; }
#ifdef TEST_KWSYS_IOS_USE_SSTREAM #ifdef TEST_KWSYS_IOS_USE_SSTREAM
#include <sstream> #include <sstream>
int main() { return 0; } int main()
{
std::ostringstream ostr;
ostr << "hello";
if(ostr.str().size() == 5)
{
return 0;
}
return -1;
}
#endif #endif
#ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H

View File

@ -16,6 +16,7 @@
#include KWSYS_HEADER(Registry.hxx) #include KWSYS_HEADER(Registry.hxx)
#include KWSYS_HEADER(ios/iostream) #include KWSYS_HEADER(ios/iostream)
#include <string.h>
// Work-around CMake dependency scanning limitation. This must // Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers. // duplicate the above list of headers.

View File

@ -19,7 +19,10 @@ LINK_LIBRARIES(${COMPLEX_LIBS})
ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(A A.cxx)
ADD_EXECUTABLE(complex complex testcflags.c) ADD_EXECUTABLE(complex complex testcflags.c)
ADD_EXECUTABLE(complex.file complex.file.cxx) ADD_EXECUTABLE(complex.file complex.file.cxx)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
IF (UNIX) IF (UNIX)
TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS})
ELSE(UNIX) ELSE(UNIX)

View File

@ -8,19 +8,44 @@
extern "C" { extern "C" {
#include "testConly.h" #include "testConly.h"
} }
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
#include "cmStandardIncludes.h" #include "cmStandardIncludes.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmDynamicLoader.h" #include "cmDynamicLoader.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmOrderLinkDirectories.h" #include "cmOrderLinkDirectories.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#else
#include <vector>
#include <string>
#include <iostream>
#include <string.h>
#endif
int cm_passed = 0; int cm_passed = 0;
int cm_failed = 0; int cm_failed = 0;
// ======================================================================
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
// ======================================================================
void cmPassed(const char* Message, const char* m2="")
{
std::cout << "Passed: " << Message << m2 << "\n";
cm_passed++;
}
#ifndef CMAKE_IS_REALLY_FUN #ifndef CMAKE_IS_REALLY_FUN
This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// Here is a stupid function that tries to use std::string methods // Here is a stupid function that tries to use std::string methods
// so that the dec cxx compiler will instantiate the stuff that // so that the dec cxx compiler will instantiate the stuff that
// we are using from the CMakeLib library.... // we are using from the CMakeLib library....
@ -99,43 +124,6 @@ bool TestLibraryOrder(bool shouldFail)
return ret; return ret;
} }
void ForceStringUse()
{
std::vector<std::string> v;
std::vector<std::string> v2;
v = v2;
std::string cachetest = CACHE_TEST_VAR_INTERNAL;
v.push_back(cachetest);
v2 = v;
std::string x(5,'x');
char buff[5];
x.copy(buff, 1, 0);
x[0] = 'a';
std::string::size_type pos = 0;
x.replace(pos, pos, pos, 'x');
std::string copy = cachetest;
cachetest.find("bar");
cachetest.rfind("bar");
copy.append(cachetest);
copy = cachetest.substr(0, cachetest.size());
}
// ======================================================================
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
// ======================================================================
void cmPassed(const char* Message, const char* m2="")
{
std::cout << "Passed: " << Message << m2 << "\n";
cm_passed++;
}
// ====================================================================== // ======================================================================
void TestAndRemoveFile(const char* filename) void TestAndRemoveFile(const char* filename)
@ -258,6 +246,30 @@ void TestCMGeneratedFileSTream()
cmSystemTools::RemoveFile(file2tmp.c_str()); cmSystemTools::RemoveFile(file2tmp.c_str());
cmSystemTools::RemoveFile(file3tmp.c_str()); cmSystemTools::RemoveFile(file3tmp.c_str());
} }
#endif
void ForceStringUse()
{
std::vector<std::string> v;
std::vector<std::string> v2;
v = v2;
std::string cachetest = CACHE_TEST_VAR_INTERNAL;
v.push_back(cachetest);
v2 = v;
std::string x(5,'x');
char buff[5];
x.copy(buff, 1, 0);
x[0] = 'a';
std::string::size_type pos = 0;
x.replace(pos, pos, pos, 'x');
std::string copy = cachetest;
cachetest.find("bar");
cachetest.rfind("bar");
copy.append(cachetest);
copy = cachetest.substr(0, cachetest.size());
}
// defined in testcflags.c // defined in testcflags.c
extern "C" int TestCFlags(char* m); extern "C" int TestCFlags(char* m);
@ -273,6 +285,7 @@ int main()
#endif #endif
std::string exe = lib; std::string exe = lib;
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// Test a single character executable to test a: in makefiles // Test a single character executable to test a: in makefiles
exe += "A"; exe += "A";
exe += cmSystemTools::GetExecutableExtension(); exe += cmSystemTools::GetExecutableExtension();
@ -352,6 +365,20 @@ int main()
cmPassed("Call to C sharedFunction from shared library worked."); cmPassed("Call to C sharedFunction from shared library worked.");
} }
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
#endif
if(file1() != 1) if(file1() != 1)
{ {
cmFailed("Call to file1 function from library failed."); cmFailed("Call to file1 function from library failed.");
@ -926,6 +953,7 @@ int main()
} }
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Some pre-build/pre-link/post-build custom-commands have been // Some pre-build/pre-link/post-build custom-commands have been
// attached to the lib (see Library/). // attached to the lib (see Library/).
@ -971,6 +999,7 @@ int main()
// only created during a build. // only created during a build.
TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt");
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Test FIND_LIBRARY // Test FIND_LIBRARY
@ -1087,19 +1116,6 @@ int main()
} }
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Test if IF command inside a FOREACH works. // Test if IF command inside a FOREACH works.
#if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED)
@ -1135,6 +1151,7 @@ int main()
cmPassed("CMake SET CACHE FORCE"); cmPassed("CMake SET CACHE FORCE");
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// first run with shouldFail = true, this will // first run with shouldFail = true, this will
// run with A B C as set by the CMakeList.txt file. // run with A B C as set by the CMakeList.txt file.
if(!TestLibraryOrder(true)) if(!TestLibraryOrder(true))
@ -1156,9 +1173,9 @@ int main()
{ {
cmFailed("CMake cmOrderLinkDirectories failed."); cmFailed("CMake cmOrderLinkDirectories failed.");
} }
// Test the generated file stream. // Test the generated file stream.
TestCMGeneratedFileSTream(); TestCMGeneratedFileSTream();
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Summary // Summary

View File

@ -4,6 +4,7 @@
#cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR #cmakedefine ZERO_VAR
#cmakedefine CMAKE_TEST_DIFFERENT_GENERATOR
#define STRING_VAR "${STRING_VAR}" #define STRING_VAR "${STRING_VAR}"
// Test FOREACH // Test FOREACH

View File

@ -19,7 +19,10 @@ LINK_LIBRARIES(${COMPLEX_LIBS})
ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(A A.cxx)
ADD_EXECUTABLE(complex complex testcflags.c) ADD_EXECUTABLE(complex complex testcflags.c)
ADD_EXECUTABLE(complex.file complex.file.cxx) ADD_EXECUTABLE(complex.file complex.file.cxx)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
IF (UNIX) IF (UNIX)
TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS})
ELSE(UNIX) ELSE(UNIX)

View File

@ -8,19 +8,44 @@
extern "C" { extern "C" {
#include "testConly.h" #include "testConly.h"
} }
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
#include "cmStandardIncludes.h" #include "cmStandardIncludes.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmDynamicLoader.h" #include "cmDynamicLoader.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmOrderLinkDirectories.h" #include "cmOrderLinkDirectories.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#else
#include <vector>
#include <string>
#include <iostream>
#include <string.h>
#endif
int cm_passed = 0; int cm_passed = 0;
int cm_failed = 0; int cm_failed = 0;
// ======================================================================
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
// ======================================================================
void cmPassed(const char* Message, const char* m2="")
{
std::cout << "Passed: " << Message << m2 << "\n";
cm_passed++;
}
#ifndef CMAKE_IS_REALLY_FUN #ifndef CMAKE_IS_REALLY_FUN
This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// Here is a stupid function that tries to use std::string methods // Here is a stupid function that tries to use std::string methods
// so that the dec cxx compiler will instantiate the stuff that // so that the dec cxx compiler will instantiate the stuff that
// we are using from the CMakeLib library.... // we are using from the CMakeLib library....
@ -99,43 +124,6 @@ bool TestLibraryOrder(bool shouldFail)
return ret; return ret;
} }
void ForceStringUse()
{
std::vector<std::string> v;
std::vector<std::string> v2;
v = v2;
std::string cachetest = CACHE_TEST_VAR_INTERNAL;
v.push_back(cachetest);
v2 = v;
std::string x(5,'x');
char buff[5];
x.copy(buff, 1, 0);
x[0] = 'a';
std::string::size_type pos = 0;
x.replace(pos, pos, pos, 'x');
std::string copy = cachetest;
cachetest.find("bar");
cachetest.rfind("bar");
copy.append(cachetest);
copy = cachetest.substr(0, cachetest.size());
}
// ======================================================================
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
// ======================================================================
void cmPassed(const char* Message, const char* m2="")
{
std::cout << "Passed: " << Message << m2 << "\n";
cm_passed++;
}
// ====================================================================== // ======================================================================
void TestAndRemoveFile(const char* filename) void TestAndRemoveFile(const char* filename)
@ -258,6 +246,30 @@ void TestCMGeneratedFileSTream()
cmSystemTools::RemoveFile(file2tmp.c_str()); cmSystemTools::RemoveFile(file2tmp.c_str());
cmSystemTools::RemoveFile(file3tmp.c_str()); cmSystemTools::RemoveFile(file3tmp.c_str());
} }
#endif
void ForceStringUse()
{
std::vector<std::string> v;
std::vector<std::string> v2;
v = v2;
std::string cachetest = CACHE_TEST_VAR_INTERNAL;
v.push_back(cachetest);
v2 = v;
std::string x(5,'x');
char buff[5];
x.copy(buff, 1, 0);
x[0] = 'a';
std::string::size_type pos = 0;
x.replace(pos, pos, pos, 'x');
std::string copy = cachetest;
cachetest.find("bar");
cachetest.rfind("bar");
copy.append(cachetest);
copy = cachetest.substr(0, cachetest.size());
}
// defined in testcflags.c // defined in testcflags.c
extern "C" int TestCFlags(char* m); extern "C" int TestCFlags(char* m);
@ -273,6 +285,7 @@ int main()
#endif #endif
std::string exe = lib; std::string exe = lib;
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// Test a single character executable to test a: in makefiles // Test a single character executable to test a: in makefiles
exe += "A"; exe += "A";
exe += cmSystemTools::GetExecutableExtension(); exe += cmSystemTools::GetExecutableExtension();
@ -352,6 +365,20 @@ int main()
cmPassed("Call to C sharedFunction from shared library worked."); cmPassed("Call to C sharedFunction from shared library worked.");
} }
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
#endif
if(file1() != 1) if(file1() != 1)
{ {
cmFailed("Call to file1 function from library failed."); cmFailed("Call to file1 function from library failed.");
@ -926,6 +953,7 @@ int main()
} }
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Some pre-build/pre-link/post-build custom-commands have been // Some pre-build/pre-link/post-build custom-commands have been
// attached to the lib (see Library/). // attached to the lib (see Library/).
@ -971,6 +999,7 @@ int main()
// only created during a build. // only created during a build.
TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt");
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Test FIND_LIBRARY // Test FIND_LIBRARY
@ -1087,19 +1116,6 @@ int main()
} }
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Test if IF command inside a FOREACH works. // Test if IF command inside a FOREACH works.
#if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED)
@ -1135,6 +1151,7 @@ int main()
cmPassed("CMake SET CACHE FORCE"); cmPassed("CMake SET CACHE FORCE");
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// first run with shouldFail = true, this will // first run with shouldFail = true, this will
// run with A B C as set by the CMakeList.txt file. // run with A B C as set by the CMakeList.txt file.
if(!TestLibraryOrder(true)) if(!TestLibraryOrder(true))
@ -1156,9 +1173,9 @@ int main()
{ {
cmFailed("CMake cmOrderLinkDirectories failed."); cmFailed("CMake cmOrderLinkDirectories failed.");
} }
// Test the generated file stream. // Test the generated file stream.
TestCMGeneratedFileSTream(); TestCMGeneratedFileSTream();
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Summary // Summary

View File

@ -4,6 +4,7 @@
#cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR #cmakedefine ZERO_VAR
#cmakedefine CMAKE_TEST_DIFFERENT_GENERATOR
#define STRING_VAR "${STRING_VAR}" #define STRING_VAR "${STRING_VAR}"
// Test FOREACH // Test FOREACH

View File

@ -19,7 +19,10 @@ LINK_LIBRARIES(${COMPLEX_LIBS})
ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(A A.cxx)
ADD_EXECUTABLE(complex complex testcflags.c) ADD_EXECUTABLE(complex complex testcflags.c)
ADD_EXECUTABLE(complex.file complex.file.cxx) ADD_EXECUTABLE(complex.file complex.file.cxx)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
IF (UNIX) IF (UNIX)
TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS})
ELSE(UNIX) ELSE(UNIX)

View File

@ -8,19 +8,44 @@
extern "C" { extern "C" {
#include "testConly.h" #include "testConly.h"
} }
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
#include "cmStandardIncludes.h" #include "cmStandardIncludes.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmDynamicLoader.h" #include "cmDynamicLoader.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmOrderLinkDirectories.h" #include "cmOrderLinkDirectories.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#else
#include <vector>
#include <string>
#include <iostream>
#include <string.h>
#endif
int cm_passed = 0; int cm_passed = 0;
int cm_failed = 0; int cm_failed = 0;
// ======================================================================
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
// ======================================================================
void cmPassed(const char* Message, const char* m2="")
{
std::cout << "Passed: " << Message << m2 << "\n";
cm_passed++;
}
#ifndef CMAKE_IS_REALLY_FUN #ifndef CMAKE_IS_REALLY_FUN
This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// Here is a stupid function that tries to use std::string methods // Here is a stupid function that tries to use std::string methods
// so that the dec cxx compiler will instantiate the stuff that // so that the dec cxx compiler will instantiate the stuff that
// we are using from the CMakeLib library.... // we are using from the CMakeLib library....
@ -99,43 +124,6 @@ bool TestLibraryOrder(bool shouldFail)
return ret; return ret;
} }
void ForceStringUse()
{
std::vector<std::string> v;
std::vector<std::string> v2;
v = v2;
std::string cachetest = CACHE_TEST_VAR_INTERNAL;
v.push_back(cachetest);
v2 = v;
std::string x(5,'x');
char buff[5];
x.copy(buff, 1, 0);
x[0] = 'a';
std::string::size_type pos = 0;
x.replace(pos, pos, pos, 'x');
std::string copy = cachetest;
cachetest.find("bar");
cachetest.rfind("bar");
copy.append(cachetest);
copy = cachetest.substr(0, cachetest.size());
}
// ======================================================================
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
// ======================================================================
void cmPassed(const char* Message, const char* m2="")
{
std::cout << "Passed: " << Message << m2 << "\n";
cm_passed++;
}
// ====================================================================== // ======================================================================
void TestAndRemoveFile(const char* filename) void TestAndRemoveFile(const char* filename)
@ -258,6 +246,30 @@ void TestCMGeneratedFileSTream()
cmSystemTools::RemoveFile(file2tmp.c_str()); cmSystemTools::RemoveFile(file2tmp.c_str());
cmSystemTools::RemoveFile(file3tmp.c_str()); cmSystemTools::RemoveFile(file3tmp.c_str());
} }
#endif
void ForceStringUse()
{
std::vector<std::string> v;
std::vector<std::string> v2;
v = v2;
std::string cachetest = CACHE_TEST_VAR_INTERNAL;
v.push_back(cachetest);
v2 = v;
std::string x(5,'x');
char buff[5];
x.copy(buff, 1, 0);
x[0] = 'a';
std::string::size_type pos = 0;
x.replace(pos, pos, pos, 'x');
std::string copy = cachetest;
cachetest.find("bar");
cachetest.rfind("bar");
copy.append(cachetest);
copy = cachetest.substr(0, cachetest.size());
}
// defined in testcflags.c // defined in testcflags.c
extern "C" int TestCFlags(char* m); extern "C" int TestCFlags(char* m);
@ -273,6 +285,7 @@ int main()
#endif #endif
std::string exe = lib; std::string exe = lib;
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// Test a single character executable to test a: in makefiles // Test a single character executable to test a: in makefiles
exe += "A"; exe += "A";
exe += cmSystemTools::GetExecutableExtension(); exe += cmSystemTools::GetExecutableExtension();
@ -352,6 +365,20 @@ int main()
cmPassed("Call to C sharedFunction from shared library worked."); cmPassed("Call to C sharedFunction from shared library worked.");
} }
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
#endif
if(file1() != 1) if(file1() != 1)
{ {
cmFailed("Call to file1 function from library failed."); cmFailed("Call to file1 function from library failed.");
@ -926,6 +953,7 @@ int main()
} }
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Some pre-build/pre-link/post-build custom-commands have been // Some pre-build/pre-link/post-build custom-commands have been
// attached to the lib (see Library/). // attached to the lib (see Library/).
@ -971,6 +999,7 @@ int main()
// only created during a build. // only created during a build.
TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt");
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Test FIND_LIBRARY // Test FIND_LIBRARY
@ -1087,19 +1116,6 @@ int main()
} }
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Test if IF command inside a FOREACH works. // Test if IF command inside a FOREACH works.
#if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED)
@ -1135,6 +1151,7 @@ int main()
cmPassed("CMake SET CACHE FORCE"); cmPassed("CMake SET CACHE FORCE");
#endif #endif
#ifndef CMAKE_TEST_DIFFERENT_GENERATOR
// first run with shouldFail = true, this will // first run with shouldFail = true, this will
// run with A B C as set by the CMakeList.txt file. // run with A B C as set by the CMakeList.txt file.
if(!TestLibraryOrder(true)) if(!TestLibraryOrder(true))
@ -1156,9 +1173,9 @@ int main()
{ {
cmFailed("CMake cmOrderLinkDirectories failed."); cmFailed("CMake cmOrderLinkDirectories failed.");
} }
// Test the generated file stream. // Test the generated file stream.
TestCMGeneratedFileSTream(); TestCMGeneratedFileSTream();
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Summary // Summary

View File

@ -4,6 +4,7 @@
#cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR #cmakedefine ZERO_VAR
#cmakedefine CMAKE_TEST_DIFFERENT_GENERATOR
#define STRING_VAR "${STRING_VAR}" #define STRING_VAR "${STRING_VAR}"
// Test FOREACH // Test FOREACH

View File

@ -6,8 +6,13 @@ ENDIF (MUDSLIDE_TYPE MATCHES MUCHO)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
IF(WATCOM)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
ENDIF(WATCOM)
INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
IF(WATCOM)
TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib)
ENDIF(WATCOM)

View File

@ -10,9 +10,8 @@ typedef struct
char** Argv; char** Argv;
} cmVTKWrapTclData; } cmVTKWrapTclData;
/* do almost everything in the initial pass */ /* do almost everything in the initial pass */
static int InitialPass(void *inf, void *mf, int argc, char *argv[]) static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
{ {
char* file; char* file;
char* str; char* str;
@ -134,7 +133,7 @@ static int InitialPass(void *inf, void *mf, int argc, char *argv[])
return 1; return 1;
} }
static void FinalPass(void *inf, void *mf) static void CCONV FinalPass(void *inf, void *mf)
{ {
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
/* get our client data from initial pass */ /* get our client data from initial pass */
@ -146,8 +145,7 @@ static void FinalPass(void *inf, void *mf)
fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n"); fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n");
} }
} }
static void CCONV Destructor(void *inf)
static void Destructor(void *inf)
{ {
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
/* get our client data from initial pass */ /* get our client data from initial pass */
@ -157,7 +155,7 @@ static void Destructor(void *inf)
} }
#ifdef MUCHO_MUDSLIDE #ifdef MUCHO_MUDSLIDE
void CM_PLUGIN_EXPORT CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info) void CM_PLUGIN_EXPORT CCONV CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info)
{ {
info->InitialPass = InitialPass; info->InitialPass = InitialPass;
info->FinalPass = FinalPass; info->FinalPass = FinalPass;

View File

@ -6,8 +6,13 @@ ENDIF (MUDSLIDE_TYPE MATCHES MUCHO)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
IF(WATCOM)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
ENDIF(WATCOM)
INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
IF(WATCOM)
TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib)
ENDIF(WATCOM)

View File

@ -10,9 +10,8 @@ typedef struct
char** Argv; char** Argv;
} cmVTKWrapTclData; } cmVTKWrapTclData;
/* do almost everything in the initial pass */ /* do almost everything in the initial pass */
static int InitialPass(void *inf, void *mf, int argc, char *argv[]) static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
{ {
char* file; char* file;
char* str; char* str;
@ -134,7 +133,7 @@ static int InitialPass(void *inf, void *mf, int argc, char *argv[])
return 1; return 1;
} }
static void FinalPass(void *inf, void *mf) static void CCONV FinalPass(void *inf, void *mf)
{ {
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
/* get our client data from initial pass */ /* get our client data from initial pass */
@ -146,8 +145,7 @@ static void FinalPass(void *inf, void *mf)
fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n"); fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n");
} }
} }
static void CCONV Destructor(void *inf)
static void Destructor(void *inf)
{ {
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
/* get our client data from initial pass */ /* get our client data from initial pass */
@ -157,7 +155,7 @@ static void Destructor(void *inf)
} }
#ifdef MUCHO_MUDSLIDE #ifdef MUCHO_MUDSLIDE
void CM_PLUGIN_EXPORT CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info) void CM_PLUGIN_EXPORT CCONV CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info)
{ {
info->InitialPass = InitialPass; info->InitialPass = InitialPass;
info->FinalPass = FinalPass; info->FinalPass = FinalPass;

View File

@ -0,0 +1,6 @@
#include <stdio.h>
void pair_stuff()
{
printf("Placeholder for a strange file in subdirectory\n");
}

View File

@ -1,16 +1,45 @@
PROJECT(SUBDIR) PROJECT(SUBDIR)
SUBDIRS(Executable EXCLUDE_FROM_ALL Examples) SUBDIRS(Executable EXCLUDE_FROM_ALL Examples)
WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
#WATCOM WMAKE does not support + in the name of a file!
IF(WATCOM)
SET(PLUS_NAME_FILES
AnotherSubdir/pair_int.int.c
vcl_algorithm_vcl_pair_double.foo.c)
ELSE(WATCOM)
SET(PLUS_NAME_FILES
AnotherSubdir/pair+int.int.c
vcl_algorithm+vcl_pair+double.foo.c)
ENDIF(WATCOM)
ADD_EXECUTABLE(TestFromSubdir ADD_EXECUTABLE(TestFromSubdir
AnotherSubdir/testfromsubdir.c AnotherSubdir/testfromsubdir.c
AnotherSubdir/secondone AnotherSubdir/secondone
AnotherSubdir/pair+int.int.c ${PLUS_NAME_FILES}
vcl_algorithm+vcl_pair+double.foo.c
) )
AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES) AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
SET(SOURCES ${SOURCES} IF(WATCOM)
vcl_algorithm+vcl_pair+double.foo.c) FOREACH(f ${SOURCES})
IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
SET(SOURCES2 ${f} ${SOURCES2})
ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
ENDFOREACH(f)
SET(SOURCES ${SOURCES2})
SET(SOURCES ${SOURCES}
vcl_algorithm_vcl_pair_double.foo.c)
ELSE(WATCOM)
FOREACH(f ${SOURCES})
IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
SET(SOURCES2 ${f} ${SOURCES2})
MESSAGE("${f}")
ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
ENDFOREACH(f)
SET(SOURCES ${SOURCES2})
SET(SOURCES ${SOURCES}
vcl_algorithm+vcl_pair+double.foo.c)
ENDIF(WATCOM)
MESSAGE("Sources: ${SOURCES}") MESSAGE("Sources: ${SOURCES}")
ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES}) ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})

View File

@ -0,0 +1,6 @@
#include <stdio.h>
void pair_stuff()
{
printf("Placeholder for a strange file in subdirectory\n");
}

View File

@ -0,0 +1,6 @@
#include <stdio.h>
void vcl_stuff()
{
printf("Placeholder for a file with strange name\n");
}

View File

@ -1,7 +1,7 @@
#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@
#ifdef CHECK_TYPE_SIZE_TYPE #ifdef CHECK_TYPE_SIZE_TYPE
@CHECK_TYPE_SIZE_PREINCLUDE@ @CHECK_TYPE_SIZE_PREINCLUDE@
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
# include <sys/types.h> # include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */ #endif /* HAVE_SYS_TYPES_H */

View File

@ -1,28 +1,28 @@
# # - Check sizeof a type
# CHECK_TYPE_SIZE(TYPE VARIABLE)
# Check if the type exists and determine size of type. if the type # Check if the type exists and determine size of type. if the type
# exists, the size will be stored to the variable. # exists, the size will be stored to the variable.
# #
# CHECK_TYPE_SIZE - macro which checks the size of type # VARIABLE - variable to store size if the type exists.
# VARIABLE - variable to store size if the type exists. # HAVE_${VARIABLE} - does the variable exists or not
# HAVE_${VARIABLE} - does the variable exists or not
#
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}") "${CMAKE_REQUIRED_FLAGS}")
FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H) FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
IF("${def}") IF("${def}")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
ENDIF("${def}") ENDIF("${def}")
ENDFOREACH(def) ENDFOREACH(def)
SET(CHECK_TYPE_SIZE_PREMAIN) SET(CHECK_TYPE_SIZE_PREINCLUDE)
FOREACH(def ${CMAKE_EXTRA_INCLUDE_FILES}) FOREACH(def ${CMAKE_EXTRA_INCLUDE_FILES})
SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n") SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
ENDFOREACH(def) ENDFOREACH(def)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in" CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CheckTypeSize.c.in"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" IMMEDIATE @ONLY) "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" IMMEDIATE @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" FILE(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CHECK_TYPE_SIZE_FILE_CONTENT) CHECK_TYPE_SIZE_FILE_CONTENT)
@ -39,11 +39,11 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(HAVE_${VARIABLE}) IF(HAVE_${VARIABLE})
MESSAGE(STATUS "Check size of ${TYPE} - done") MESSAGE(STATUS "Check size of ${TYPE} - done")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n") "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
ELSE(HAVE_${VARIABLE}) ELSE(HAVE_${VARIABLE})
MESSAGE(STATUS "Check size of ${TYPE} - failed") MESSAGE(STATUS "Check size of ${TYPE} - failed")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n") "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
ENDIF(HAVE_${VARIABLE}) ENDIF(HAVE_${VARIABLE})
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")

View File

@ -252,7 +252,6 @@ CHECK_INCLUDE_FILE_CONCAT("setjmp.h" HAVE_SETJMP_H)
CHECK_INCLUDE_FILE_CONCAT("signal.h" HAVE_SIGNAL_H) CHECK_INCLUDE_FILE_CONCAT("signal.h" HAVE_SIGNAL_H)
CHECK_INCLUDE_FILE_CONCAT("sys/ioctl.h" HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILE_CONCAT("sys/ioctl.h" HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILE_CONCAT("sys/utsname.h" HAVE_SYS_UTSNAME_H) CHECK_INCLUDE_FILE_CONCAT("sys/utsname.h" HAVE_SYS_UTSNAME_H)
CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T) CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T)
CHECK_TYPE_SIZE(ssize_t SIZEOF_SSIZE_T) CHECK_TYPE_SIZE(ssize_t SIZEOF_SSIZE_T)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)

View File

@ -51,7 +51,6 @@ IF(NOT UNIX)
SET(HAVE_ZLIB_H 0) SET(HAVE_ZLIB_H 0)
SET(HAVE_SIZEOF_LONG_DOUBLE 1) SET(HAVE_SIZEOF_LONG_DOUBLE 1)
SET(HAVE_SIZEOF_SSIZE_T 0)
SET(SIZEOF_LONG_DOUBLE 8) SET(SIZEOF_LONG_DOUBLE 8)
SET(HAVE_SOCKET 1) SET(HAVE_SOCKET 1)

View File

@ -37,7 +37,7 @@
#endif #endif
#ifndef HAVE_GETTIMEOFDAY #ifndef HAVE_GETTIMEOFDAY
#if !defined(_WINSOCKAPI_) && !defined(__MINGW32__) && !defined(_AMIGASF) && \ #if !defined(_WINSOCKAPI_) && !defined(__WATCOMC__) && !defined(__MINGW32__) && !defined(_AMIGASF) && \
!defined(__LCC__) !defined(__LCC__)
struct timeval { struct timeval {
long tv_sec; long tv_sec;

View File

@ -24,7 +24,7 @@
# include <stdlib.h> # include <stdlib.h>
#endif #endif
#ifdef _MSC_VER #if defined ( _MSC_VER) || defined(__WATCOMC__)
#include <io.h> #include <io.h>
//Yogi: hack. this should work on windows where there is no O_ACCMODE defined //Yogi: hack. this should work on windows where there is no O_ACCMODE defined
#ifndef O_ACCMODE #ifndef O_ACCMODE

View File

@ -75,6 +75,13 @@ struct gzStruct
gzFile* GZFile; gzFile* GZFile;
}; };
struct gzStruct GZStruct; struct gzStruct GZStruct;
#if defined ( _MSC_VER) || defined(__WATCOMC__)
#include <io.h>
//Yogi: hack. this should work on windows where there is no O_ACCMODE defined
#ifndef O_ACCMODE
# define O_ACCMODE 0x0003
#endif
#endif
int libtar_gzopen(void* call_data, const char *pathname, int oflags, mode_t mode) int libtar_gzopen(void* call_data, const char *pathname, int oflags, mode_t mode)
{ {