mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
[IDE] Refine CMakeLists.txt, use absolute path
This commit is contained in:
parent
c209e547a8
commit
2e222d369d
1 changed files with 34 additions and 27 deletions
|
@ -1,26 +1,34 @@
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
project(srs CXX)
|
project(srs CXX)
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
execute_process(
|
||||||
|
COMMAND bash -c "cd ${PROJECT_SOURCE_DIR}/../../ && pwd"
|
||||||
|
OUTPUT_VARIABLE SRS_DIR
|
||||||
|
)
|
||||||
|
string(STRIP ${SRS_DIR} SRS_DIR)
|
||||||
|
message("SRS home is ${SRS_DIR}")
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
# Start to configure SRS with jobs of number of CPUs.
|
# Start to configure SRS with jobs of number of CPUs.
|
||||||
include(ProcessorCount)
|
include(ProcessorCount)
|
||||||
ProcessorCount(JOBS)
|
ProcessorCount(JOBS)
|
||||||
|
|
||||||
set(DEPS_LIBS ${PROJECT_SOURCE_DIR}/../../objs/st/libst.a
|
set(DEPS_LIBS ${SRS_DIR}/objs/st/libst.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/openssl/lib/libssl.a
|
${SRS_DIR}/objs/openssl/lib/libssl.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/openssl/lib/libcrypto.a
|
${SRS_DIR}/objs/openssl/lib/libcrypto.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/srtp2/lib/libsrtp2.a
|
${SRS_DIR}/objs/srtp2/lib/libsrtp2.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/opus/lib/libopus.a
|
${SRS_DIR}/objs/opus/lib/libopus.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/ffmpeg/lib/libavutil.a
|
${SRS_DIR}/objs/ffmpeg/lib/libavutil.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/ffmpeg/lib/libavcodec.a
|
${SRS_DIR}/objs/ffmpeg/lib/libavcodec.a
|
||||||
${PROJECT_SOURCE_DIR}/../../objs/ffmpeg/lib/libswresample.a)
|
${SRS_DIR}/objs/ffmpeg/lib/libswresample.a)
|
||||||
foreach(DEPS_LIB ${DEPS_LIBS})
|
foreach(DEPS_LIB ${DEPS_LIBS})
|
||||||
IF (NOT EXISTS ${DEPS_LIB})
|
IF (NOT EXISTS ${DEPS_LIB})
|
||||||
MESSAGE("${DEPS_LIB} not found")
|
MESSAGE("${DEPS_LIB} not found")
|
||||||
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
EXEC_PROGRAM("cd ../../.. && ./configure --osx --jobs=${JOBS}")
|
EXEC_PROGRAM("cd ${SRS_DIR} && ./configure --osx --jobs=${JOBS}")
|
||||||
ELSE ()
|
ELSE ()
|
||||||
EXEC_PROGRAM("cd ../../.. && ./configure --jobs=${JOBS}")
|
EXEC_PROGRAM("cd ${SRS_DIR} && ./configure --jobs=${JOBS}")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ELSE ()
|
ELSE ()
|
||||||
MESSAGE("${DEPS_LIB} is ok")
|
MESSAGE("${DEPS_LIB} is ok")
|
||||||
|
@ -29,24 +37,23 @@ endforeach()
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
# Setup SRS project
|
# Setup SRS project
|
||||||
INCLUDE_DIRECTORIES(../../objs
|
INCLUDE_DIRECTORIES(${SRS_DIR}/objs
|
||||||
../../objs/st
|
${SRS_DIR}/objs/st
|
||||||
../../objs/hp
|
${SRS_DIR}/objs/openssl/include
|
||||||
../../objs/openssl/include
|
${SRS_DIR}/objs/srtp2/include
|
||||||
../../src/core
|
${SRS_DIR}/objs/opus/include
|
||||||
../../src/kernel
|
${SRS_DIR}/objs/ffmpeg/include
|
||||||
../../src/protocol
|
${SRS_DIR}/src/core
|
||||||
../../src/app
|
${SRS_DIR}/src/kernel
|
||||||
../../src/service
|
${SRS_DIR}/src/protocol
|
||||||
../../objs/srtp2/include
|
${SRS_DIR}/src/app
|
||||||
../../objs/opus/include
|
${SRS_DIR}/src/service)
|
||||||
../../objs/ffmpeg/include)
|
|
||||||
|
|
||||||
set(SOURCE_FILES ../../src/main/srs_main_server.cpp)
|
set(SOURCE_FILES ${SRS_DIR}/src/main/srs_main_server.cpp)
|
||||||
AUX_SOURCE_DIRECTORY(../../src/core SOURCE_FILES)
|
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/core SOURCE_FILES)
|
||||||
AUX_SOURCE_DIRECTORY(../../src/kernel SOURCE_FILES)
|
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/kernel SOURCE_FILES)
|
||||||
AUX_SOURCE_DIRECTORY(../../src/protocol SOURCE_FILES)
|
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/protocol SOURCE_FILES)
|
||||||
AUX_SOURCE_DIRECTORY(../../src/app SOURCE_FILES)
|
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/app SOURCE_FILES)
|
||||||
|
|
||||||
ADD_DEFINITIONS("-g -O0")
|
ADD_DEFINITIONS("-g -O0")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue