diff --git a/CMakeLists.txt b/CMakeLists.txt index a80796b441..d1621000cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ option(V8_SNAPSHOT "turn on snapshot when building stock v8") # cmake policies to get rid of some warnings -cmake_policy(SET CMP0009 NEW) +cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks # generic cmake configuration include("cmake/configure.cmake") @@ -27,10 +27,12 @@ include("cmake/node_build.cmake") include("cmake/v8_build.cmake") # docs +## might want to move this to doc/CMakeLists.txt include("cmake/docs.cmake") # tests -include("cmake/tests.cmake") +enable_testing() +add_subdirectory("test/") # package include("cmake/package.cmake") @@ -64,7 +66,7 @@ message(" RT library: ${RT}") message(" DL library: ${DL}") if(${OPENSSL_FOUND} MATCHES TRUE) - message(" OpenSSL: Found!") + message(" OpenSSL: ${OPENSSL_LIBRARIES}") endif() # message(" CCFLAGS: ${CCFLAGS}") diff --git a/cmake/v8_build.cmake b/cmake/v8_build.cmake index 3f31e35325..ce86e98904 100644 --- a/cmake/v8_build.cmake +++ b/cmake/v8_build.cmake @@ -35,8 +35,7 @@ if(NOT SHARED_V8) PROPERTY IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}) - - if(CMAKE_VERSION VERSION_GREATER 2.8) + if(CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8) # use ExternalProject for CMake >2.8 include(ExternalProject) @@ -55,7 +54,7 @@ if(NOT SHARED_V8) ) add_dependencies(node v8_extprj) - else(CAMKE_VERSION VERSION_GREATER 2.8) + else() # copy v8 sources inefficiently with CMake versions <2.8 file(GLOB_RECURSE v8_sources RELATIVE ${PROJECT_SOURCE_DIR} deps/v8/*) diff --git a/deps/libeio/CMakeLists.txt b/deps/libeio/CMakeLists.txt index 78224db75c..2d0a26df94 100644 --- a/deps/libeio/CMakeLists.txt +++ b/deps/libeio/CMakeLists.txt @@ -5,7 +5,6 @@ if(!${CMAKE_USE_PTHREADS_INIT}) message(FATAL_ERROR "Unable to find pthreads") endif() -include_directories(${platform}) add_definitions(-DHAVE_CONFIG_H=1 -D_GNU_SOURCE) check_function_exists(futimes HAVE_FUTIMES) diff --git a/cmake/tests.cmake b/test/CMakeLists.txt similarity index 91% rename from cmake/tests.cmake rename to test/CMakeLists.txt index fb24e44b32..6c4d05e2b1 100644 --- a/cmake/tests.cmake +++ b/test/CMakeLists.txt @@ -10,12 +10,12 @@ else() get_target_property(node_bin node LOCATION) endif() -enable_testing() file(GLOB_RECURSE node_tests ${CMAKE_SOURCE_DIR}/test/*) +# add all tests with add_test foreach(test ${node_tests}) - if(test MATCHES ".*/test-[^./\ ]*.\\.js" AND NOT test MATCHES ".*disabled.*" - AND NOT test MATCHES ".*pummel.*") + if(test MATCHES ".*/test-[^./\ ]*.\\.js" + AND NOT test MATCHES ".*disabled.*") # build a fancy name for each test string(REPLACE ${CMAKE_SOURCE_DIR}/test/ "" test_name ${test}) @@ -27,6 +27,8 @@ foreach(test ${node_tests}) endif() endforeach() +# the CTest custom config makes ctest recreate the tmp directory before and after +# each run configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake COPYONLY) add_custom_command(