From 2768fef3ce836eea12ab8711070b07fa935fe84f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 12 May 2018 23:59:43 -0400 Subject: [PATCH] Cleaned up old static-library stuff from CMakeLists.txt. --- CMakeLists.txt | 19 +++++++++---------- darwin/CMakeLists.txt | 5 ----- unix/CMakeLists.txt | 5 ----- windows/CMakeLists.txt | 5 ----- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe5f71df..92937780 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,34 +148,33 @@ endmacro() add_subdirectory("common") add_subdirectory("${_OSNAME}") -add_library(${_LIBUINAME} ${_LIBUI_SOURCES}) -target_include_directories(${_LIBUINAME} +add_library(libui ${_LIBUI_SOURCES}) +target_include_directories(libui PUBLIC . PRIVATE ${_LIBUI_INCLUEDIRS}) -target_compile_definitions(${_LIBUINAME} +target_compile_definitions(libui PRIVATE ${_LIBUI_DEFS}) # cmake produces this for us by default but only for shared libraries -target_compile_definitions(${_LIBUINAME} +target_compile_definitions(libui PRIVATE libui_EXPORTS) -target_compile_options(${_LIBUINAME} +target_compile_options(libui PUBLIC ${_COMMON_CFLAGS} PRIVATE ${_LIBUI_CFLAGS}) # TODO link directories? if(BUILD_SHARED_LIBS) - target_link_libraries(${_LIBUINAME} + target_link_libraries(libui PRIVATE ${_LIBUI_LIBS}) endif() # TODO INTERFACE libs don't inherit to grandhcildren? # on Windows the linker for static libraries is different; don't give it the flags if(BUILD_SHARED_LIBS) - _target_link_options_private(${_LIBUINAME} + _target_link_options_private(libui _COMMON_LDFLAGS _LIBUI_LDFLAGS) endif() if(NOT BUILD_SHARED_LIBS) - _handle_static() # TODO figure out a way to tell libui that it's static - target_compile_definitions(${_LIBUINAME} + target_compile_definitions(libui PUBLIC _UI_STATIC) endif() if(NOT MSVC) @@ -200,7 +199,7 @@ if(NOT MSVC) endif() if(BUILD_SHARED_LIBS) if(_HASVERSION) - set_target_properties(${_LIBUINAME} PROPERTIES + set_target_properties(libui PROPERTIES SOVERSION "${_VERSION}") endif() endif() diff --git a/darwin/CMakeLists.txt b/darwin/CMakeLists.txt index 6bf91a85..bbab3c9a 100644 --- a/darwin/CMakeLists.txt +++ b/darwin/CMakeLists.txt @@ -57,11 +57,6 @@ list(APPEND _LIBUI_INCLUDEDIRS ) set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE) -set(_LIBUINAME libui PARENT_SCOPE) -macro(_handle_static) - # do nothing -endmacro() - set(_LIBUI_LIBS objc "-framework Foundation" "-framework AppKit" PARENT_SCOPE) diff --git a/unix/CMakeLists.txt b/unix/CMakeLists.txt index da4cdd0b..78873146 100644 --- a/unix/CMakeLists.txt +++ b/unix/CMakeLists.txt @@ -54,11 +54,6 @@ list(APPEND _LIBUI_INCLUDEDIRS ) set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE) -set(_LIBUINAME libui PARENT_SCOPE) -macro(_handle_static) - # do nothing -endmacro() - # TODO the other variables don't work? set(_LIBUI_CFLAGS ${GTK_CFLAGS} diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 4b208385..16beefa7 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -74,11 +74,6 @@ list(APPEND _LIBUI_INCLUDEDIRS ) set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE) -set(_LIBUINAME libui PARENT_SCOPE) -macro(_handle_static) - # do nothing -endmacro() - # TODO prune this list set(_LIBUI_LIBS user32 kernel32 gdi32 comctl32 uxtheme msimg32 comdlg32 d2d1 dwrite ole32 oleaut32 oleacc uuid