[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 6 Nov 2010 11:31:38 +0000 (11:31 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 6 Nov 2010 11:31:38 +0000 (11:31 +0000)
- Add a preprocessed definition file for acledit.
- Add the pdef2def macro.
- Include wpp into build, widl links to it.
- Fix libmpg123.

svn path=/branches/cmake-bringup/; revision=49509

dll/win32/acledit/CMakeLists.txt
gcc.cmake
lib/3rdparty/libmpg123/CMakeLists.txt
msc.cmake

index 7efd220..100df03 100644 (file)
@@ -1,14 +1,16 @@
 
 set_unicode()
 
+pdef2def(acledit.pdef)
+
 list(APPEND SOURCE
     acledit.c
     stubs.c
     acledit.rc
-    acledit.def)
+    ${CMAKE_CURRENT_BINARY_DIR}/acledit.def)
 
 if(NOT MSVC)
-    set_source_files_properties(acledit.def PROPERTIES EXTERNAL_OBJECT TRUE)
+    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/acledit.def PROPERTIES EXTERNAL_OBJECT TRUE)
 endif()
 
 add_library(acledit SHARED ${SOURCE})
index 4811071..9b64008 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -159,6 +159,16 @@ macro(add_importlib_target _def_file)
   # empty for now, while import libs are shipped
 endmacro()
 
+macro(pdef2def _pdef_file)
+    get_filename_component(_file ${_pdef_file} NAME_WE)
+    add_custom_command(
+        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
+        COMMAND ${MINGW_PREFIX}cpp -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -P -E ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file}
+        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file})
+    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
+        PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
+endmacro(pdef2def _pdef_file)
+
 #pseh lib, needed with mingw
 set(PSEH_LIB "pseh")
 
index ba7bc4a..88fb37b 100644 (file)
@@ -7,7 +7,8 @@ add_definitions(
     -DEOVERFLOW=75
     -Dlseek=_lseek
     -Dread=_read
-    -Dstrdup=_strdup)
+    -Dstrdup=_strdup
+    -D_DLL -D__USE_CRTIMP)
 
 include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/reactos/libs/libmpg123)
 
index c555033..553c970 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -121,6 +121,10 @@ macro(add_importlibs MODULE)
     endforeach()\r
 endmacro()\r
 \r
+macro(pdef2def _pdef_file)\r
+# Dummy for now\r
+endmacro()\r
+\r
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)\r
 \r
 #pseh workaround\r