Skip to content

Commit ea29cb4

Browse files
Daniel Gröberthughes
authored andcommitted
cmake cleanup
* Removed useless include_directories * Print ssl library path in build summary * ExternalProject also exists on 2.8.0 * include pummel tests when testing with ctest * Moved tests.cmake to test/CMakeList.txt * Removed inconsistent, unnecessary condition in else
1 parent a530c23 commit ea29cb4

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ option(V8_SNAPSHOT "turn on snapshot when building stock v8")
1212

1313

1414
# cmake policies to get rid of some warnings
15-
cmake_policy(SET CMP0009 NEW)
15+
cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks
1616

1717
# generic cmake configuration
1818
include("cmake/configure.cmake")
@@ -27,10 +27,12 @@ include("cmake/node_build.cmake")
2727
include("cmake/v8_build.cmake")
2828

2929
# docs
30+
## might want to move this to doc/CMakeLists.txt
3031
include("cmake/docs.cmake")
3132

3233
# tests
33-
include("cmake/tests.cmake")
34+
enable_testing()
35+
add_subdirectory("test/")
3436

3537
# package
3638
include("cmake/package.cmake")
@@ -64,7 +66,7 @@ message(" RT library: ${RT}")
6466
message(" DL library: ${DL}")
6567

6668
if(${OPENSSL_FOUND} MATCHES TRUE)
67-
message(" OpenSSL: Found!")
69+
message(" OpenSSL: ${OPENSSL_LIBRARIES}")
6870
endif()
6971

7072
# message(" CCFLAGS: ${CCFLAGS}")

cmake/v8_build.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ if(NOT SHARED_V8)
3535
PROPERTY IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
3636

3737

38-
39-
if(CMAKE_VERSION VERSION_GREATER 2.8)
38+
if(CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
4039
# use ExternalProject for CMake >2.8
4140
include(ExternalProject)
4241

@@ -55,7 +54,7 @@ if(NOT SHARED_V8)
5554
)
5655

5756
add_dependencies(node v8_extprj)
58-
else(CAMKE_VERSION VERSION_GREATER 2.8)
57+
else()
5958
# copy v8 sources inefficiently with CMake versions <2.8
6059
file(GLOB_RECURSE v8_sources RELATIVE ${PROJECT_SOURCE_DIR} deps/v8/*)
6160

deps/libeio/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ if(!${CMAKE_USE_PTHREADS_INIT})
55
message(FATAL_ERROR "Unable to find pthreads")
66
endif()
77

8-
include_directories(${platform})
98
add_definitions(-DHAVE_CONFIG_H=1 -D_GNU_SOURCE)
109

1110
check_function_exists(futimes HAVE_FUTIMES)
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ else()
1010
get_target_property(node_bin node LOCATION)
1111
endif()
1212

13-
enable_testing()
1413
file(GLOB_RECURSE node_tests ${CMAKE_SOURCE_DIR}/test/*)
1514

15+
# add all tests with add_test
1616
foreach(test ${node_tests})
17-
if(test MATCHES ".*/test-[^./\ ]*.\\.js" AND NOT test MATCHES ".*disabled.*"
18-
AND NOT test MATCHES ".*pummel.*")
17+
if(test MATCHES ".*/test-[^./\ ]*.\\.js"
18+
AND NOT test MATCHES ".*disabled.*")
1919

2020
# build a fancy name for each test
2121
string(REPLACE ${CMAKE_SOURCE_DIR}/test/ "" test_name ${test})
@@ -27,6 +27,8 @@ foreach(test ${node_tests})
2727
endif()
2828
endforeach()
2929

30+
# the CTest custom config makes ctest recreate the tmp directory before and after
31+
# each run
3032
configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake COPYONLY)
3133

3234
add_custom_command(

0 commit comments

Comments
 (0)