Mark CMake target thingies as private
This commit is contained in:
parent
8ec8a8d990
commit
14735caac3
2 changed files with 10 additions and 10 deletions
|
@ -488,16 +488,16 @@ endif()
|
||||||
if(TARGET SDL2::SDL2)
|
if(TARGET SDL2::SDL2)
|
||||||
# CMake-generated config (Arch, vcpkg, Raspbian)
|
# CMake-generated config (Arch, vcpkg, Raspbian)
|
||||||
message(STATUS "Using system SDL2")
|
message(STATUS "Using system SDL2")
|
||||||
target_link_libraries(CSE2 SDL2::SDL2 SDL2::SDL2main)
|
target_link_libraries(CSE2 PRIVATE SDL2::SDL2 SDL2::SDL2main)
|
||||||
elseif(TARGET SDL2::SDL2-static)
|
elseif(TARGET SDL2::SDL2-static)
|
||||||
# CMake-generated config (Arch, vcpkg, Raspbian)
|
# CMake-generated config (Arch, vcpkg, Raspbian)
|
||||||
message(STATUS "Using system SDL2")
|
message(STATUS "Using system SDL2")
|
||||||
target_link_libraries(CSE2 SDL2::SDL2-static SDL2::SDL2main)
|
target_link_libraries(CSE2 PRIVATE SDL2::SDL2-static SDL2::SDL2main)
|
||||||
elseif(SDL2_FOUND)
|
elseif(SDL2_FOUND)
|
||||||
# Autotools-generated config (MSYS2)
|
# Autotools-generated config (MSYS2)
|
||||||
message(STATUS "Using system SDL2")
|
message(STATUS "Using system SDL2")
|
||||||
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS})
|
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
target_link_libraries(CSE2 ${SDL2_LIBRARIES})
|
target_link_libraries(CSE2 PRIVATE ${SDL2_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
# Compile it ourselves
|
# Compile it ourselves
|
||||||
message(STATUS "Using local SDL2")
|
message(STATUS "Using local SDL2")
|
||||||
|
@ -506,7 +506,7 @@ else()
|
||||||
set(LIBC ON) # Needed to prevent possible 'symbol already defined' errors
|
set(LIBC ON) # Needed to prevent possible 'symbol already defined' errors
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory("external/SDL2" EXCLUDE_FROM_ALL)
|
add_subdirectory("external/SDL2" EXCLUDE_FROM_ALL)
|
||||||
target_link_libraries(CSE2 SDL2-static SDL2main)
|
target_link_libraries(CSE2 PRIVATE SDL2-static SDL2main)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT FORCE_LOCAL_LIBS)
|
if(NOT FORCE_LOCAL_LIBS)
|
||||||
|
@ -516,7 +516,7 @@ endif()
|
||||||
if(FREETYPE_FOUND)
|
if(FREETYPE_FOUND)
|
||||||
message(STATUS "Using system FreeType")
|
message(STATUS "Using system FreeType")
|
||||||
target_include_directories(CSE2 PRIVATE ${FREETYPE_INCLUDE_DIRS})
|
target_include_directories(CSE2 PRIVATE ${FREETYPE_INCLUDE_DIRS})
|
||||||
target_link_libraries(CSE2 ${FREETYPE_LIBRARIES})
|
target_link_libraries(CSE2 PRIVATE ${FREETYPE_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
# Compile it ourselves
|
# Compile it ourselves
|
||||||
message(STATUS "Using local FreeType")
|
message(STATUS "Using local FreeType")
|
||||||
|
@ -527,7 +527,7 @@ else()
|
||||||
set(CMAKE_DISABLE_FIND_PACKAGE_BZip2 ON)
|
set(CMAKE_DISABLE_FIND_PACKAGE_BZip2 ON)
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory("external/freetype" EXCLUDE_FROM_ALL)
|
add_subdirectory("external/freetype" EXCLUDE_FROM_ALL)
|
||||||
target_link_libraries(CSE2 freetype)
|
target_link_libraries(CSE2 PRIVATE freetype)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(RENDERER MATCHES "OpenGL3")
|
if(RENDERER MATCHES "OpenGL3")
|
||||||
|
@ -535,13 +535,13 @@ if(RENDERER MATCHES "OpenGL3")
|
||||||
target_include_directories(CSE2 PRIVATE "external/glad/include")
|
target_include_directories(CSE2 PRIVATE "external/glad/include")
|
||||||
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
target_link_libraries(CSE2 OpenGL::GL ${CMAKE_DL_LIBS})
|
target_link_libraries(CSE2 PRIVATE OpenGL::GL ${CMAKE_DL_LIBS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(RENDERER MATCHES "OpenGLES2")
|
if(RENDERER MATCHES "OpenGLES2")
|
||||||
find_package(OpenGLES2 REQUIRED)
|
find_package(OpenGLES2 REQUIRED)
|
||||||
target_include_directories(CSE2 PRIVATE ${OPENGLES2_INCLUDE_DIR})
|
target_include_directories(CSE2 PRIVATE ${OPENGLES2_INCLUDE_DIR})
|
||||||
target_link_libraries(CSE2 ${OPENGLES2_LIBRARIES})
|
target_link_libraries(CSE2 PRIVATE ${OPENGLES2_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -122,7 +122,7 @@ endif()
|
||||||
if(FLTK_FOUND)
|
if(FLTK_FOUND)
|
||||||
message(STATUS "Using system FLTK")
|
message(STATUS "Using system FLTK")
|
||||||
target_include_directories(DoConfig PRIVATE ${FLTK_INCLUDE_DIR})
|
target_include_directories(DoConfig PRIVATE ${FLTK_INCLUDE_DIR})
|
||||||
target_link_libraries(DoConfig ${FLTK_LIBRARIES})
|
target_link_libraries(DoConfig PRIVATE ${FLTK_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
# Compile it ourselves
|
# Compile it ourselves
|
||||||
message(STATUS "Using local FLTK")
|
message(STATUS "Using local FLTK")
|
||||||
|
@ -139,7 +139,7 @@ else()
|
||||||
add_subdirectory("fltk" EXCLUDE_FROM_ALL)
|
add_subdirectory("fltk" EXCLUDE_FROM_ALL)
|
||||||
get_target_property(DIRS fltk INCLUDE_DIRECTORIES) # FLTK doesn't mark its includes as PUBLIC or INTERFACE, so we have to do this stupidity
|
get_target_property(DIRS fltk INCLUDE_DIRECTORIES) # FLTK doesn't mark its includes as PUBLIC or INTERFACE, so we have to do this stupidity
|
||||||
target_include_directories(DoConfig PRIVATE ${DIRS})
|
target_include_directories(DoConfig PRIVATE ${DIRS})
|
||||||
target_link_libraries(DoConfig fltk)
|
target_link_libraries(DoConfig PRIVATE fltk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable link-time optimisation if available
|
# Enable link-time optimisation if available
|
||||||
|
|
Loading…
Add table
Reference in a new issue