@ -29,28 +29,25 @@ cmake_policy( SET CMP0072 NEW )
cmake_policy ( SET CMP0075 NEW )
if ( WIN32 )
# T h e N u G e t p a c k a g e s t h a t t h e W i n d o w s b u i l d r e q u i r e s
# ( O n l y h e r e f o r v i s i b i l i t y )
set ( GETTEXT_NAME "Gettext.Tools" )
set ( GETTEXT_VERSION "0.20.1.1" )
set ( PYTHON_NAME "python2" )
set ( PYTHON_VERSION "2.7.17" )
# D e f i n e t h e S D K v e r s i o n w e r e q u i r e
set ( CMAKE_SYSTEM_VERSION "10.0.17763.0" CACHE INTERNAL "" )
elseif ( APPLE )
# D e f i n e t h e O S X c o m p a t i b i l i t y p a r a m e t e r s
set ( CMAKE_OSX_ARCHITECTURES x86_64 CACHE INTERNAL "" )
set ( CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE INTERNAL "" )
set ( CMAKE_OSX_SYSROOT macosx CACHE INTERNAL "" )
# A b i t o f a n o - n o , b u t c o u l d n ' t f i g u r e o u t a b e t t e r w a y t o m a k e i t G L O B A L
se t ( CMAKE_CXX_FLAGS "-stdlib=libc++" )
# S h o u l d n ' t c m a k e d o t h i s ? ? ?
string ( APPEND CMAKE_CXX_FLAGS " -stdlib=libc++" )
endif ( )
# D e f i n e option ( ) p r e f i x
set ( _OPT "audacity_" )
# A d d o u r m o d u l e p a t h
set ( CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /cmake-proxies/cmake-modules )
@ -59,14 +56,16 @@ set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules)
# set ( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON )
# set ( CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF )
# S e t t h e r e q u i r e d C + + s t a r d a r d
# S e t t h e r e q u i r e d C + + s t a n d a r d
set ( CMAKE_CXX_STANDARD 14 )
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
# U s e c c a c h e i f a v a i l a b l e
find_program ( CCACHE_PROGRAM ccache )
mark_as_advanced ( FORCE CCACHE_PROGRAM )
if ( CCACHE_PROGRAM )
set_property ( GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}" )
set_property ( GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}" )
endif ( )
# O u r v e r y o w n p r o j e c t
@ -88,12 +87,26 @@ include( TestBigEndian )
# O r g a n i z e s u b d i r e c t o r i e s / t a r g e t s i n t o f o l d e r s f o r t h e I D E s
set_property ( GLOBAL PROPERTY USE_FOLDERS ON )
# M a k e s u r e A u d a c i t y i s t h e s t a r t u p p r o j e c t o n W i n d o w s
if ( CMAKE_GENERATOR MATCHES "Visual Studio" )
# M a k e s u r e A u d a c i t y i s t h e s t a r t u p p r o j e c t
set_directory_properties (
P R O P E R T I E S
V S _ S T A R T U P _ P R O J E C T " $ { C M A K E _ P R O J E C T _ N A M E } "
)
# B u i l d u s i n g m u l t i p l e p r o c e s s o r s
foreach ( config ${ CMAKE_CONFIGURATION_TYPES } )
string ( TOUPPER "${config}" config )
string ( APPEND CMAKE_C_FLAGS_ ${ config } " /MP" )
string ( APPEND CMAKE_CXX_FLAGS_ ${ config } " /MP" )
endforeach ( )
# D e f i n e s y s t e m l i b r a r y i n f o r m a t i o n , b u t w e ' l l d o t h e i n s t a l l
set ( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP YES )
set ( CMAKE_INSTALL_UCRT_LIBRARIES NO )
set ( CMAKE_INSTALL_MFC_LIBRARIES NO )
set ( CMAKE_INSTALL_OPENMP_LIBRARIES NO )
include ( InstallRequiredSystemLibraries )
endif ( )
# W h e r e t h e f i n a l p r o d u c t i s s t o r e d
@ -127,6 +140,9 @@ endif()
# A d d t h e d y n a m i c l i n k e r library ( if needed ) t o t h e l i s t o f r e q u i r e d l i b r a r i e s
list ( APPEND CMAKE_REQUIRED_LIBRARIES ${ CMAKE_DL_LIBS } )
# M a k e s u r e t h e y ' r e u s e d d u r i n g t h e l i n k s t e p s
set ( CMAKE_LINK_INTERFACE_LIBRARIES ${ CMAKE_REQUIRED_LIBRARIES } )
# M a y b e a m i s c o n f i g u r a t i o n i n m y s y s t e m , b u t C M a k e d o e s n ' t w a n t t o l o o k
# i n / u s r / l o c a l / l i b b y d e f a u l t . . . s o f o r c e t h e i s s u e
if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
@ -135,13 +151,10 @@ if( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
list ( APPEND CMAKE_SHARED_LINKER_FLAGS -L/usr/local/lib )
endif ( )
# M a k e s u r e t h e y ' r e u s e d d u r i n g t h e l i n k s t e p s
set ( CMAKE_LINK_INTERFACE_LIBRARIES ${ CMAKE_REQUIRED_LIBRARIES } )
# V a r i o u s c o m m o n c h e c k s w h o s e r e s u l t s a r e u s e d b y t h e v a r i o u s t a r g e t s
# V a r i o u s c o m m o n c h e c k s w h o s e r e s u l t s a r e u s e d b y t h e d i f f e r e n t t a r g e t s
test_big_endian ( WORDS_BIGENDIAN )
# C h e c k f o r v a r i o u s c o m p i l e r f l a g s
# C h e c k f o r c o m p i l e r f l a g s
if ( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
check_cxx_compiler_flag ( "-mmmx" HAVE_MMX )
if ( HAVE_MMX )
@ -239,10 +252,10 @@ check_type_size( "wchar_t" SIZEOF_WCHAR LANGUAGE C )
check_type_size ( "void*" SIZEOF_POINTER LANGUAGE C )
# W e ' l l b e u s i n g i t i f i t ' s a v a i l a b l e
find_package ( PkgConfig )
find_package ( PkgConfig QUIET )
# M o s t l y j u s t t o m a k e t h e C M P 0 0 7 2 p o l i c y h a p p y
find_package ( OpenGL )
find_package ( OpenGL QUIET )
# W h e n c a l l e d w i l l d e f i n e s e v e r a l u s e f u l d i r e c t o r y p a t h s f o r t h e
# c u r r e n t c o n t e x t .
@ -265,9 +278,10 @@ endmacro()
# S o , i n e i t h e r c a s e w e e n d u p w i t h w h a t w e w a n t :
# . . . / b i n / D e b u g / /
# o r :
# . . . / b i n / . / D e b u g
# . . . / b i n / / D e b u g
set ( _DEST "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_BUILD_TYPE}" )
set ( _EXEDIR "${_DEST}" )
string ( REGEX REPLACE "/+$" "" _EXEDIR "${_EXEDIR}" )
# A d j u s t t h e m f o r t h e M a c
if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
@ -286,7 +300,9 @@ if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib" )
file ( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
endif ( )
if ( NOT EXISTS "${CMAKE_BINARY_DIR}/lib64" )
# O n l y c r e a t e o n s y s t e m s t h a t n e e d i t , e f f e c t i v e l y e x c l u d i n g W i n d o w s w h e r e l i n k s
# m a y n o t w o r k d u e t o i n s u f f i c i e n t p r i v i l e g e s
if ( NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib" AND NOT EXISTS "${CMAKE_BINARY_DIR}/lib64" )
file ( CREATE_LINK "${CMAKE_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/lib64" SYMBOLIC )
endif ( )
@ -379,11 +395,11 @@ add_subdirectory( "cmake-proxies/mod-script-pipe" )
# [ [
get_cmake_property ( _variableNames VARIABLES )
foreach ( _variableName ${ _variableNames } )
message ( STATUS "${_variableName}=${${_variableName}}" )
message ( STATUS "${_variableName}=${${_variableName}}" )
endforeach ( )
# ] ]
# [ [
include ( PrintProperties )
print_properties ( TARGET "Audacity " )
print_properties ( TARGET "wxWidgets " )
# ] ]