better way to link libraries

This commit is contained in:
Krishna Vedala 2020-04-07 00:00:04 -04:00
parent c0ebfabc6f
commit 0c86721f4a
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7
2 changed files with 4 additions and 2 deletions

View File

@ -7,11 +7,12 @@ project(Algorithms_in_C
add_subdirectory(function_timer EXCLUDE_FROM_ALL)
include_directories(function_timer/include)
link_libraries(function_timer)
# link_libraries(function_timer)
# include_directories(${CMAKE_BINARY_DIR}/include)
# link_directories(${CMAKE_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
add_subdirectory(conversions)
add_subdirectory(misc)
find_package(OpenMP)

View File

@ -9,7 +9,8 @@ foreach( testsourcefile ${APP_SOURCES} )
string( REPLACE ".c" "" testname ${testsourcefile} )
add_executable( ${testname} ${testsourcefile} )
# Make sure YourLib is linked to each app
# target_link_libraries( ${testname} function_timer )
target_link_libraries( ${testname} function_timer )
set_target_properties(${testname} PROPERTIES LINKER_LANGUAGE C)
install(TARGETS ${testname} DESTINATION "bin/conversions")
endforeach( testsourcefile ${APP_SOURCES} )