Skip to content
Snippets Groups Projects
Commit 19c9c781 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Compare project names instead of dirs.

Allows top-level wrapper CMakeLists.txt files to work (as long as
their project name is right).
parent 90f1e2cc
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ if(MSVC)
endif()
macro(double_require_lib_dir TARGET LIB LIBDIR)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}")
if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
if(NOT DEFINED ${LIBDIR}_DONE)
add_subdirectory(../../${LIBDIR} ${LIB} EXCLUDE_FROM_ALL)
set(${LIBDIR}_DONE TRUE)
......@@ -32,7 +32,7 @@ macro(double_require_libs TARGET)
endmacro()
macro(require_lib_dir TARGET LIB LIBDIR)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}")
if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
if(NOT DEFINED ${LIBDIR}_DONE)
add_subdirectory(../${LIBDIR} ${LIB} EXCLUDE_FROM_ALL)
set(${LIBDIR}_DONE TRUE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment