cmakelinker-warning

how to remove --enable-auto-import warning using cmake


im getting this linker warning. how do i fix it using cmake? here's my root CMakeLists.txt:

# CMakeLists.txt /

cmake_minimum_required(VERSION 2.8)

project(FactoryPattern)

include_directories(stores/include)

add_subdirectory(factories)
add_subdirectory(ingredients)
add_subdirectory(stores)

add_executable(factory MyPizzaStore.cpp)

target_link_libraries(factory pizzaStore)

Solution

  • finally found the answer after a lot of searching:

    set(CMAKE_EXE_LINKER_FLAGS 
    "${CMAKE_EXE_LINKER_FLAGS} -Wl,-enable-auto-import"
    )
    

    learning cmake isn't easy bcoz of its bad documentation. "mastering cmake" book should be made free. excerpt of a chapter wont do.