diff options
author | Brad King <brad.king@kitware.com> | 2016-09-01 19:38:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-05 13:45:42 (GMT) |
commit | 72ecdd34cf6dbec293fe020e1aeed0a17a499061 (patch) | |
tree | 6d9f59439c08feda95de1e24663e9805db8569d5 /Tests | |
parent | fc3dab0ea956db618fe2b77778ac413db846b422 (diff) | |
download | CMake-72ecdd34cf6dbec293fe020e1aeed0a17a499061.zip CMake-72ecdd34cf6dbec293fe020e1aeed0a17a499061.tar.gz CMake-72ecdd34cf6dbec293fe020e1aeed0a17a499061.tar.bz2 |
Tests: Cleanup RunCMake.GenerateExportHeader somewhat
Diffstat (limited to 'Tests')
11 files changed, 14 insertions, 51 deletions
diff --git a/Tests/RunCMake/GenerateExportHeader/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/CMakeLists.txt index fb4d95e..dc92486 100644 --- a/Tests/RunCMake/GenerateExportHeader/CMakeLists.txt +++ b/Tests/RunCMake/GenerateExportHeader/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.5) +cmake_minimum_required(VERSION 3.6) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GenerateExportHeader/GEH-stderr.txt b/Tests/RunCMake/GenerateExportHeader/GEH-stderr.txt deleted file mode 100644 index 8d98f9d..0000000 --- a/Tests/RunCMake/GenerateExportHeader/GEH-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -.* diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake index e2a2a3b..ee0871b 100644 --- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake +++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake @@ -1,23 +1,8 @@ -cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) -cmake_policy(SET CMP0054 NEW) +# Test add_compiler_export_flags without deprecation warning. +set(CMAKE_WARN_DEPRECATED OFF) project(GenerateExportHeader) -# Prevent timeout on Watcom by not running the tests. -if ("${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom) - file(WRITE - "${CMAKE_CURRENT_BINARY_DIR}/main.cxx" - "int main() { return 0; } - " - ) - - add_executable( - GenerateExportHeader - "${CMAKE_CURRENT_BINARY_DIR}/main.cxx" - ) - return() -endif() - include(CheckCXXCompilerFlag) set( CMAKE_INCLUDE_CURRENT_DIR ON ) @@ -80,16 +65,16 @@ add_compiler_export_flags() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) -message("#### COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED}) -message("#### COMPILER_HAS_HIDDEN_VISIBILITY: " ${COMPILER_HAS_HIDDEN_VISIBILITY}) -message("#### WIN32: " ${WIN32}) -message("#### HAS_WERROR_FLAG: " ${HAS_WERROR_FLAG}) +message(STATUS "COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED}) +message(STATUS "COMPILER_HAS_HIDDEN_VISIBILITY: " ${COMPILER_HAS_HIDDEN_VISIBILITY}) +message(STATUS "WIN32: " ${WIN32}) +message(STATUS "HAS_WERROR_FLAG: " ${HAS_WERROR_FLAG}) set(link_libraries) macro(macro_add_test_library name) add_subdirectory(${name}) include_directories(${name} - ${${name}_BINARY_DIR} # For the export header. + ${CMAKE_CURRENT_BINARY_DIR}/${name} # For the export header. ) list(APPEND link_libraries ${name}) endmacro() @@ -132,7 +117,7 @@ elseif(COMPILER_HAS_DEPRECATED) else() set(_platform Empty) endif() -message("#### Testing reference: ${_platform}") +message(STATUS "Testing reference: ${_platform}") target_compile_definitions(GenerateExportHeader PRIVATE "SRC_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}\"" diff --git a/Tests/RunCMake/GenerateExportHeader/c_identifier/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/c_identifier/CMakeLists.txt index 9f8c8ef..77c18e0 100644 --- a/Tests/RunCMake/GenerateExportHeader/c_identifier/CMakeLists.txt +++ b/Tests/RunCMake/GenerateExportHeader/c_identifier/CMakeLists.txt @@ -1,5 +1,3 @@ -project(c_identifier) - set(c_identifier_lib_SRCS c_identifier_class.cpp ) diff --git a/Tests/RunCMake/GenerateExportHeader/c_identifier/main.cpp b/Tests/RunCMake/GenerateExportHeader/c_identifier/main.cpp index 891bc42..887d777 100644 --- a/Tests/RunCMake/GenerateExportHeader/c_identifier/main.cpp +++ b/Tests/RunCMake/GenerateExportHeader/c_identifier/main.cpp @@ -1,7 +1,7 @@ #include "c_identifier_class.h" -int main(int argc, char** argv) +int main() { CIdentifierClass cic; return cic.someMethod(); diff --git a/Tests/RunCMake/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt index a057746..ff81f35 100644 --- a/Tests/RunCMake/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt +++ b/Tests/RunCMake/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt @@ -1,8 +1,3 @@ - -cmake_minimum_required(VERSION 2.8) - -project(lib_shared_and_static) - include(GenerateExportHeader) set(CMAKE_CXX_VISIBILITY_PRESET hidden) @@ -33,6 +28,6 @@ generate_export_header(shared_variant CUSTOM_CONTENT_FROM_VARIABLE MY_CUSTOM_CONTENT ) -set_target_properties(static_variant PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE) +target_compile_definitions(static_variant PUBLIC MYPREFIX_LIBSHARED_AND_STATIC_STATIC_DEFINE) export(TARGETS shared_variant static_variant FILE Targets.cmake) diff --git a/Tests/RunCMake/GenerateExportHeader/libshared/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/libshared/CMakeLists.txt index e20adb1..c4a761c 100644 --- a/Tests/RunCMake/GenerateExportHeader/libshared/CMakeLists.txt +++ b/Tests/RunCMake/GenerateExportHeader/libshared/CMakeLists.txt @@ -1,8 +1,3 @@ - -cmake_minimum_required(VERSION 2.8) - -project(libshared) - include(GenerateExportHeader) add_compiler_export_flags() diff --git a/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt index b2db3ea..0fd136c 100644 --- a/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt +++ b/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt @@ -1,8 +1,3 @@ - -cmake_minimum_required(VERSION 2.8) - -project(libstatic) - set(CMAKE_INCLUDE_CURRENT_DIR ON) include(GenerateExportHeader) diff --git a/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt index aeeb13a..7822d9c 100644 --- a/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt +++ b/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt @@ -1,7 +1,3 @@ -cmake_minimum_required(VERSION 2.8) - -project(nodeprecated) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined) @@ -23,4 +19,4 @@ try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined_build OUTPUT_VARIABLE Out ) -test_fail(Result "Built even with no-deprecated define")
\ No newline at end of file +test_fail(Result "Built even with no-deprecated define") diff --git a/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt.in b/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt.in index d8dc482..90cfa12 100644 --- a/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt.in +++ b/Tests/RunCMake/GenerateExportHeader/nodeprecated/CMakeLists.txt.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.6) project(nodeprecated_test) diff --git a/Tests/RunCMake/GenerateExportHeader/nodeprecated/src/main.cpp b/Tests/RunCMake/GenerateExportHeader/nodeprecated/src/main.cpp index eec46d3..f90d098 100644 --- a/Tests/RunCMake/GenerateExportHeader/nodeprecated/src/main.cpp +++ b/Tests/RunCMake/GenerateExportHeader/nodeprecated/src/main.cpp @@ -1,7 +1,7 @@ #include "someclass.h" -int main(int, char**) +int main() { SomeClass sc; sc.someMethod(); |