Skip to content

Commit e79ed54

Browse files
authored
Add option for building unit tests
1 parent dec3291 commit e79ed54

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,12 @@ ADD_SUBDIRECTORY(python)
176176
ADD_SUBDIRECTORY(pkgconfig)
177177
ADD_SUBDIRECTORY(doc)
178178

179-
# # enable testing must be called here in order for the target test to be created
180-
# ENABLE_TESTING()
181-
# ADD_SUBDIRECTORY(test EXCLUDE_FROM_ALL)
179+
# enable testing must be called here in order for the target test to be created
180+
option(CPPADCODEGEN_BUILD_TESTS "Add targets for unit testing." ON)
181+
if(CPPADCODEGEN_BUILD_TESTS)
182+
ENABLE_TESTING()
183+
ADD_SUBDIRECTORY(test EXCLUDE_FROM_ALL)
184+
endif()
182185

183186
# =============================================================================
184187
# uninstall procedure

0 commit comments

Comments
 (0)