aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libparc/CMakeLists.txt')
-rw-r--r--libparc/CMakeLists.txt42
1 files changed, 35 insertions, 7 deletions
diff --git a/libparc/CMakeLists.txt b/libparc/CMakeLists.txt
index ca5c5e10..defa060a 100644
--- a/libparc/CMakeLists.txt
+++ b/libparc/CMakeLists.txt
@@ -6,6 +6,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
+if (NOT CMAKE_BUILD_TYPE)
+ message(STATUS "No build type selected, default to Release")
+ set(CMAKE_BUILD_TYPE "Release")
+endif ()
+
if( UNIX )
link_libraries(m)
endif( UNIX )
@@ -18,28 +23,47 @@ if(ANDROID_API)
message("############ Detected cross compile for $ENV{CMAKE_SYSTEM_NAME}")
message("############ This build will not include doxygen, tools, or tests")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall")
+elseif(COMPILE_FOR_IOS)
+ message("############ Detected cross compile for $ENV{CMAKE_SYSTEM_NAME}")
+ message("############ This build will not include doxygen, tools, or tests")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else()
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
# set(CMAKE_C_FLAGS_NOPANTS "${CMAKE_C_FLAGS_NOPANTS} -O3 -DNDEBUG -DPARCLibrary_DISABLE_VALIDATION")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG -DPARCLibrary_DISABLE_VALIDATION")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
find_package( Doxygen )
endif()
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DPARCLibrary_DISABLE_VALIDATION")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}")
+
include_directories($ENV{CCNX_DEPENDENCIES}/include)
set(OPENSSL_ROOT_DIR $ENV{CCNX_DEPENDENCIES})
include_directories(${PROJECT_BINARY_DIR}/parc ${PROJECT_SOURCE_DIR})
-find_package( LongBow REQUIRED )
-include_directories(${LONGBOW_INCLUDE_DIRS})
+if(COMPILE_FOR_IOS)
+ find_host_package( LongBow REQUIRED )
+ include_directories(${LONGBOW_INCLUDE_DIRS})
+
+ find_host_package( LibEvent REQUIRED )
+ include_directories(${LIBEVENT_INCLUDE_DIRS})
-find_package( LibEvent REQUIRED )
-include_directories(${LIBEVENT_INCLUDE_DIRS})
+ find_host_package ( OpenSSL REQUIRED )
+else()
+ find_package( LongBow REQUIRED )
+ include_directories(${LONGBOW_INCLUDE_DIRS})
+
+ find_package( LibEvent REQUIRED )
+ include_directories(${LIBEVENT_INCLUDE_DIRS})
-find_package ( Threads REQUIRED )
+ find_package ( Threads REQUIRED )
-find_package ( OpenSSL REQUIRED )
+ find_package ( OpenSSL REQUIRED )
+endif()
set(PARC_BIN_LIBRARIES
parc
@@ -59,6 +83,10 @@ if (ANDROID_API)
macro(AddTest testFile)
message("Android build: Skipping test ${ARGV0}")
endmacro(AddTest)
+elseif(COMPILE_FOR_IOS)
+ macro(AddTest testFile)
+ message("iOS build: Skipping test ${ARGV0}")
+ endmacro(AddTest)
else()
macro(AddTest testFile)
add_executable(${ARGV0} ${ARGV0}.c)