How to tell my CMake script to place .lib files in output/lib

89 views Asked by At

Currently, when I build my windows project (dynamic library) using CMake, my .dll files go in ./output/bin, my .h files go in ./output/include, but my .lib files go only to ./lib.

Is there anything I can do to make my .lib files go to ./output/lib instead? I didn't do the CMake script and it's pretty big, so I'm not too sure where to look. Here's some snippets I think might be helpful.

macro(artifacts)
    install(TARGETS ${CMAKE_PROJECT_NAME}
            RUNTIME DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/output/bin"
            LIBRARY DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/output/lib"
            )
    foreach(header_file ${includes})
        string(REGEX REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/(include|src)/" "" header_path_buffer ${header_file})
        string(REGEX REPLACE "[^\/]+$" "" header_path ${header_path_buffer})
        install(FILES ${header_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/output/include/${header_path})
    endforeach()
endmacro()
        string(REGEX REPLACE "^lib-" ${prefix} CMAKE_PROJECT_NAME ${TL_NAME})
        project(${CMAKE_PROJECT_NAME})
        add_library(${CMAKE_PROJECT_NAME} SHARED ${sources})
        target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC "include" "${thirdparty_include_dirs}")
        set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${includes}")
        set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VERSION ${TL_VERSION})
        set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES SOVERSION "${TL_VERSION_MAJOR}")

Any advice is appreciated.

0

There are 0 answers