Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############################
- # CMakeLists.txt in dir A
- #############################
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
- set(SOURCES ...)
- set(HEADERS ...)
- set(LIBS ...) # other libs used for the project
- find_package(B) # suppose FindB.cmake is provided
- if (B_FOUND)
- include_directories(${B_INCLUDE_DIR})
- list(APPEND LIBS ${B_LIBRARIES})
- else ()
- add_subdirectory(B)
- list(APPEND LIBS LocalB) # see CMakeLists.txt inside subdir B
- endif ()
- add_definitions(-DB_STATIC) # should I do this here?
- add_executable(myexe ${HEADERS} ${SOURCES})
- target_link_libraries(myexe ${LIBS}) # should it be just like this?
- #############################
- # CMakeLists.txt in subdir B
- #############################
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
- set(SOURCES ...)
- set(HEADERS ...)
- add_definitions(-DB_STATIC) # should I do this here?
- add_library(LocalB STATIC ${SOURCES} ${HEADERS}) # should it be STATIC or not?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement