diff --git a/FindAlbatross.cmake b/FindAlbatross.cmake new file mode 100644 index 0000000..83f7550 --- /dev/null +++ b/FindAlbatross.cmake @@ -0,0 +1,23 @@ +# +# Copyright (C) 2022 Swift Navigation Inc. +# Contact: Swift Navigation +# +# This source is subject to the license found in the file 'LICENSE' which must +# be be distributed together with this source. All other rights reserved. +# +# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. +# + +include("GenericFindDependency") + +option(albatross_ENABLE_DOCS "" false) +option(albatross_ENABLE_EXAMPLES "" false) +option(albatross_ENABLE_TESTS "" false) +option(albatross_ENABLE_TEST_LIBS "" false) + +GenericFindDependency( + TARGET albatross + SYSTEM_INCLUDES +) diff --git a/FindOrion-Engine.cmake b/FindOrion-Engine.cmake new file mode 100644 index 0000000..724b172 --- /dev/null +++ b/FindOrion-Engine.cmake @@ -0,0 +1,24 @@ +# +# Copyright (C) 2022 Swift Navigation Inc. +# Contact: Swift Navigation +# +# This source is subject to the license found in the file 'LICENSE' which must +# be be distributed together with this source. All other rights reserved. +# +# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. +# + +include("GenericFindDependency") + +option(orion-engine_ENABLE_DOCS "" false) +option(orion-engine_ENABLE_EXAMPLES "" false) +option(orion-engine_ENABLE_TESTS "" false) +option(orion-engine_ENABLE_TEST_LIBS "" false) + +GenericFindDependency( + TARGET orion_engine + SOURCE_DIR orion-engine + SYSTEM_INCLUDES +) diff --git a/FindOrion-Proto.cmake b/FindOrion-Proto.cmake index ffa8021..57414f1 100644 --- a/FindOrion-Proto.cmake +++ b/FindOrion-Proto.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2021 Swift Navigation Inc. +# Copyright (C) 2022 Swift Navigation Inc. # Contact: Swift Navigation # # This source is subject to the license found in the file 'LICENSE' which must @@ -11,7 +11,13 @@ # include("GenericFindDependency") + +option(orion_proto_ENABLE_DOCS "" false) +option(orion_proto_ENABLE_EXAMPLES "" false) +option(orion_proto_ENABLE_TESTS "" false) +option(orion_proto_ENABLE_TEST_LIBS "" false) + GenericFindDependency( TARGET orion-proto - SOURCE_DIR "orion_proto" + SOURCE_DIR orion_proto ) diff --git a/FindSip.cmake b/FindSip.cmake new file mode 100644 index 0000000..132dfa6 --- /dev/null +++ b/FindSip.cmake @@ -0,0 +1,24 @@ +# +# Copyright (C) 2022 Swift Navigation Inc. +# Contact: Swift Navigation +# +# This source is subject to the license found in the file 'LICENSE' which must +# be be distributed together with this source. All other rights reserved. +# +# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. +# + +include("GenericFindDependency") + +option(sip_ENABLE_DOCS "" false) +option(sip_ENABLE_EXAMPLES "" false) +option(sip_ENABLE_TESTS "" false) +option(sip_ENABLE_TEST_LIBS "" false) + +GenericFindDependency( + TARGET sip + SOURCE_DIR sip + SYSTEM_INCLUDES +) diff --git a/TestTargets.cmake b/TestTargets.cmake index 9e8b4ba..ba5a889 100644 --- a/TestTargets.cmake +++ b/TestTargets.cmake @@ -197,8 +197,6 @@ function(swift_add_test_runner target) message(FATAL_ERROR "swift_add_test_runner unparsed arguments - ${x_UNPARSED_ARGUMENTS}") endif() - swift_create_test_targets() - if(NOT x_COMMENT) set(x_COMMENT "test ${target}") endif() @@ -213,6 +211,12 @@ function(swift_add_test_runner target) message(FATAL_ERROR "Both INTEGRATION_TEST and UNIT_TEST option were specified, you can only specify one") endif() + if (NOT ${PROJECT_NAME}_BUILD_TESTS) + return() + endif() + + swift_create_test_targets() + add_custom_target( do-${target} COMMAND ${x_COMMAND} @@ -266,8 +270,6 @@ function(swift_add_test target) message(FATAL_ERROR "swift_add_test unparsed arguments - ${x_UNPARSED_ARGUMENTS}") endif() - swift_create_test_targets() - if(NOT x_SRCS) message(FATAL_ERROR "swift_add_test must be passed at least one source file") endif() @@ -291,6 +293,7 @@ function(swift_add_test target) add_executable(${target} EXCLUDE_FROM_ALL ${x_SRCS}) set_target_properties(${target} PROPERTIES SWIFT_TYPE "test") swift_set_language_standards(${target} C_EXTENSIONS_ON) + target_code_coverage(${target} AUTO ALL) if(x_INCLUDE) target_include_directories(${target} PRIVATE ${x_INCLUDE}) endif() @@ -298,6 +301,12 @@ function(swift_add_test target) target_link_libraries(${target} PRIVATE ${x_LINK}) endif() + if (NOT ${PROJECT_NAME}_BUILD_TESTS) + return() + endif() + + swift_create_test_targets() + add_custom_target( do-${target} COMMAND ${target} @@ -305,7 +314,6 @@ function(swift_add_test target) COMMENT "Running ${x_COMMENT}" ) add_dependencies(do-${target} ${target}) - target_code_coverage(${target} AUTO ALL) if(x_PARALLEL) add_custom_target(parallel-${target}