|
|
@ -394,11 +394,10 @@ else()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(BUILD_TESTING)
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
message("BUILD TESTS: Core, Scripts")
|
|
|
|
include_directories(depends/protobuf)
|
|
|
|
set(BUILD_SCRIPT_TESTS ON FORCE)
|
|
|
|
include_directories(depends/lua/include)
|
|
|
|
set(BUILD_CORE_TESTS ON FORCE)
|
|
|
|
include_directories(depends/md5)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Support linking against external tinyxml
|
|
|
|
# Support linking against external tinyxml
|
|
|
|
# If we find an external tinyxml, set the DFHACK_TINYXML variable to "tinyxml"
|
|
|
|
# If we find an external tinyxml, set the DFHACK_TINYXML variable to "tinyxml"
|
|
|
@ -415,11 +414,6 @@ else()
|
|
|
|
set(DFHACK_TINYXML "dfhack-tinyxml")
|
|
|
|
set(DFHACK_TINYXML "dfhack-tinyxml")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include_directories(depends/protobuf)
|
|
|
|
|
|
|
|
include_directories(depends/lua/include)
|
|
|
|
|
|
|
|
include_directories(depends/md5)
|
|
|
|
|
|
|
|
include_directories(depends/lodepng)
|
|
|
|
include_directories(depends/lodepng)
|
|
|
|
include_directories(depends/tthread)
|
|
|
|
include_directories(depends/tthread)
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
@ -427,9 +421,7 @@ include_directories(depends/clsocket/src)
|
|
|
|
include_directories(depends/xlsxio/include)
|
|
|
|
include_directories(depends/xlsxio/include)
|
|
|
|
add_subdirectory(depends)
|
|
|
|
add_subdirectory(depends)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Testing with CTest
|
|
|
|
# Testing with CTest
|
|
|
|
if(BUILD_TESTING OR BUILD_CORE_TESTS)
|
|
|
|
|
|
|
|
macro(dfhack_test name files)
|
|
|
|
macro(dfhack_test name files)
|
|
|
|
message("dfhack_test(${name}, ${files})")
|
|
|
|
message("dfhack_test(${name}, ${files})")
|
|
|
|
add_executable(${name} ${files})
|
|
|
|
add_executable(${name} ${files})
|
|
|
@ -439,30 +431,6 @@ if(BUILD_TESTING OR BUILD_CORE_TESTS)
|
|
|
|
add_test(NAME ${name} COMMAND ${name})
|
|
|
|
add_test(NAME ${name} COMMAND ${name})
|
|
|
|
endmacro()
|
|
|
|
endmacro()
|
|
|
|
include(CTest)
|
|
|
|
include(CTest)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
|
cmake_dependent_option(
|
|
|
|
|
|
|
|
BUILD_SCRIPT_TESTS "Install integration tests in hack/scripts/test" OFF
|
|
|
|
|
|
|
|
"BUILD_TESTING" OFF)
|
|
|
|
|
|
|
|
mark_as_advanced(FORCE BUILD_TESTS)
|
|
|
|
|
|
|
|
# Handle deprecated BUILD_TESTS option
|
|
|
|
|
|
|
|
option(BUILD_TESTS "Deprecated option; please use BUILD_SCRIPT_TESTS=ON" OFF)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(BUILD_TESTING OR BUILD_SCRIPT_TESTS)
|
|
|
|
|
|
|
|
if(EXISTS "${dfhack_SOURCE_DIR}/test/scripts")
|
|
|
|
|
|
|
|
message(SEND_ERROR "test/scripts must not exist in the dfhack repo since it would conflict with the tests installed from the scripts repo.")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(DIRECTORY ${dfhack_SOURCE_DIR}/test
|
|
|
|
|
|
|
|
DESTINATION ${DFHACK_DATA_DESTINATION}/scripts)
|
|
|
|
|
|
|
|
install(FILES ci/test.lua DESTINATION ${DFHACK_DATA_DESTINATION}/scripts)
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
add_custom_target(test
|
|
|
|
|
|
|
|
COMMENT "Nothing to do: CMake option BUILD_TESTING is OFF"
|
|
|
|
|
|
|
|
# Portable NOOP; need to put something here or the comment isn't displayed
|
|
|
|
|
|
|
|
COMMAND cd
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
find_package(Git REQUIRED)
|
|
|
|
find_package(Git REQUIRED)
|
|
|
|
if(NOT GIT_FOUND)
|
|
|
|
if(NOT GIT_FOUND)
|
|
|
@ -570,6 +538,16 @@ if(BUILD_DOCS)
|
|
|
|
install(FILES "README.html" DESTINATION "${DFHACK_DATA_DESTINATION}")
|
|
|
|
install(FILES "README.html" DESTINATION "${DFHACK_DATA_DESTINATION}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
option(BUILD_TESTS "Include tests (currently just installs Lua tests into the scripts folder)" OFF)
|
|
|
|
|
|
|
|
if(BUILD_TESTS)
|
|
|
|
|
|
|
|
if(EXISTS "${dfhack_SOURCE_DIR}/test/scripts")
|
|
|
|
|
|
|
|
message(SEND_ERROR "test/scripts must not exist in the dfhack repo since it would conflict with the tests installed from the scripts repo.")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(DIRECTORY ${dfhack_SOURCE_DIR}/test
|
|
|
|
|
|
|
|
DESTINATION ${DFHACK_DATA_DESTINATION}/scripts)
|
|
|
|
|
|
|
|
install(FILES ci/test.lua DESTINATION ${DFHACK_DATA_DESTINATION}/scripts)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Packaging with CPack!
|
|
|
|
# Packaging with CPack!
|
|
|
|
set(DFHACK_PACKAGE_SUFFIX "")
|
|
|
|
set(DFHACK_PACKAGE_SUFFIX "")
|
|
|
|
if(UNIX)
|
|
|
|
if(UNIX)
|
|
|
|