Skip to content

Commit

Permalink
don't fail when cppunit isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
abma committed Jan 24, 2017
1 parent 1198574 commit ab393a0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions DevIL/test/UnitTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(cppunit)
add_executable(UnitTest EXCLUDE_FROM_ALL ILTest.cpp ILUTest.cpp UnitTest.cpp)
target_include_directories(UnitTest PRIVATE ${cppunit_INCLUDE_DIRECTORIES})
target_link_libraries(UnitTest IL ILU ${CPPUNIT_LIBRARIES})

if(CPPUNIT_FOUND)
add_executable(UnitTest EXCLUDE_FROM_ALL ILTest.cpp ILUTest.cpp UnitTest.cpp)
target_include_directories(UnitTest PRIVATE ${cppunit_INCLUDE_DIRECTORIES})
target_link_libraries(UnitTest IL ILU ${CPPUNIT_LIBRARIES})
else()
Message(STATUS "UnitTest disabled, cppunit wasn't found!")
endif()

0 comments on commit ab393a0

Please sign in to comment.