Created
August 18, 2016 07:22
-
-
Save Osse/7a704500572ca132f0bc95803123be65 to your computer and use it in GitHub Desktop.
FindFoobar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_library(XY::Foobar MODULE IMPORTED) | |
find_package(Boost CONFIG REQUIRED COMPONENTS system thread) | |
set(LIBS Boost::system Boost::thread) | |
set_property(TARGET XY::Foobar APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) | |
set_property(TARGET XY::Foobar APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) | |
set(FOOBAR_PATH "${CMAKE_CURRENT_LIST_DIR}/../libfoobar") | |
if(WIN32) | |
set(DEBUGLIB "${FOOBAR_PATH}/libfoobard.dll") | |
set(RELEASELIB "${FOOBAR_PATH}/libfoobar.dll") | |
else() | |
set(DEBUGLIB "${FOOBAR_PATH}/libfoobard.so") | |
set(RELEASELIB "${FOOBAR_PATH}/libfoobar.so") | |
endif() | |
set_target_properties(XY::Foobar PROPERTIES | |
IMPORTED_LOCATION_DEBUG "${DEBUGLIB}" | |
IMPORTED_LOCATION_RELEASE "${RELEASELIB}" | |
INTERFACE_INCLUDE_DIRECTORIES "${FOOBAR_PATH}" | |
INTERFACE_LINK_LIBRARIES "${LIBS}" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment