Skip to content

Commit

Permalink
cmake cleanup
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
Daniel Gröber authored and thughes committed Nov 24, 2010
1 parent a530c23 commit ea29cb4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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}")
Expand Down
5 changes: 2 additions & 3 deletions cmake/v8_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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/*)

Expand Down
1 change: 0 additions & 1 deletion deps/libeio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions cmake/tests.cmake → test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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(
Expand Down

0 comments on commit ea29cb4

Please sign in to comment.