ENDIF(WINDOWS)
ENDIF(CMAKE_BUILD_TYPE)
-SET(PLATFORM_CPPFLAGS)
-SET(PLATFORM_LDFLAGS)
-SET(PLATFORM_LIBADD)
+SET(PLATFORM_CPPFLAGS) # to be removed
+SET(PLATFORM_LDFLAGS) # to be removed
+SET(PLATFORM_LIBADD) # to be removed
+
+SET(PLATFORM_LIBS)
+SET(PLATFORM_DEFINITIONS)
+
IF(WINDOWS)
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0)
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ...
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings std::copy, std::transform, ...
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT)
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM
- SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required
- SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib)
- SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0) # to be removed
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ... # to be removed
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings std::copy, std::transform, ... # to be removed
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT) # to be removed
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile # to be removed
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM # to be removed
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required # to be removed
+ SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib) # to be removed
+ SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit # to be removed
+
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} /W0")
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS") # To disable windows warnings for strcpy, fopen, ...
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_SCL_SECURE_NO_WARNINGS") # To disable windows warnings std::copy, std::transform, ...
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DWNT")
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DPPRO_NT") # For medfile
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_USE_MATH_DEFINES") # At least for MEDMEM
+ SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_WIN32_WINNT=0x0500") # Windows 2000 or later API is required
+ SET(PLATFORM_LIBS ${PLATFORM_LIBS} Ws2_32.lib)
+ SET(PLATFORM_LIBS ${PLATFORM_LIBS} Userenv.lib) # At least for GEOM suit
+
ELSE(WINDOWS)
# SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses)
# SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type)
# SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wmissing-declarations)
# SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wunused)
# SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wall)
- SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
+ SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl) # to be removed
+ SET(PLATFORM_LIBS ${PLATFORM_LIBS} -ldl)
ENDIF(WINDOWS)
-SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4)
+SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4") # to be removed
+SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4")
SET(COMPILATION_WITH_CMAKE ON)
# MYMODULE is a string that will be used to create a target with sources containing *.cc coming from the compilation of ${MYIDLFILES}
# MYIDLFILES containing all idl files to be compiled.
# MYIDLCXXFLAGS containing all directories (only directories) where to find *.idl which depend ${MYIDLFILES}.
-MACRO(OMNIORB_ADD_MODULE MYMODULE MYIDLFILES MYIDLCXXFLAGS)
+# TYPE contains type of the library
+MACRO(OMNIORB_ADD_MODULE MYMODULE MYIDLFILES MYIDLCXXFLAGS TYPE)
SET(MYSOURCES)
FOREACH(input ${MYIDLFILES})
- STRING(REGEX REPLACE ".idl" "" base ${input})
+ GET_FILENAME_COMPONENT(base ${input} NAME_WE)
+# STRING(REGEX REPLACE ".idl" "" base ${input})
SET(OMNIORB_IDLCXXFLAGS2 "${OMNIORB_IDLCXXFLAGS}")
SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc)
SET(MYSOURCES ${MYSOURCES} ${src})
SET(outputs ${src})
SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc)
+ SET(MYSOURCES ${MYSOURCES} ${dynsrc})
SET(outputs ${outputs} ${dynsrc})
SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
SET(outputs ${outputs} ${inc})
- SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ GET_FILENAME_COMPONENT(path ${input} PATH)
+ IF(NOT path)
+ SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ ENDIF(NOT path)
SET(flags ${OMNIORB_IDLCXXFLAGS2})
STRING(REGEX MATCH "-bcxx" ISBCXX ${flags})
IF(NOT ISBCXX)
STRING(REPLACE "\\" "/" IDLPYFLAGS ${IDLPYFLAGS})
INSTALL(CODE "OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL( \"${OMNIORB_IDL_PYTHON}\" \"${IDLPYFLAGS}\" \"${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_PYIDL_DIR}\" )")
ENDFOREACH(input ${MYIDLFILES})
- ADD_LIBRARY(${MYMODULE} SHARED ${MYSOURCES})
+ ADD_LIBRARY(${MYMODULE} ${TYPE} ${MYSOURCES})
+
ENDMACRO(OMNIORB_ADD_MODULE)