build tests by default; install doc & examples

master
Rob Sykes 2013-01-09 20:03:55 +00:00
parent 31929368a6
commit 08c1701405
4 changed files with 15 additions and 3 deletions

View File

@ -34,7 +34,7 @@ if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
option (BUILD_TESTS "Build sanity-tests." OFF)
option (BUILD_TESTS "Build sanity-tests." ON)
option (BUILD_SHARED_LIBS "Build shared libraries." ON)
option (BUILD_EXAMPLES "Build examples." OFF)
option (WITH_OPENMP "Include OpenMP threading." ON)
@ -189,6 +189,13 @@ endif ()
if (NOT DEFINED INCLUDE_INSTALL_DIR)
set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
endif ()
if (NOT DEFINED DOC_INSTALL_DIR)
if (UNIX)
set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/lib${PROJECT_NAME}")
else ()
set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/doc")
endif ()
endif ()
if (APPLE)
option (BUILD_FRAMEWORK "Build an OS X framework." OFF)
@ -214,6 +221,8 @@ if (BUILD_TESTS OR BUILD_LSR_TESTS)
enable_testing ()
endif ()
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_SOURCE_DIR}/LICENCE DESTINATION ${DOC_INSTALL_DIR})
# Subdirectories:

View File

@ -32,3 +32,6 @@ endforeach ()
if (${BUILD_TESTS} AND ${WITH_LSR_BINDINGS})
add_test (lsr-bindings 1a-lsr)
endif ()
file (GLOB INSTALL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.[cCh])
install (FILES ${INSTALL_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/README DESTINATION ${DOC_INSTALL_DIR}/examples)

2
go
View File

@ -10,6 +10,6 @@ rm -f CMakeCache.txt # Prevent interference from any in-tree build
mkdir -p $build
cd $build
cmake -DCMAKE_BUILD_TYPE=$build -DBUILD_TESTS=ON .. &&
cmake -DCMAKE_BUILD_TYPE=$build .. &&
make &&
(make test || echo "FAILURE details in $build/Testing/Temporary/LastTest.log")

2
go.bat
View File

@ -11,7 +11,7 @@ del/f CMakeCache.txt
mkdir %build%
cd %build%
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%build% -DBUILD_TESTS=ON ..
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%build% ..
if errorlevel 1 goto end
nmake