Skip to content

Commit

Permalink
Fixed tests included into build even if testing was switched off
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Steinberg committed May 6, 2017
1 parent 71b36a7 commit 8e6e3b8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ endif()

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# We are the top-level project
include(CTest)
option(LUABIND_INSTALL "Install the LuaBind library and headers" ON)
option(LUABIND_BUILD_DOCS "Build documentation files" OFF)
option(LUABIND_BUILD_SHARED "Build luabind as a shared library?" OFF)
include(CTest)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

Expand All @@ -37,14 +38,16 @@ endif()

include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}"
${LUA_INCLUDE_DIRS})
${LUA_INCLUDE_DIRS}
)

add_subdirectory(src)
add_subdirectory(test)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
if(LUABIND_BUILD_TESTING)
add_subdirectory(test)
endif()
if(BUILD_TESTING)
add_subdirectory(test)
endif()

if(LUABIND_BUILD_DOCS)
add_subdirectory(doc)
endif()

0 comments on commit 8e6e3b8

Please sign in to comment.