File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.21 FATAL_ERROR )
2+ project (OCCAExamples
3+ VERSION 2.0.0
4+ DESCRIPTION "OCCA Examples"
5+ HOMEPAGE_URL "https://github.com/libocca/occa"
6+ LANGUAGES CXX )
7+
8+ if (NOT TARGET OCCA::libocca)
9+ find_package (OCCA REQUIRED )
10+ endif ()
11+
112macro (add_test_with_mode exe mode device )
213 add_test (NAME ${exe} -${mode} COMMAND ./${exe} --verbose --device "${device} " )
314 set_property (TEST ${exe} -${mode} APPEND PROPERTY ENVIRONMENT OCCA_CACHE_DIR=${OCCA_BUILD_DIR}/occa )
@@ -32,7 +43,7 @@ endmacro()
3243
3344macro (compile_example target file mode )
3445 add_executable (${target} ${file} )
35- target_link_libraries (${target} libocca )
46+ target_link_libraries (${target} OCCA:: libocca )
3647 target_include_directories (${target} PRIVATE $<BUILD_INTERFACE :${OCCA_SOURCE_DIR} /src >)
3748
3849 file (RELATIVE_PATH install_dir ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR} )
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.21 FATAL_ERROR )
2+ project (OCCATests
3+ VERSION 2.0.0
4+ DESCRIPTION "OCCA Tests"
5+ HOMEPAGE_URL "https://github.com/libocca/occa"
6+ LANGUAGES CXX )
7+
8+ if (NOT TARGET OCCA::libocca)
9+ find_package (OCCA REQUIRED )
10+ endif ()
11+
112function (add_occa_test test_source )
213 # Metadata
314 get_filename_component (source_directory ${test_source} DIRECTORY )
@@ -17,7 +28,7 @@ function(add_occa_test test_source)
1728 RUNTIME_OUTPUT_DIRECTORY ${test_directory} )
1829
1930 # Build config
20- target_link_libraries (${cmake_test_target} libocca ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} )
31+ target_link_libraries (${cmake_test_target} OCCA:: libocca ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} )
2132 target_include_directories (${cmake_test_target} PRIVATE
2233 $<BUILD_INTERFACE :${OCCA_SOURCE_DIR} /src >)
2334
@@ -50,7 +61,7 @@ if (OCCA_ENABLE_FORTRAN)
5061 EXCLUDE REGEX "src/fortran/typedefs_helper.cpp" )
5162
5263 add_library (libtypedefs_helper SHARED "src/fortran/typedefs_helper.cpp" )
53- target_link_libraries (libtypedefs_helper libocca )
64+ target_link_libraries (libtypedefs_helper OCCA:: libocca )
5465else ()
5566 list (FILTER occa_tests
5667 EXCLUDE REGEX "src/fortran" )
You can’t perform that action at this time.
0 commit comments