From 0c86721f4ad7f9bed7d3f55288b3d8d8d87cfcc9 Mon Sep 17 00:00:00 2001 From: Krishna Vedala Date: Tue, 7 Apr 2020 00:00:04 -0400 Subject: [PATCH] better way to link libraries --- CMakeLists.txt | 3 ++- conversions/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9557f12..702ef7e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/conversions/CMakeLists.txt b/conversions/CMakeLists.txt index 254a2f11..0a98602f 100644 --- a/conversions/CMakeLists.txt +++ b/conversions/CMakeLists.txt @@ -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} )