Commit 1829189c authored by Hugo Hromic's avatar Hugo Hromic
Browse files

Add option in CMake to control building of unit tests

* Improved install time, i.e. no need to build tests if not testing
* Further moved unit tests CMake rules into their own files
parent cbbc39a7
# Unit tests.
enable_testing()
add_subdirectory(tests)
option(SOLARUS_TESTS "Generate the unit tests" ON)
# Set up the root path on OSX testing target.
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(solarus-testing PROPERTIES
MACOSX_RPATH ON
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@rpath"
)
if(SOLARUS_TESTS)
add_subdirectory(tests)
endif()
enable_testing()
include(cmake/AddIncludeDirectories.cmake)
include(cmake/AddSolarusTestingLibrary.cmake)
include(cmake/AddTestMaps.cmake)
......
......@@ -20,3 +20,12 @@ set_target_properties(solarus-testing PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
# Set up the root path on OSX testing target
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(solarus-testing PROPERTIES
MACOSX_RPATH ON
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@rpath"
)
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment