Commit bea3f89a authored by jclamber's avatar jclamber

fix cmake issues

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@150 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent de4659ee
# -*-cmake-*-
# ============================================================================ # ============================================================================
# Copyright Jean-Charles LAMBERT - 2008-2013 # Copyright Jean-Charles LAMBERT - 2008-2013
# e-mail: Jean-Charles.Lambert@oamp.fr # e-mail: Jean-Charles.Lambert@oamp.fr
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
# ============================================================================ # ============================================================================
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
# project name # project name
project (uns_devel) project (uns_devel)
...@@ -66,14 +67,14 @@ MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} ) ...@@ -66,14 +67,14 @@ MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
# Find all the sources for the utils LIB # Find all the sources for the utils LIB
if (CMAKE_Fortran_COMPILER) if (CMAKE_Fortran_COMPILER)
FILE(GLOB LIBUTILS ${PROJECT_SOURCE_DIR}/lib/src/*.cc ${PROJECT_SOURCE_DIR}/lib/src/*.c ${PROJECT_SOURCE_DIR}/lib/src/*.F ) FILE(GLOB LIBUTILS ${PROJECT_SOURCE_DIR}/lib/src/*.cc ${PROJECT_SOURCE_DIR}/lib/src/*.c ${PROJECT_SOURCE_DIR}/lib/src/*.F )
else () else ()
FILE(GLOB LIBUTILS ${PROJECT_SOURCE_DIR}/lib/src/*.cc ${PROJECT_SOURCE_DIR}/lib/src/*.c) FILE(GLOB LIBUTILS ${PROJECT_SOURCE_DIR}/lib/src/*.cc ${PROJECT_SOURCE_DIR}/lib/src/*.c)
endif () endif ()
# create the library "MYutils" # create the library "MYutils"
add_library (MYutils SHARED ${LIBUTILS}) add_library (MYutils SHARED ${LIBUTILS})
if(OSX) if(OSX)
set_target_properties(JCLutils PROPERTIES LINK_FLAGS "-undefined suppress -flat_namespace") set_target_properties(JCLutils PROPERTIES LINK_FLAGS "-undefined suppress -flat_namespace")
endif(OSX) endif(OSX)
# Destination path for the lib # Destination path for the lib
...@@ -85,7 +86,11 @@ SET(LIBRARY_OUTPUT_PATH lib) ...@@ -85,7 +86,11 @@ SET(LIBRARY_OUTPUT_PATH lib)
add_definitions(${OPT} -DNO_CUDA -DfalcON_NEMO -DfalcON_SINGLE -Wall ${DNOBOOST}) add_definitions(${OPT} -DNO_CUDA -DfalcON_NEMO -DfalcON_SINGLE -Wall ${DNOBOOST})
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${WARNCPP} ) SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${WARNCPP} )
SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${WARNC} ) SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${WARNC} )
SET(CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} ${WARNF}) #SET(CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} ${WARNF} )
SET(CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} ${EXTRA_Fortran_FLAGS})
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("Fortran compiler: " ${Fortran_COMPILER_NAME})
message ("Fortran flags : " ${CMAKE_Fortran_FLAGS})
# remove -DNDEBUG in RElease mode to keep activated assert calls # remove -DNDEBUG in RElease mode to keep activated assert calls
STRING(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) STRING(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
...@@ -115,7 +120,7 @@ FOREACH(exe_cpp ${execpp_sources}) ...@@ -115,7 +120,7 @@ FOREACH(exe_cpp ${execpp_sources})
MESSAGE( STATUS "New executable ==> " ${exe}) MESSAGE( STATUS "New executable ==> " ${exe})
add_executable (${exe} ${exe_cpp}) add_executable (${exe} ${exe_cpp})
# #
target_link_libraries (${exe} MYutils ${FC_GFORT_LIB} ${FC_G77_LIB} unsio nemo ${SQLITE3_LIB} dl) target_link_libraries (${exe} MYutils ${FC_GFORT_LIB} ${FC_G77_LIB} unsio nemo ${SQLITE3_LIB} dl)
ENDFOREACH(exe_cpp ${execpp_sources}) ENDFOREACH(exe_cpp ${execpp_sources})
...@@ -125,22 +130,22 @@ ENDFOREACH(exe_cpp ${execpp_sources}) ...@@ -125,22 +130,22 @@ ENDFOREACH(exe_cpp ${execpp_sources})
# find all fortran source files # find all fortran source files
# #
if (CMAKE_Fortran_COMPILER) if (CMAKE_Fortran_COMPILER)
# Find all LIB's sources files # Find all LIB's sources files
FILE(GLOB exe_sources ${PROJECT_SOURCE_DIR}/src/*.F) FILE(GLOB exe_sources ${PROJECT_SOURCE_DIR}/src/*.F)
FOREACH(exe_f ${exe_sources}) FOREACH(exe_f ${exe_sources})
get_filename_component(exe ${exe_f} NAME_WE) get_filename_component(exe ${exe_f} NAME_WE)
MESSAGE( STATUS "New executable ==> " ${exe}) MESSAGE( STATUS "New executable ==> " ${exe})
add_executable (${exe} ${exe_f}) add_executable (${exe} ${exe_f})
# Link the executable to the Hello library. # Link the executable to the Hello library.
#target_link_libraries (${exe} unsio nemomaing77 nemo g2c sqlite3 stdc++) #target_link_libraries (${exe} unsio nemomaing77 nemo g2c sqlite3 stdc++)
target_link_libraries (${exe} MYutils unsio nemomaing77 nemo ${SQLITE3_LIB} ${FC_LIB} stdc++) target_link_libraries (${exe} MYutils unsio nemomaing77 nemo ${SQLITE3_LIB} ${FC_LIB} stdc++)
SET_TARGET_PROPERTIES(${exe} PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES(${exe} PROPERTIES LINKER_LANGUAGE Fortran)
# add "-lstdc++" # add "-lstdc++"
#SET(CMAKE_Fortran_LINK_FLAGS "-L${NEMOLIB} ") #-lstdc++") #SET(CMAKE_Fortran_LINK_FLAGS "-L${NEMOLIB} ") #-lstdc++")
ENDFOREACH(exe_f ${exe_sources}) ENDFOREACH(exe_f ${exe_sources})
endif() endif()
# ---------------------------------------------------------- # ----------------------------------------------------------
...@@ -151,9 +156,9 @@ mark_as_advanced(CMAKE_INSTALL_PREFIX) ...@@ -151,9 +156,9 @@ mark_as_advanced(CMAKE_INSTALL_PREFIX)
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
IF (NEMO_INSTALLED) IF (NEMO_INSTALLED)
set (CMAKE_INSTALL_PREFIX "$ENV{NEMO}" CACHE PATH "" FORCE) #if NEMO exist => default install into NEMO path set (CMAKE_INSTALL_PREFIX "$ENV{NEMO}" CACHE PATH "" FORCE) #if NEMO exist => default install into NEMO path
ELSE() ELSE()
set (CMAKE_INSTALL_PREFIX ${UNSIOPATH} CACHE PATH "" FORCE) #if NEMO NOT exist => default install into ${HOME}/local/unsio set (CMAKE_INSTALL_PREFIX ${UNSIOPATH} CACHE PATH "" FORCE) #if NEMO NOT exist => default install into ${HOME}/local/unsio
ENDIF() ENDIF()
ENDIF ()#NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ENDIF ()#NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
......
# -*-cmake-*-
# check if fortran compiler is installed # check if fortran compiler is installed
if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND) set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
enable_language(Fortran OPTIONAL) enable_language(Fortran OPTIONAL)
message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}") message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
if (Fortran_COMPILER_NAME STREQUAL "gfortran")
# gfortran
set (EXTRA_Fortran_FLAGS " ${WARNF} -ffixed-line-length-none ")
endif()
\ No newline at end of file
...@@ -18,7 +18,7 @@ set(LIBBOOST boost_thread-mt.a boost_system-mt.a) ...@@ -18,7 +18,7 @@ set(LIBBOOST boost_thread-mt.a boost_system-mt.a)
set(Boost_FOUND FALSE) set(Boost_FOUND FALSE)
set(DNOBOOST "") set(DNOBOOST "")
if(NOT Boost_FOUND) if(NOT Boost_FOUND)
MESSAGE (STATUS " Boost not found, uns_2dplot will run slowly.....") MESSAGE (STATUS " Boost not found, uns_2dplot will run slowly.....")
set(DNOBOOST "-DNOBOOST") set(DNOBOOST "-DNOBOOST")
set(LIBBOOST "") set(LIBBOOST "")
endif(NOT Boost_FOUND) endif(NOT Boost_FOUND)
# -*-cmake-*-
# ============================================================================ # ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012 # Copyright Jean-Charles LAMBERT - 2009-2013
# e-mail: Jean-Charles.Lambert@oamp.fr # e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies # address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM) # Centre de donneeS Astrophysique de Marseille (CeSAM)
...@@ -62,16 +63,16 @@ IF(GLOB_TEMP_VAR) ...@@ -62,16 +63,16 @@ IF(GLOB_TEMP_VAR)
ENDIF(GLOB_TEMP_VAR) ENDIF(GLOB_TEMP_VAR)
if (NOT NEMO_INSTALLED) if (NOT NEMO_INSTALLED)
MESSAGE(STATUS "NEMO environement not loaded.... using nemo_light") MESSAGE(STATUS "NEMO environement not loaded.... using nemo_light")
else () # try to find dehnen's stuff else () # try to find dehnen's stuff
find_library(ISFALCONLIB NAMES falcON PATHS $ENV{NEMO}/usr/dehnen/falcON/lib) find_library(ISFALCONLIB NAMES falcON PATHS $ENV{NEMO}/usr/dehnen/falcON/lib)
if (ISFALCONLIB) if (ISFALCONLIB)
MESSAGE(STATUS "Found Falcon lib :" ${ISFALCONLIB} ) MESSAGE(STATUS "Found Falcon lib :" ${ISFALCONLIB} )
set (FALCON_INSTALLED TRUE) set (FALCON_INSTALLED TRUE)
set (FALCON_LIB_PATH $ENV{NEMO}/usr/dehnen/falcON) set (FALCON_LIB_PATH $ENV{NEMO}/usr/dehnen/falcON)
set (FALCON_UTIL_PATH $ENV{NEMO}/usr/dehnen/utils) set (FALCON_UTIL_PATH $ENV{NEMO}/usr/dehnen/utils)
set(DEHNEN $ENV{NEMO}/usr/dehnen) set(DEHNEN $ENV{NEMO}/usr/dehnen)
else () else ()
set (FALCON_INSTALLED FALSE) set (FALCON_INSTALLED FALSE)
endif() endif()
endif (NOT NEMO_INSTALLED) endif (NOT NEMO_INSTALLED)
# -*-cmake-*-
# ============================================================================ # ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012 # Copyright Jean-Charles LAMBERT - 2009-2012
# e-mail: Jean-Charles.Lambert@oamp.fr # e-mail: Jean-Charles.Lambert@oamp.fr
......
# -*-cmake-*-
# ============================================================================ # ============================================================================
# Copyright Jean-Charles LAMBERT - 2012 # Copyright Jean-Charles LAMBERT - 2012-2013
# e-mail: Jean-Charles.Lambert@oamp.fr # e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies # address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM) # Centre de donneeS Astrophysique de Marseille (CeSAM)
...@@ -12,49 +13,56 @@ ...@@ -12,49 +13,56 @@
# CMake module to detect UNSIO library # CMake module to detect UNSIO library
# ============================================================================ # ============================================================================
SET(UNSIO_FOUND FALSE) if (NOT UNSIO_SETUP)
set (UNSIOLIB UNSIOLIB-NOTFOUND) set (UNSIO_SETUP 1)
typed_cache_set ( STRING "unsio setup" UNSIO_SETUP 1 )
if ( UNSIOPATH ) # user configure cmake with variable -DUNSIO_INSTALLPATH="/unsio/path" SET(UNSIO_FOUND FALSE)
find_library(UNSIOLIB NAMES unsio PATHS ${UNSIOPATH}/lib) set (UNSIOLIB UNSIOLIB-NOTFOUND)
MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB})
if (NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND)
MESSAGE(STATUS "Found UNSIOLIB =" ${UNSIOLIB})
SET(UNSIO_FOUND TRUE)
else ()
endif() if ( UNSIOPATH ) # user configure cmake with variable -DUNSIO_INSTALLPATH="/unsio/path"
endif ()
if (NOT UNSIO_FOUND) # try NEMO
find_library(UNSIOLIB NAMES unsio PATHS $ENV{NEMO}/lib)
MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB})
if ( NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND)
MESSAGE(STATUS "Found UNSIOLIB in NEMO =" ${UNSIOLIB})
SET(UNSIO_FOUND TRUE)
SET(UNSIOPATH $ENV{NEMO})
else ()
endif() find_library(UNSIOLIB NAMES unsio PATHS ${UNSIOPATH}/lib)
endif() MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB})
if (NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND)
MESSAGE(STATUS "Found UNSIOLIB =" ${UNSIOLIB})
SET(UNSIO_FOUND TRUE)
else ()
endif()
endif ()
if (NOT UNSIO_FOUND) # try $HOME/local if (NOT UNSIO_FOUND) # try NEMO
find_library(UNSIOLIB NAMES unsio PATHS $ENV{HOME}/local/unsio/lib) MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB} " NEMO=" $ENV{NEMO})
MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB} " -- " $ENV{HOME}) find_library(UNSIOLIB NAMES unsio PATHS $ENV{NEMO}/lib)
if (NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND) MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB} " NEMO=" $ENV{NEMO})
MESSAGE(STATUS "Found UNSIOLIB in $ENV{HOME}/local/unsio/ =" ${UNSIOLIB}) if ( NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND)
SET(UNSIO_FOUND TRUE) MESSAGE(STATUS "Found UNSIOLIB in NEMO =" ${UNSIOLIB})
SET(UNSIOPATH $ENV{HOME}/local/unsio) SET(UNSIO_FOUND TRUE)
else () SET(UNSIOPATH $ENV{NEMO})
MESSAGE(STATUS ">>>>>22" $ENV{NEMO})
else ()
MESSAGE(STATUS ">>>>>2")
endif()
endif() endif()
endif()
if (NOT UNSIO_FOUND) # ABORT if (NOT UNSIO_FOUND) # try $HOME/local
message(SEND_ERROR "UNSIO not found - skipping building tests") find_library(UNSIOLIB NAMES unsio PATHS $ENV{HOME}/local/unsio/lib)
else() MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB} " -- " $ENV{HOME})
if (NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND)
MESSAGE(STATUS "Found UNSIOLIB in $ENV{HOME}/local/unsio/ =" ${UNSIOLIB})
SET(UNSIO_FOUND TRUE)
SET(UNSIOPATH $ENV{HOME}/local/unsio)
else ()
endif()
endif()
endif() if (NOT UNSIO_FOUND) # ABORT
message(SEND_ERROR "UNSIO not found - skipping building tests")
else()
typed_cache_set ( STRING "UNSIOPATH location" UNSIOPATH ${UNSIOPATH} )
endif()
endif () #NOT UNSIO_SETUP
# -*-cmake-*-
# ============================================================================ # ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012 # Copyright Jean-Charles LAMBERT - 2009-2013
# e-mail: Jean-Charles.Lambert@oamp.fr # e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies # address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM) # Centre de donneeS Astrophysique de Marseille (CeSAM)
...@@ -12,88 +13,85 @@ ...@@ -12,88 +13,85 @@
if ( NOT SETUP_FLAGS_INCLUDED ) if ( NOT SETUP_FLAGS_INCLUDED )
set( SETUP_FLAGS_INCLUDED 1 ) set( SETUP_FLAGS_INCLUDED 1 )
macro( typed_cache_set type doc var ) macro( typed_cache_set type doc var )
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE ) set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE ) set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
endmacro() endmacro()
typed_cache_set ( STRING "setup flags" SETUP_FLAGS_INCLUDED 1 ) typed_cache_set ( STRING "setup flags" SETUP_FLAGS_INCLUDED 1 )
# Set a default build type if none is given # Set a default build type if none is given
if ( NOT CMAKE_BUILD_TYPE ) # Debug default if ( NOT CMAKE_BUILD_TYPE ) # Debug default
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug ) typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug )
else () # else Release endif()
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Release )
endif()
# set optimizer flag # set optimizer flag
if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
typed_cache_set (STRING "Optimizer" OPT "-g -ggdb") typed_cache_set (STRING "Optimizer" OPT "-g -ggdb")
else () else ()
typed_cache_set (STRING "Optimizer" OPT "-O3") typed_cache_set (STRING "Optimizer" OPT "-O3")
endif () endif ()
#typed_cache_set (STRING "compilation warnings" WARNCPP "-Waddress -Warray-bounds -Wc++0x-compat -Wchar-subscripts -Wenum-compare -Wcomment -Wformat -Wmain -Wmissing-braces -Wparentheses -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-var") typed_cache_set (STRING "compilation warnings" WARNCPP "-Wall")
typed_cache_set (STRING "compilation warnings" WARNCPP "-Wall")
# check C compiler flags # check C compiler flags
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
set (XX -Warray-bounds -Wchar-subscripts -Wcomment -Wformat -Wmain -Wmissing-braces -Wsequence-point -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused-label -Wvolatile-register-var) set (XX -Warray-bounds -Wchar-subscripts -Wcomment -Wformat -Wmain -Wmissing-braces -Wsequence-point -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused-label -Wvolatile-register-var)
set (WARNC_TMP "") set (WARNC_TMP "")
FOREACH(CWC ${XX}) FOREACH(CWC ${XX})
MESSAGE(STATUS "Test C options==> " ${CWC}) MESSAGE(STATUS "Test C options==> " ${CWC})
check_c_compiler_flag(${CWC} HAS_OPTION) check_c_compiler_flag(${CWC} HAS_OPTION)
if (HAS_OPTION) if (HAS_OPTION)
set(WARNC_TMP "${WARNC_TMP} ${CWC}") set(WARNC_TMP "${WARNC_TMP} ${CWC}")
endif() endif()
endforeach() endforeach()
typed_cache_set (STRING "compilation warnings" WARNC ${WARNC_TMP}) typed_cache_set (STRING "compilation warnings" WARNC ${WARNC_TMP})
message(STATUS "Warnc = " ${WARNC} ) message(STATUS "Warnc = " ${WARNC} )
typed_cache_set (STRING "compilation warnings" WARNF "-Wall" ) typed_cache_set (STRING "compilation warnings" WARNF "-Wall" )
# just for testing # just for testing
option(RELEASE "RELEASE " ON) # SHARED lib default option(RELEASE "RELEASE " ON) # SHARED lib default
if ( NOT RELEASE ) # Debug TRUE if ( NOT RELEASE ) # Debug TRUE
typed_cache_set ( BOOL "RELEASE Version" RELEASE FALSE ) typed_cache_set ( BOOL "RELEASE Version" RELEASE FALSE )
else () # else FALSE else () # else FALSE
typed_cache_set ( BOOL "RELEASE Version" RELEASE TRUE ) typed_cache_set ( BOOL "RELEASE Version" RELEASE TRUE )
endif() endif()
# detect MacOS # detect MacOS
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
typed_cache_set ( BOOL "OSX detection" OSX TRUE ) typed_cache_set ( BOOL "OSX detection" OSX TRUE )
else() else()
typed_cache_set ( BOOL "OSX detection" OSX FALSE ) typed_cache_set ( BOOL "OSX detection" OSX FALSE )
endif() endif()
# SHARED lib ? # SHARED lib ?
option(BUILD_SHARED_LIBS "Shared lib " ON) # SHARED lib default option(BUILD_SHARED_LIBS "Shared lib " ON) # SHARED lib default
if ( NOT BUILD_SHARED_LIBS ) # Debug TRUE if ( NOT BUILD_SHARED_LIBS ) # Debug TRUE
typed_cache_set ( BOOL "Build SHARED" BUILD_SHARED_LIBS FALSE ) typed_cache_set ( BOOL "Build SHARED" BUILD_SHARED_LIBS FALSE )
else () # else FALSE else () # else FALSE
typed_cache_set ( BOOL "Build SHARED" BUILD_SHARED_LIBS TRUE) typed_cache_set ( BOOL "Build SHARED" BUILD_SHARED_LIBS TRUE)
endif() endif()
# set library type , SHARED or STATIC + LIB extension # set library type , SHARED or STATIC + LIB extension
if ( BUILD_SHARED_LIBS ) if ( BUILD_SHARED_LIBS )
typed_cache_set ( STRING "LIB TYPE" LIBTYPE SHARED ) typed_cache_set ( STRING "LIB TYPE" LIBTYPE SHARED )
if (OSX) if (OSX)
typed_cache_set ( STRING "LIB TYPE" LIBEXT "dylib" ) typed_cache_set ( STRING "LIB TYPE" LIBEXT "dylib" )
else() else()
typed_cache_set ( STRING "LIB TYPE" LIBEXT "so" ) typed_cache_set ( STRING "LIB TYPE" LIBEXT "so" )
endif() endif()
else () else ()
typed_cache_set ( STRING "LIB TYPE" LIBTYPE STATIC ) typed_cache_set ( STRING "LIB TYPE" LIBTYPE STATIC )
typed_cache_set ( STRING "LIB TYPE" LIBEXT "a" ) typed_cache_set ( STRING "LIB TYPE" LIBEXT "a" )
endif() endif()
if (UNSIO_INSTALLPATH) if (UNSIO_INSTALLPATH)
typed_cache_set ( STRING "UNSIO loation" UNSIOPATH ${UNSIO_INSTALLPATH} ) typed_cache_set ( STRING "UNSIO loation" UNSIOPATH ${UNSIO_INSTALLPATH} )
endif() endif()
# #
endif( NOT SETUP_FLAGS_INCLUDED ) endif( NOT SETUP_FLAGS_INCLUDED )
# ============================================================================ # ============================================================================
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment