@@ -58,25 +58,31 @@ endif()
58
58
if (NOT CINATRA_INCLUDES )
59
59
set (CINATRA_INCLUDES "/cinatra/include" )
60
60
endif ()
61
- if (NOT SSL_INC_DIR )
62
- set (SSL_INC_DIR "/usr/local/opt/openssl/include" )
63
- endif ()
64
- if (NOT SSL_LIB )
65
- set (SSL_LIB "/usr/local/opt/openssl/lib/libssl.dylib" )
66
- endif ()
67
- if (NOT CRYPTO_LIB )
68
- set (CRYPTO_LIB "/usr/local/opt/openssl/lib/libcrypto.dylib" )
69
- endif ()
61
+ # if(NOT SSL_INC_DIR)
62
+ # set(SSL_INC_DIR "/usr/local/opt/openssl/include")
63
+ # endif()
64
+ # if(NOT SSL_LIB)
65
+ # set(SSL_LIB "/usr/local/opt/openssl/lib/libssl.dylib")
66
+ # endif()
67
+ # if(NOT CRYPTO_LIB)
68
+ # set(CRYPTO_LIB "/usr/local/opt/openssl/lib/libcrypto.dylib")
69
+ # endif()
70
70
71
71
set (CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIR} /src )
72
72
set (CMAKE_VERBOSE_MAKEFILE off )
73
73
set (CMAKE_CXX_STANDARD 17 )
74
74
set (CMAKE_CXX_STANDARD_REQUIRED ON )
75
75
set (CMAKE_CXX_EXTENSIONS OFF )
76
76
if (CMAKE_INC_PATH )
77
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_INC_PATH} /include" )
77
78
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_INC_PATH} /include" )
78
79
else ()
80
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include" )
79
81
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include" )
82
+ if (APPLE )
83
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/homebrew/include" )
84
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/homebrew/include" )
85
+ endif ()
80
86
endif ()
81
87
set (CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR} )
82
88
@@ -158,9 +164,9 @@ set(HAVE_WINREGEX "")
158
164
159
165
if (APPLE )
160
166
set (OS_DARWIN 1 )
161
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${SSL_INC_DIR} " )
162
- set (CMAKE_REQUIRED_INCLUDES "${SSL_INC_DIR} " "/usr/local /include" )
163
- include_directories ("${SSL_INC_DIR} " "/usr/local /include" )
167
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${SSL_INC_DIR}")
168
+ set (CMAKE_REQUIRED_INCLUDES "/usr/local/include " "/opt/homebrew /include" )
169
+ include_directories ("/usr/local/include " "/opt/homebrew /include" )
164
170
elseif (MINGW )
165
171
set (OS_MINGW 1 )
166
172
set (USE_WIN_IOCP 1 )
@@ -222,7 +228,11 @@ endif()
222
228
if (CMAKE_INC_PATH )
223
229
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_INC_PATH} /lib" )
224
230
else ()
225
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib" )
231
+ if (APPLE )
232
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib -L/opt/homebrew/lib" )
233
+ else ()
234
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib" )
235
+ endif ()
226
236
endif ()
227
237
228
238
set (CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE )
@@ -344,10 +354,10 @@ endif()
344
354
#if(NOT HAVE_SSLINC)
345
355
# message(FATAL_ERROR "openssl includes not found")
346
356
#endif()
347
- if (APPLE )
348
- set (HAVE_SSLLIB ${SSL_LIB} )
349
- set (HAVE_CRYPTOLIB ${CRYPTO_LIB} )
350
- else ()
357
+ # if (APPLE)
358
+ # set(HAVE_SSLLIB ${SSL_LIB})
359
+ # set(HAVE_CRYPTOLIB ${CRYPTO_LIB})
360
+ # else()
351
361
if (NOT BUILD_SHARED_LIBS )
352
362
FIND_LIBRARY (HAVE_SSLLIB NAMES libssl.a ssl )
353
363
else ()
@@ -372,7 +382,7 @@ else()
372
382
# if(NOT HAVE_CRYPTOLIB)
373
383
# message(FATAL_ERROR "crypto library not found")
374
384
# endif()
375
- endif ()
385
+ # endif()
376
386
377
387
#FIND_LIBRARY(HAVE_TBBLIB tbb)
378
388
#if(NOT HAVE_TBBLIB)
@@ -532,6 +542,11 @@ if(MOD_SDORM_SQL)
532
542
if (MINGW )
533
543
set (CMAKE_REQUIRED_INCLUDES "/usr/include/unixodbc" )
534
544
include_directories ("/usr/include/unixodbc" )
545
+ elseif (APPLE )
546
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/homebrew/include/postgresql -I/opt/homebrew/include/pgsql" )
547
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/homebrew/include/postgresql -I/opt/homebrew/include/pgsql" )
548
+ set (CMAKE_REQUIRED_INCLUDES "/opt/homebrew/include/postgresql" "/opt/homebrew/include/pgsql" )
549
+ include_directories ("/opt/homebrew/include/postgresql" "/opt/homebrew/include/pgsql" )
535
550
endif ()
536
551
endif ()
537
552
CHECK_INCLUDE_FILE ("sql.h" HAVE_SQLINC )
@@ -591,6 +606,12 @@ if(MOD_SDORM_MONGO)
591
606
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0" )
592
607
set (CMAKE_REQUIRED_INCLUDES "/usr/include/libmongoc-1.0" "/usr/include/libbson-1.0" "/usr/local/include/libmongoc-1.0" "/usr/local/include/libbson-1.0" )
593
608
include_directories ("/usr/include/libmongoc-1.0" "/usr/include/libbson-1.0" "/usr/local/include/libmongoc-1.0" "/usr/local/include/libbson-1.0" )
609
+ if (APPLE )
610
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/homebrew/include/libmongoc-1.0 -I/opt/homebrew/include/libbson-1.0 " )
611
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/homebrew/include/libmongoc-1.0 -I/opt/homebrew/include/libbson-1.0" )
612
+ set (CMAKE_REQUIRED_INCLUDES "/opt/homebrew/include/libmongoc-1.0" "/opt/homebrew/include/libbson-1.0" )
613
+ include_directories ("/opt/homebrew/include/libmongoc-1.0" "/opt/homebrew/include/libbson-1.0" )
614
+ endif ()
594
615
endif ()
595
616
CHECK_INCLUDE_FILE ("mongoc.h" HAVE_MONGOINC )
596
617
if (NOT HAVE_MONGOINC )
@@ -664,6 +685,9 @@ if(SRV_ALL)
664
685
set (CMAKE_JSONCPP_INC "${CMAKE_INC_PATH} /include/jsoncpp" )
665
686
else ()
666
687
set (CMAKE_JSONCPP_INC "/usr/local/include/jsoncpp" "/usr/include/jsoncpp" )
688
+ if (APPLE )
689
+ set (CMAKE_JSONCPP_INC "/opt/homebrew/include/jsoncpp" )
690
+ endif ()
667
691
endif ()
668
692
FIND_LIBRARY (HAVE_JSONCPP jsoncpp )
669
693
if (NOT HAVE_JSONCPP )
@@ -736,6 +760,9 @@ elseif(SRV_DROGON)
736
760
set (CMAKE_JSONCPP_INC "${CMAKE_INC_PATH} /include/jsoncpp" )
737
761
else ()
738
762
set (CMAKE_JSONCPP_INC "/usr/local/include/jsoncpp" "/usr/include/jsoncpp" )
763
+ if (APPLE )
764
+ set (CMAKE_JSONCPP_INC "/opt/homebrew/include/jsoncpp" )
765
+ endif ()
739
766
endif ()
740
767
FIND_LIBRARY (HAVE_JSONCPP jsoncpp )
741
768
if (NOT HAVE_JSONCPP )
@@ -927,10 +954,10 @@ if(SRV_CINATRA)
927
954
elseif (SRV_ALL )
928
955
MESSAGE ( STATUS "CINATRA_INCLUDES: " ${CINATRA_INCLUDES} )
929
956
endif ()
930
- if (APPLE )
931
- MESSAGE ( STATUS "SSL_LIB: " ${SSL_LIB} )
932
- MESSAGE ( STATUS "CRYPTO_LIB: " ${CRYPTO_LIB} )
933
- endif ()
957
+ # if (APPLE)
958
+ # MESSAGE( STATUS "SSL_LIB: " ${SSL_LIB} )
959
+ # MESSAGE( STATUS "CRYPTO_LIB: " ${CRYPTO_LIB} )
960
+ # endif()
934
961
935
962
file (REMOVE_RECURSE ${PROJECT_NAME} -bin )
936
963
install (DIRECTORY DESTINATION "${PROJECT_NAME} -bin" )
0 commit comments