mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 20:22:27 +02:00
add some comments to the CMakeLists files
This commit is contained in:
parent
9774dd5874
commit
8c8309c1f4
4 changed files with 31 additions and 9 deletions
|
@ -2,9 +2,12 @@ cmake_minimum_required(VERSION 2.8)
|
|||
|
||||
project(domain)
|
||||
|
||||
# grab the implementation / header files
|
||||
file(GLOB DOMAIN_SRCS src/*.cpp src/*.h)
|
||||
|
||||
# add an executable with the source files
|
||||
add_executable(domain ${DOMAIN_SRCS})
|
||||
|
||||
# link the shared hifi library
|
||||
include(../LinkHifiShared.cmake)
|
||||
link_hifi_shared_library(domain)
|
|
@ -1,5 +1,6 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# setup for find modules
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
|
||||
set(GLM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
|
||||
set(LODEPNG_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/LodePNG)
|
||||
|
@ -8,19 +9,22 @@ set(PORTAUDIO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/portaudio)
|
|||
project(interface)
|
||||
|
||||
if (APPLE)
|
||||
# link in required OS X frameworks and include the right GL headers
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreServices -framework Carbon")
|
||||
set(GL_HEADERS "#include <GLUT/glut.h>\n#include <OpenGL/glext.h>")
|
||||
else (APPLE)
|
||||
# include the right GL headers for UNIX
|
||||
set(GL_HEADERS "#include <GL/gl.h>\n#include <GL/glut.h>\n#include <GL/glext.h>")
|
||||
endif (APPLE)
|
||||
|
||||
# create the InterfaceConfig.h file based on GL_HEADERS above
|
||||
configure_file(InterfaceConfig.h.in ${PROJECT_BINARY_DIR}/includes/InterfaceConfig.h)
|
||||
|
||||
# grab the implementation and header files from src dir
|
||||
file(GLOB INTERFACE_SRCS src/*.cpp src/*.h)
|
||||
|
||||
# For Apple set the icns file containing icons
|
||||
IF(APPLE)
|
||||
# set how it shows up in the Info.plist file
|
||||
# set how the icon shows up in the Info.plist file
|
||||
SET(MACOSX_BUNDLE_ICON_FILE interface.icns)
|
||||
# set where in the bundle to put the icns file
|
||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/interface.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
|
@ -28,16 +32,20 @@ IF(APPLE)
|
|||
SET(INTERFACE_SRCS ${INTERFACE_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/interface.icns)
|
||||
ENDIF(APPLE)
|
||||
|
||||
# create the executable, make it a bundle on OS X
|
||||
add_executable(interface MACOSX_BUNDLE ${INTERFACE_SRCS})
|
||||
|
||||
# link in the hifi shared library
|
||||
include(../LinkHifiShared.cmake)
|
||||
link_hifi_shared_library(interface)
|
||||
|
||||
# find required libraries
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(GLUT REQUIRED)
|
||||
find_package(GLM REQUIRED)
|
||||
find_package(LodePNG REQUIRED)
|
||||
|
||||
# include headers for external libraries and InterfaceConfig.
|
||||
include_directories(
|
||||
${PROJECT_BINARY_DIR}/includes
|
||||
${OPENGL_INCLUDE_DIRS}
|
||||
|
@ -46,12 +54,14 @@ include_directories(
|
|||
${LODEPNG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# link target to external libraries
|
||||
target_link_libraries(interface
|
||||
${OPENGL_LIBRARY}
|
||||
${GLUT_LIBRARY}
|
||||
${LODEPNG_LIBRARY}
|
||||
)
|
||||
|
||||
# include PortAudio as external project
|
||||
include(ExternalProject)
|
||||
set(PORTAUDIO_PROJ_DIR external/portaudio)
|
||||
ExternalProject_Add(
|
||||
|
@ -63,13 +73,18 @@ ExternalProject_Add(
|
|||
BUILD_COMMAND make
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(portaudio binary_dir)
|
||||
ExternalProject_Get_Property(portaudio source_dir)
|
||||
include_directories(${source_dir}/include)
|
||||
# make PortAudio a dependency of the interface executable
|
||||
add_dependencies(interface portaudio)
|
||||
|
||||
# include the PortAudio headers
|
||||
ExternalProject_Get_Property(portaudio source_dir)
|
||||
include_directories(${source_dir}/include)
|
||||
|
||||
# link the PortAudio library
|
||||
ExternalProject_Get_Property(portaudio binary_dir)
|
||||
target_link_libraries(interface ${binary_dir}/lib/.libs/libportaudio.a)
|
||||
|
||||
# link required libraries on UNIX
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(Librt REQUIRED)
|
||||
|
@ -84,6 +99,7 @@ if (UNIX AND NOT APPLE)
|
|||
)
|
||||
endif (UNIX AND NOT APPLE)
|
||||
|
||||
# install command for OS X bundle
|
||||
INSTALL(TARGETS interface
|
||||
BUNDLE DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/install COMPONENT Runtime
|
||||
RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/install COMPONENT Runtime
|
||||
|
|
|
@ -2,15 +2,16 @@ cmake_minimum_required(VERSION 2.8)
|
|||
|
||||
project(mixer)
|
||||
|
||||
# grab the implemenation and header files
|
||||
file(GLOB MIXER_SRCS src/*.cpp src/*.h)
|
||||
|
||||
# add the mixer executable
|
||||
add_executable(mixer ${MIXER_SRCS})
|
||||
|
||||
# link the shared hifi library
|
||||
include(../LinkHifiShared.cmake)
|
||||
link_hifi_shared_library(mixer)
|
||||
|
||||
# link the threads library
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(mixer
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${HIFI_SHARED_LIBRARY}
|
||||
)
|
||||
target_link_libraries(mixer ${CMAKE_THREAD_LIBS_INIT})
|
|
@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.8)
|
|||
|
||||
project(shared)
|
||||
|
||||
# grab the implemenation and header files
|
||||
file(GLOB HIFI_SHARED_SRCS src/*.h src/*.cpp)
|
||||
|
||||
# create a library and set the property so it can be referenced later
|
||||
add_library(HifiShared ${HIFI_SHARED_SRCS})
|
||||
set(HIFI_SHARED_LIBRARY HifiShared)
|
Loading…
Reference in a new issue