Commit 6da9d1a970e9f83800d66e606e7281c6b2c8fd3b

Adrian Antonana 2019-12-09T16:08:59

cmake: rename test target fixes cmake (v3.10.2) error under ubuntu 18.04 due to reserved target name

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d923599..5a0d849 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,16 +31,16 @@ set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJ
 #-----------------------------------------------------------------------------
 # demo target
 #-----------------------------------------------------------------------------
-add_executable(test EXCLUDE_FROM_ALL
+add_executable(test-target EXCLUDE_FROM_ALL
     ${CMAKE_CURRENT_SOURCE_DIR}/demo/shared.c
     ${CMAKE_CURRENT_SOURCE_DIR}/demo/test.c
 )
 
-target_include_directories(test PRIVATE
+target_include_directories(test-target PRIVATE
     ${CMAKE_CURRENT_SOURCE_DIR}
 )
 
-target_link_libraries(test PRIVATE
+target_link_libraries(test-target PRIVATE
     ${PROJECT_NAME}
 )
 
@@ -48,10 +48,10 @@ target_link_libraries(test PRIVATE
 # demo target
 #-----------------------------------------------------------------------------
 add_custom_target(check
-    COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test
+    COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-target
 )
 
-add_dependencies(check test)
+add_dependencies(check test-target)
 
 #-----------------------------------------------------------------------------
 # Install/export targets and files