test: Enable building of tests

This commit is contained in:
Povilas Kanapickas 2020-05-30 22:41:20 +03:00
parent e354d79d81
commit b99ca80eaa
2 changed files with 27 additions and 13 deletions

View File

@ -19,6 +19,7 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/lib)
add_subdirectory(lib) add_subdirectory(lib)
add_subdirectory(cmd) add_subdirectory(cmd)
add_subdirectory(test)
if (BARRIER_BUILD_GUI) if (BARRIER_BUILD_GUI)
add_subdirectory(gui) add_subdirectory(gui)

View File

@ -14,24 +14,37 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
file(GLOB_RECURSE headers "*.h") set(headers
file(GLOB_RECURSE sources "*.cpp") )
set(sources
# remove platform files (specific platform added later). arch/ArchInternetTests.cpp
file(GLOB_RECURSE remove_platform "platform/*") ipc/IpcTests.cpp
list(REMOVE_ITEM headers ${remove_platform}) net/NetworkTests.cpp
list(REMOVE_ITEM sources ${remove_platform}) Main.cpp
)
# platform # platform
if (WIN32) if (WIN32)
file(GLOB platform_sources "platform/MSWindows*.cpp") set(platform_sources
file(GLOB platform_headers "platform/MSWindows*.h") platform/MSWindowsClipboardTests.cpp
platform/MSWindowsKeyStateTests.cpp
)
set(platform_headers)
elseif (APPLE) elseif (APPLE)
file(GLOB platform_sources "platform/OSX*.cpp") set(platform_sources
file(GLOB platform_headers "platform/OSX*.h") platform/OSXClipboardTests.cpp
platform/OSXKeyStateTests.cpp
platform/OSXScreenTests.cpp
)
set(platform_headers)
elseif (UNIX) elseif (UNIX)
file(GLOB platform_sources "platform/XWindows*.cpp") set(platform_sources
file(GLOB platform_headers "platform/XWindows*.h") platform/XWindowsClipboardTests.cpp
platform/XWindowsKeyStateTests.cpp
platform/XWindowsScreenSaverTests.cpp
platform/XWindowsScreenTests.cpp
)
set(platform_headers)
endif() endif()
list(APPEND sources ${platform_sources}) list(APPEND sources ${platform_sources})