)
-# =======================
-# Configure for Target OS
-# =======================
-
-# OS X Machines
-if (APPLE)
-
- # Configure backwards-compatible support (if your project allows it)
- # SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.4" CACHE STRING "Deployment target for OSX" FORCE)
-
- # Compile for x86_64 and i386. ppc no longer supported
- if(CMAKE_BUILD_TYPE MATCHES "Release")
- SET (CMAKE_OSX_ARCHITECTURES x86_64;i386)
- endif(CMAKE_BUILD_TYPE MATCHES "Release")
-
- # Use PackageMaker for installers?
- # set (CPACK_GENERATOR PackageMaker)
- set (CPACK_GENERATOR ZIP)
-
-
-endif (APPLE)
-
-# Windows Machines
-if (WIN32)
-
- # Use NSIS to generate installers?
- # set (CPACK_GENERATOR NSIS)
- set (CPACK_GENERATOR ZIP)
-
-endif (WIN32)
-
-
# =============
# Build Targets
# =============
endif()
+# =======================
+# Configure for Target OS
+# =======================
+
+# OS X Machines
+if (APPLE)
+
+ # Configure backwards-compatible support (if your project allows it)
+ # SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.4" CACHE STRING "Deployment target for OSX" FORCE)
+
+ # Compile for x86_64 and i386. ppc no longer supported
+ if(CMAKE_BUILD_TYPE MATCHES "Release")
+ SET (CMAKE_OSX_ARCHITECTURES x86_64;i386)
+ endif(CMAKE_BUILD_TYPE MATCHES "Release")
+
+ # Use PackageMaker for installers?
+ # set (CPACK_GENERATOR PackageMaker)
+ set (CPACK_GENERATOR ZIP)
+
+
+endif (APPLE)
+
+# Windows Machines
+if (WIN32)
+
+ # Use NSIS to generate installers?
+ # set (CPACK_GENERATOR NSIS)
+ set (CPACK_GENERATOR ZIP)
+
+# Linux (but not cross-compiling for Windows)
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+ # Create zip archive
+ set (CPACK_GENERATOR ZIP)
+
+ # Some libraries need to be linked on some Linux builds
+ if (DEFINED TEST)
+ # target_link_libraries(run_tests m)
+ endif (DEFINED TEST)
+
+endif (WIN32)
+
+
# ==========================
# Build Installer with CPack
# ==========================