all repos — mgba @ 67a09eaa1d4132c8ffef3178ea0875102153609d

mGBA Game Boy Advance Emulator

All: Fix frameworks on newer CMakes
Jeffrey Pfau jeffrey@endrift.com
Sat, 10 Sep 2016 11:36:46 -0700
commit

67a09eaa1d4132c8ffef3178ea0875102153609d

parent

a4326242c7be2d095f0663662afbdd0393e63e5f

1 files changed, 17 insertions(+), 1 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -99,7 +99,23 @@ string(TOUPPER ${REQUIRE} UREQUIRE)

set(${UREQUIRE}_CFLAGS_OTHER ${${REQUIRE}_CFLAGS_OTHER} PARENT_SCOPE) set(${UREQUIRE}_FOUND ${${REQUIRE}_FOUND} PARENT_SCOPE) set(${UREQUIRE}_INCLUDE_DIRS ${${REQUIRE}_INCLUDE_DIRS} PARENT_SCOPE) - set(${UREQUIRE}_LIBRARIES ${${REQUIRE}_LIBRARIES} PARENT_SCOPE) + if (APPLE) + set(IS_FRAMEWORK OFF) + set(LIBS) + foreach(LIB IN LISTS ${REQUIRE}_LIBRARIES) + if(LIB STREQUAL "-framework") + set(IS_FRAMEWORK ON) + elseif(IS_FRAMEWORK) + list(APPEND LIBS "-framework ${LIB}") + set(IS_FRAMEWORK OFF) + else() + list(APPEND LIBS ${LIB}) + endif() + endforeach() + set(${UREQUIRE}_LIBRARIES ${LIBS} PARENT_SCOPE) + else() + set(${UREQUIRE}_LIBRARIES ${${REQUIRE}_LIBRARIES} PARENT_SCOPE) + endif() set(${UREQUIRE}_LIBRARY_DIRS ${${REQUIRE}_LIBRARY_DIRS} PARENT_SCOPE) set(${UREQUIRE}_LDFLAGS_OTHER ${${REQUIRE}_LDFLAGS_OTHER} PARENT_SCOPE) endforeach()