generallib/test/CmakeTemplate.txt

31 lines
778 B
Plaintext

string(REGEX REPLACE "(.*)/(.*)/(.*)" "\\1" PARENTPATH ${CMAKE_CURRENT_LIST_FILE})
message("parent path is " ${PARENTPATH})
include_directories(${PARENTPATH}/obj/inc)
include_directories(${PARENTPATH}/obj/inc/third/include)
message("incldue " ${PARENTPATH}/obj/inc/third/include)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
link_directories(${PARENTPATH}/obj/Debug/)
link_libraries(generallib.lib)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# using Visual Studio C++
link_directories(${PARENTPATH}/obj/Debug/)
link_libraries(generallib.lib)
link_libraries(ws2_32)
endif()